From be39a151814bef4c19e9f627e5b6f4b69f514c8a Mon Sep 17 00:00:00 2001 From: emonnin-epfl Date: Wed, 26 Jun 2024 15:38:41 +0200 Subject: [PATCH] check unused errors --- be1-go/internal/database/sqlite/sqlite_init.go | 4 +--- be1-go/internal/database/sqlite/sqlite_test.go | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/be1-go/internal/database/sqlite/sqlite_init.go b/be1-go/internal/database/sqlite/sqlite_init.go index aad738f972..6e84d43d83 100644 --- a/be1-go/internal/database/sqlite/sqlite_init.go +++ b/be1-go/internal/database/sqlite/sqlite_init.go @@ -203,9 +203,7 @@ func (s *SQLite) StoreFirstRumor() error { return poperrors.NewDatabaseInsertErrorMsg("first rumor: %v", err) } - err = tx.Commit() - - return nil + return tx.Commit() } func fillChannelTypes(tx *sql.Tx) error { diff --git a/be1-go/internal/database/sqlite/sqlite_test.go b/be1-go/internal/database/sqlite/sqlite_test.go index a4fc93fed7..d124414d99 100644 --- a/be1-go/internal/database/sqlite/sqlite_test.go +++ b/be1-go/internal/database/sqlite/sqlite_test.go @@ -970,6 +970,7 @@ func Test_SQLite_CheckRumor(t *testing.T) { defer os.RemoveAll(dir) err = lite.StorePubKeyUtil(serverKeysPath, []byte("sender")) + require.NoError(t, err) err = lite.StoreFirstRumor() require.NoError(t, err) @@ -984,6 +985,7 @@ func Test_SQLite_CheckRumor(t *testing.T) { timestamp1["sender1"] = 1 timestamp1["sender2"] = 0 err = lite.StoreRumor(0, "sender2", timestamp1, nil, nil) + require.NoError(t, err) timestamp := make(mrumor.RumorTimestamp) timestamp["sender1"] = 1 @@ -1055,6 +1057,7 @@ func Test_SQLite_GetRumorTimestamps(t *testing.T) { defer os.RemoveAll(dir) err = lite.StorePubKeyUtil(serverKeysPath, []byte("sender")) + require.NoError(t, err) err = lite.StoreFirstRumor() require.NoError(t, err) @@ -1094,6 +1097,7 @@ func Test_SQLite_GetAllRumors(t *testing.T) { defer os.RemoveAll(dir) err = lite.StorePubKeyUtil(serverKeysPath, []byte("sender")) + require.NoError(t, err) err = lite.StoreFirstRumor() require.NoError(t, err) @@ -1113,6 +1117,7 @@ func Test_SQLite_GetAllRumors(t *testing.T) { timestamp1["sender1"] = 0 timestamp1["sender2"] = 0 err = lite.StoreRumor(0, "sender2", timestamp1, nil, nil) + require.NoError(t, err) params, err = lite.GetAllRumorParams() require.NoError(t, err)