diff options
author | Elad <theman@elad.im> | 2019-05-06 02:34:22 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:52 +0800 |
commit | ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1 (patch) | |
tree | 396077f7f33307321110f17bc3a19abe115e5d47 /swarm/api/http/test_server.go | |
parent | 3030893a21b17a0e90ddd0047d0f310fee8335a0 (diff) | |
download | go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar.gz go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar.bz2 go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar.lz go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar.xz go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.tar.zst go-tangerine-ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1.zip |
swarm: push tags integration - request flow
swarm/api: integrate tags to count chunks being split and stored
swarm/api/http: integrate tags in middleware for HTTP `POST` calls and assert chunks being calculated and counted correctly
swarm: remove deprecated and unused code, add swarm hash to DoneSplit signature, remove calls to the api client from the http package
Diffstat (limited to 'swarm/api/http/test_server.go')
-rw-r--r-- | swarm/api/http/test_server.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/swarm/api/http/test_server.go b/swarm/api/http/test_server.go index 928a6e972..fbb3366e2 100644 --- a/swarm/api/http/test_server.go +++ b/swarm/api/http/test_server.go @@ -24,6 +24,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/swarm/api" + "github.com/ethereum/go-ethereum/swarm/chunk" "github.com/ethereum/go-ethereum/swarm/storage" "github.com/ethereum/go-ethereum/swarm/storage/feed" "github.com/ethereum/go-ethereum/swarm/storage/localstore" @@ -44,7 +45,9 @@ func NewTestSwarmServer(t *testing.T, serverFunc func(*api.API) TestServer, reso t.Fatal(err) } - fileStore := storage.NewFileStore(localStore, storage.NewFileStoreParams()) + tags := chunk.NewTags() + fileStore := storage.NewFileStore(localStore, storage.NewFileStoreParams(), tags) + // Swarm feeds test setup feedsDir, err := ioutil.TempDir("", "swarm-feeds-test") if err != nil { @@ -56,12 +59,13 @@ func NewTestSwarmServer(t *testing.T, serverFunc func(*api.API) TestServer, reso t.Fatal(err) } - swarmApi := api.NewAPI(fileStore, resolver, feeds.Handler, nil) + swarmApi := api.NewAPI(fileStore, resolver, feeds.Handler, nil, tags) apiServer := httptest.NewServer(serverFunc(swarmApi)) tss := &TestSwarmServer{ Server: apiServer, FileStore: fileStore, + Tags: tags, dir: swarmDir, Hasher: storage.MakeHashFunc(storage.DefaultHash)(), cleanup: func() { @@ -81,6 +85,7 @@ type TestSwarmServer struct { *httptest.Server Hasher storage.SwarmHash FileStore *storage.FileStore + Tags *chunk.Tags dir string cleanup func() CurrentTime uint64 |