From c8b23b475b4da5a662621b7e53c5a1b39b390d4b Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 14 Dec 2021 17:05:10 +0200 Subject: [PATCH] fix some unit tests --- chain/events/state/mock/api.go | 4 ++-- node/impl/client/client_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/events/state/mock/api.go b/chain/events/state/mock/api.go index 2ed48dc39..7a73355a5 100644 --- a/chain/events/state/mock/api.go +++ b/chain/events/state/mock/api.go @@ -27,11 +27,11 @@ func NewMockAPI(bs blockstore.Blockstore) *MockAPI { } func (m *MockAPI) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) { - return m.bs.Has(c) + return m.bs.Has(ctx, c) } func (m *MockAPI) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) { - blk, err := m.bs.Get(c) + blk, err := m.bs.Get(ctx, c) if err != nil { return nil, xerrors.Errorf("blockstore get: %w", err) } diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go index bf7ff7735..1be225278 100644 --- a/node/impl/client/client_test.go +++ b/node/impl/client/client_test.go @@ -107,7 +107,7 @@ func TestImportLocal(t *testing.T) { // recreate the unixfs dag, and see if it matches the original file byte by byte // import the car into a memory blockstore, then export the unixfs file. bs := blockstore.NewBlockstore(datastore.NewMapDatastore()) - _, err = car.LoadCar(bs, exported.DataReader()) + _, err = car.LoadCar(ctx, bs, exported.DataReader()) require.NoError(t, err) dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))