aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/storage_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/api/storage_test.go')
-rw-r--r--swarm/api/storage_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/swarm/api/storage_test.go b/swarm/api/storage_test.go
index 9d23e8f13..ef96972b6 100644
--- a/swarm/api/storage_test.go
+++ b/swarm/api/storage_test.go
@@ -17,6 +17,7 @@
package api
import (
+ "context"
"testing"
)
@@ -31,18 +32,22 @@ func TestStoragePutGet(t *testing.T) {
content := "hello"
exp := expResponse(content, "text/plain", 0)
// exp := expResponse([]byte(content), "text/plain", 0)
- bzzkey, wait, err := api.Put(content, exp.MimeType, toEncrypt)
+ ctx := context.TODO()
+ bzzkey, wait, err := api.Put(ctx, content, exp.MimeType, toEncrypt)
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+ err = wait(ctx)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
- wait()
bzzhash := bzzkey.Hex()
// to check put against the API#Get
resp0 := testGet(t, api.api, bzzhash, "")
checkResponse(t, resp0, exp)
// check storage#Get
- resp, err := api.Get(bzzhash)
+ resp, err := api.Get(context.TODO(), bzzhash)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}