Commit 91e4d27b authored by Jeromy's avatar Jeromy

remove context from HasBlock, use bitswap process instead

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent fe186f37
......@@ -28,7 +28,7 @@ func (e *offlineExchange) GetBlock(_ context.Context, k key.Key) (*blocks.Block,
}
// HasBlock always returns nil.
func (e *offlineExchange) HasBlock(_ context.Context, b *blocks.Block) error {
func (e *offlineExchange) HasBlock(b *blocks.Block) error {
return e.bs.Put(b)
}
......
......@@ -26,7 +26,7 @@ func TestHasBlockReturnsNil(t *testing.T) {
ex := Exchange(store)
block := blocks.NewBlock([]byte("data"))
err := ex.HasBlock(context.Background(), block)
err := ex.HasBlock(block)
if err != nil {
t.Fail()
}
......@@ -44,7 +44,7 @@ func TestGetBlocks(t *testing.T) {
expected := g.Blocks(2)
for _, b := range expected {
if err := ex.HasBlock(context.Background(), b); err != nil {
if err := ex.HasBlock(b); err != nil {
t.Fail()
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment