Skip to content

Commit

Permalink
check unused errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emonnin-epfl committed Jun 26, 2024
1 parent 7920204 commit be39a15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions be1-go/internal/database/sqlite/sqlite_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions be1-go/internal/database/sqlite/sqlite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit be39a15

Please sign in to comment.