Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmel committed Jan 25, 2024
1 parent a515a3e commit 7c749dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion suave/cstore/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (*FakeStoreBackend) FetchRecordById(suave.DataId) (suave.DataRecord, error)
return suave.DataRecord{}, nil
}

func (*FakeStoreBackend) FetchRecordsByProtocolAndBlock(blockNumber uint64, namespace string) []suave.DataRecord {
func (*FakeStoreBackend) FetchRecordsByNamespaceAndBlock(blockNumber uint64, namespace string) []suave.DataRecord {
return nil
}

Expand Down
10 changes: 5 additions & 5 deletions suave/cstore/transactional_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func TestTransactionalStore(t *testing.T) {
require.NoError(t, err)
require.Equal(t, testBid, tfetchedBid.ToInnerRecord())

require.Empty(t, tstore.FetchRecordsByProtocolAndBlock(45, "v0-test"))
require.Empty(t, tstore.FetchRecordsByProtocolAndBlock(46, "v1-test"))
require.Empty(t, tstore.FetchRecordsByNamespaceAndBlock(45, "v0-test"))
require.Empty(t, tstore.FetchRecordsByNamespaceAndBlock(46, "v1-test"))

tfetchedBids := tstore.FetchRecordsByProtocolAndBlock(46, "v0-test")
tfetchedBids := tstore.FetchRecordsByNamespaceAndBlock(46, "v0-test")
require.Equal(t, 1, len(tfetchedBids))
require.Equal(t, testBid, tfetchedBids[0].ToInnerRecord())

Expand All @@ -63,7 +63,7 @@ func TestTransactionalStore(t *testing.T) {
// Not finalized, engine should return empty
_, err = engine.FetchRecordByID(testBid.Id)
require.Error(t, err)
require.Empty(t, engine.FetchRecordsByProtocolAndBlock(46, "v0-test"))
require.Empty(t, engine.FetchRecordsByNamespaceAndBlock(46, "v0-test"))
_, err = engine.Retrieve(testBid.Id, testBid.AllowedPeekers[0], "xx")
require.Error(t, err)

Expand All @@ -73,7 +73,7 @@ func TestTransactionalStore(t *testing.T) {
require.NoError(t, err)
require.Equal(t, testBid, efetchedBid.ToInnerRecord())

efetchedBids := engine.FetchRecordsByProtocolAndBlock(46, "v0-test")
efetchedBids := engine.FetchRecordsByNamespaceAndBlock(46, "v0-test")
require.Equal(t, 1, len(efetchedBids))
require.Equal(t, testBid, efetchedBids[0].ToInnerRecord())

Expand Down

0 comments on commit 7c749dd

Please sign in to comment.