aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http
diff options
context:
space:
mode:
authorJavier Peletier <jm@epiclabs.io>2018-09-30 15:51:11 +0800
committerJavier Peletier <jm@epiclabs.io>2018-10-03 15:12:06 +0800
commitb6ccc06cdaac80d09da17c25b2f450cd1f1b7914 (patch)
tree2413da1a2025e901eecf253399fe4bfebbdd1925 /swarm/api/http
parent83705ef6aa3645a6305a400fa175e44904a929f7 (diff)
downloaddexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.gz
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.bz2
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.lz
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.xz
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.zst
dexon-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.zip
swarm/storage/feeds: Final package rename and moved files
Diffstat (limited to 'swarm/api/http')
-rw-r--r--swarm/api/http/server.go10
-rw-r--r--swarm/api/http/server_test.go20
2 files changed, 15 insertions, 15 deletions
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index c5b3b564c..84e06d09f 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -40,7 +40,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/api"
"github.com/ethereum/go-ethereum/swarm/log"
"github.com/ethereum/go-ethereum/swarm/storage"
- "github.com/ethereum/go-ethereum/swarm/storage/mru"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds"
"github.com/rs/cors"
)
@@ -466,7 +466,7 @@ func (s *Server) HandlePostFeed(w http.ResponseWriter, r *http.Request) {
log.Debug("handle.post.feed", "ruid", ruid)
var err error
- // Creation and update must send mru.updateRequestJSON JSON structure
+ // Creation and update must send feeds.updateRequestJSON JSON structure
body, err := ioutil.ReadAll(r.Body)
if err != nil {
RespondError(w, r, err.Error(), http.StatusInternalServerError)
@@ -484,7 +484,7 @@ func (s *Server) HandlePostFeed(w http.ResponseWriter, r *http.Request) {
return
}
- var updateRequest mru.Request
+ var updateRequest feeds.Request
updateRequest.Feed = *feed
query := r.URL.Query()
@@ -582,7 +582,7 @@ func (s *Server) HandleGetFeed(w http.ResponseWriter, r *http.Request) {
return
}
- lookupParams := &mru.Query{Feed: *feed}
+ lookupParams := &feeds.Query{Feed: *feed}
if err = lookupParams.FromValues(r.URL.Query()); err != nil { // parse period, version
RespondError(w, r, fmt.Sprintf("invalid feed update request:%s", err), http.StatusBadRequest)
return
@@ -606,7 +606,7 @@ func (s *Server) HandleGetFeed(w http.ResponseWriter, r *http.Request) {
func (s *Server) translateFeedError(w http.ResponseWriter, r *http.Request, supErr string, err error) (int, error) {
code := 0
defaultErr := fmt.Errorf("%s: %v", supErr, err)
- rsrcErr, ok := err.(*mru.Error)
+ rsrcErr, ok := err.(*feeds.Error)
if !ok && rsrcErr != nil {
code = rsrcErr.Code()
}
diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go
index a7c7e3003..16813cab5 100644
--- a/swarm/api/http/server_test.go
+++ b/swarm/api/http/server_test.go
@@ -38,7 +38,7 @@ import (
"testing"
"time"
- "github.com/ethereum/go-ethereum/swarm/storage/mru/lookup"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds/lookup"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@@ -48,7 +48,7 @@ import (
swarm "github.com/ethereum/go-ethereum/swarm/api/client"
"github.com/ethereum/go-ethereum/swarm/multihash"
"github.com/ethereum/go-ethereum/swarm/storage"
- "github.com/ethereum/go-ethereum/swarm/storage/mru"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds"
"github.com/ethereum/go-ethereum/swarm/testutil"
)
@@ -62,12 +62,12 @@ func serverFunc(api *api.API) testutil.TestServer {
return NewServer(api, "")
}
-func newTestSigner() (*mru.GenericSigner, error) {
+func newTestSigner() (*feeds.GenericSigner, error) {
privKey, err := crypto.HexToECDSA("deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef")
if err != nil {
return nil, err
}
- return mru.NewGenericSigner(privKey), nil
+ return feeds.NewGenericSigner(privKey), nil
}
// test the transparent resolving of multihash-containing feed updates with bzz:// scheme
@@ -103,8 +103,8 @@ func TestBzzFeedMultihash(t *testing.T) {
log.Info("added data", "manifest", string(b), "data", common.ToHex(mh))
- topic, _ := mru.NewTopic("foo.eth", nil)
- updateRequest := mru.NewFirstRequest(topic)
+ topic, _ := feeds.NewTopic("foo.eth", nil)
+ updateRequest := feeds.NewFirstRequest(topic)
updateRequest.SetData(mh)
@@ -182,8 +182,8 @@ func TestBzzFeed(t *testing.T) {
//data for update 2
update2Data := []byte("foo")
- topic, _ := mru.NewTopic("foo.eth", nil)
- updateRequest := mru.NewFirstRequest(topic)
+ topic, _ := feeds.NewTopic("foo.eth", nil)
+ updateRequest := feeds.NewFirstRequest(topic)
if err != nil {
t.Fatal(err)
}
@@ -319,7 +319,7 @@ func TestBzzFeed(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- updateRequest = &mru.Request{}
+ updateRequest = &feeds.Request{}
if err = updateRequest.UnmarshalJSON(b); err != nil {
t.Fatalf("Error decoding feed metadata: %s", err)
}
@@ -365,7 +365,7 @@ func TestBzzFeed(t *testing.T) {
// test manifest-less queries
log.Info("get first update in update1Timestamp via direct query")
- query := mru.NewQuery(&updateRequest.Feed, update1Timestamp, lookup.NoClue)
+ query := feeds.NewQuery(&updateRequest.Feed, update1Timestamp, lookup.NoClue)
urlq, err := url.Parse(fmt.Sprintf("%s/bzz-feed:/", srv.URL))
if err != nil {