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
e466b9dd
Commit
e466b9dd
authored
Nov 21, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wire GetBlocks into blockservice
parent
373e19cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
offline.go
offline.go
+5
-1
offline_test.go
offline_test.go
+1
-1
No files found.
offline.go
View file @
e466b9dd
...
...
@@ -30,7 +30,7 @@ func (_ *offlineExchange) GetBlock(context.Context, u.Key) (*blocks.Block, error
}
// HasBlock always returns nil.
func
(
_
*
offlineExchange
)
HasBlock
(
context
.
Context
,
blocks
.
Block
)
error
{
func
(
_
*
offlineExchange
)
HasBlock
(
context
.
Context
,
*
blocks
.
Block
)
error
{
return
nil
}
...
...
@@ -38,3 +38,7 @@ func (_ *offlineExchange) HasBlock(context.Context, blocks.Block) error {
func
(
_
*
offlineExchange
)
Close
()
error
{
return
nil
}
func
(
_
*
offlineExchange
)
GetBlocks
(
context
.
Context
,
[]
u
.
Key
)
(
<-
chan
*
blocks
.
Block
,
error
)
{
return
nil
,
OfflineMode
}
offline_test.go
View file @
e466b9dd
...
...
@@ -21,7 +21,7 @@ func TestBlockReturnsErr(t *testing.T) {
func
TestHasBlockReturnsNil
(
t
*
testing
.
T
)
{
off
:=
Exchange
()
block
:=
blocks
.
NewBlock
([]
byte
(
"data"
))
err
:=
off
.
HasBlock
(
context
.
Background
(),
*
block
)
err
:=
off
.
HasBlock
(
context
.
Background
(),
block
)
if
err
!=
nil
{
t
.
Fatal
(
""
)
}
...
...
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