diff --git a/swarm/api/api_test.go b/swarm/api/api_test.go index da1d8bcf23..1f1178549e 100644 --- a/swarm/api/api_test.go +++ b/swarm/api/api_test.go @@ -109,10 +109,11 @@ func TestApiPut(t *testing.T) { content := "hello" exp := expResponse(content, "text/plain", 0) // exp := expResponse([]byte(content), "text/plain", 0) - key, _, err := api.Put(content, exp.MimeType) + key, wait, err := api.Put(content, exp.MimeType) if err != nil { t.Fatalf("unexpected error: %v", err) } + wait() resp := testGet(t, api, key.Hex(), "") checkResponse(t, resp, exp) }) diff --git a/swarm/api/storage.go b/swarm/api/storage.go index 4679fabad3..8876967792 100644 --- a/swarm/api/storage.go +++ b/swarm/api/storage.go @@ -42,10 +42,11 @@ func NewStorage(api *Api) *Storage { // // DEPRECATED: Use the HTTP API instead func (self *Storage) Put(content, contentType string) (string, error) { - key, _, err := self.api.Put(content, contentType) + key, wait, err := self.api.Put(content, contentType) if err != nil { return "", err } + wait() return key.Hex(), err }