fix some unit tests
This commit is contained in:
parent
1e07cc6a5a
commit
c8b23b475b
@ -27,11 +27,11 @@ func NewMockAPI(bs blockstore.Blockstore) *MockAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockAPI) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) {
|
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) {
|
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 {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("blockstore get: %w", err)
|
return nil, xerrors.Errorf("blockstore get: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ func TestImportLocal(t *testing.T) {
|
|||||||
// recreate the unixfs dag, and see if it matches the original file byte by byte
|
// 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.
|
// import the car into a memory blockstore, then export the unixfs file.
|
||||||
bs := blockstore.NewBlockstore(datastore.NewMapDatastore())
|
bs := blockstore.NewBlockstore(datastore.NewMapDatastore())
|
||||||
_, err = car.LoadCar(bs, exported.DataReader())
|
_, err = car.LoadCar(ctx, bs, exported.DataReader())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
|
dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
|
||||||
|
Loading…
Reference in New Issue
Block a user