Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-exchange-offline
Commits
91e4d27b
Commit
91e4d27b
authored
Sep 02, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove context from HasBlock, use bitswap process instead
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
fe186f37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
offline.go
offline.go
+1
-1
offline_test.go
offline_test.go
+2
-2
No files found.
offline.go
View file @
91e4d27b
...
...
@@ -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
)
}
...
...
offline_test.go
View file @
91e4d27b
...
...
@@ -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
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment