Commit 391b626c authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by Jeromy

rename exchange

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent abc92d59
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
var OfflineMode = errors.New("Block unavailable. Operating in offline mode") var OfflineMode = errors.New("Block unavailable. Operating in offline mode")
func NewOfflineExchange() exchange.Interface { func Exchange() exchange.Interface {
return &offlineExchange{} return &offlineExchange{}
} }
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
) )
func TestBlockReturnsErr(t *testing.T) { func TestBlockReturnsErr(t *testing.T) {
off := NewOfflineExchange() off := Exchange()
_, err := off.GetBlock(context.Background(), u.Key("foo")) _, err := off.GetBlock(context.Background(), u.Key("foo"))
if err != nil { if err != nil {
return // as desired return // as desired
...@@ -19,7 +19,7 @@ func TestBlockReturnsErr(t *testing.T) { ...@@ -19,7 +19,7 @@ func TestBlockReturnsErr(t *testing.T) {
} }
func TestHasBlockReturnsNil(t *testing.T) { func TestHasBlockReturnsNil(t *testing.T) {
off := NewOfflineExchange() off := Exchange()
block := blocks.NewBlock([]byte("data")) block := blocks.NewBlock([]byte("data"))
err := off.HasBlock(context.Background(), *block) err := off.HasBlock(context.Background(), *block)
if err != nil { if err != nil {
......
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