@cryptotaxi247 / kubo / commits / 04a8a6133

rename exchange

License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 20, 2014 at 17:41 UTC 04a8a6133c2ab7a0221a6761256c772f255991ab
2 files changed +3 -3
exchange/offline/offline.go
+1 -1
@@ -14,7 +14,7 @@ import (
14
15 var OfflineMode = errors.New("Block unavailable. Operating in offline mode")
16
17 -func NewOfflineExchange() exchange.Interface {
17 +func Exchange() exchange.Interface {
18 return &offlineExchange{}
19 }
20
exchange/offline/offline_test.go
+2 -2
@@ -10,7 +10,7 @@ import (
10 )
11
12 func TestBlockReturnsErr(t *testing.T) {
13 - off := NewOfflineExchange()
13 + off := Exchange()
14 _, err := off.GetBlock(context.Background(), u.Key("foo"))
15 if err != nil {
16 return // as desired
@@ -19,7 +19,7 @@ func TestBlockReturnsErr(t *testing.T) {
19 }
20
21 func TestHasBlockReturnsNil(t *testing.T) {
22 - off := NewOfflineExchange()
22 + off := Exchange()
23 block := blocks.NewBlock([]byte("data"))
24 err := off.HasBlock(context.Background(), *block)
25 if err != nil {