aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
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 /cmd
parent83705ef6aa3645a6305a400fa175e44904a929f7 (diff)
downloadgo-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.gz
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.bz2
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.lz
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.xz
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.tar.zst
go-tangerine-b6ccc06cdaac80d09da17c25b2f450cd1f1b7914.zip
swarm/storage/feeds: Final package rename and moved files
Diffstat (limited to 'cmd')
-rw-r--r--cmd/swarm/feeds.go (renamed from cmd/swarm/mru.go)28
-rw-r--r--cmd/swarm/feeds_test.go (renamed from cmd/swarm/mru_test.go)14
2 files changed, 21 insertions, 21 deletions
diff --git a/cmd/swarm/mru.go b/cmd/swarm/feeds.go
index 6c6d44c0a..b7b513556 100644
--- a/cmd/swarm/mru.go
+++ b/cmd/swarm/feeds.go
@@ -27,15 +27,15 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
swarm "github.com/ethereum/go-ethereum/swarm/api/client"
- "github.com/ethereum/go-ethereum/swarm/storage/mru"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds"
"gopkg.in/urfave/cli.v1"
)
-func NewGenericSigner(ctx *cli.Context) mru.Signer {
- return mru.NewGenericSigner(getPrivKey(ctx))
+func NewGenericSigner(ctx *cli.Context) feeds.Signer {
+ return feeds.NewGenericSigner(getPrivKey(ctx))
}
-func getTopic(ctx *cli.Context) (topic mru.Topic) {
+func getTopic(ctx *cli.Context) (topic feeds.Topic) {
var name = ctx.String(SwarmFeedNameFlag.Name)
var relatedTopic = ctx.String(SwarmFeedTopicFlag.Name)
var relatedTopicBytes []byte
@@ -48,7 +48,7 @@ func getTopic(ctx *cli.Context) (topic mru.Topic) {
}
}
- topic, err = mru.NewTopic(name, relatedTopicBytes)
+ topic, err = feeds.NewTopic(name, relatedTopicBytes)
if err != nil {
utils.Fatalf("Error parsing topic: %s", err)
}
@@ -65,7 +65,7 @@ func feedCreateManifest(ctx *cli.Context) {
client = swarm.NewClient(bzzapi)
)
- newFeedUpdateRequest := mru.NewFirstRequest(getTopic(ctx))
+ newFeedUpdateRequest := feeds.NewFirstRequest(getTopic(ctx))
newFeedUpdateRequest.Feed.User = feedGetUser(ctx)
manifestAddress, err := client.CreateFeedWithManifest(newFeedUpdateRequest)
@@ -100,18 +100,18 @@ func feedUpdate(ctx *cli.Context) {
return
}
- var updateRequest *mru.Request
- var query *mru.Query
+ var updateRequest *feeds.Request
+ var query *feeds.Query
if manifestAddressOrDomain == "" {
- query = new(mru.Query)
+ query = new(feeds.Query)
query.User = signer.Address()
query.Topic = getTopic(ctx)
}
- // Retrieve feed status and metadata out of the manifest
- updateRequest, err = client.GetFeedMetadata(query, manifestAddressOrDomain)
+ // Retrieve a feed update request
+ updateRequest, err = client.GetFeedRequest(query, manifestAddressOrDomain)
if err != nil {
utils.Fatalf("Error retrieving feed status: %s", err.Error())
}
@@ -139,14 +139,14 @@ func feedInfo(ctx *cli.Context) {
manifestAddressOrDomain = ctx.String(SwarmFeedManifestFlag.Name)
)
- var query *mru.Query
+ var query *feeds.Query
if manifestAddressOrDomain == "" {
- query = new(mru.Query)
+ query = new(feeds.Query)
query.Topic = getTopic(ctx)
query.User = feedGetUser(ctx)
}
- metadata, err := client.GetFeedMetadata(query, manifestAddressOrDomain)
+ metadata, err := client.GetFeedRequest(query, manifestAddressOrDomain)
if err != nil {
utils.Fatalf("Error retrieving feed metadata: %s", err.Error())
return
diff --git a/cmd/swarm/mru_test.go b/cmd/swarm/feeds_test.go
index c0c43aca4..a403f8fe4 100644
--- a/cmd/swarm/mru_test.go
+++ b/cmd/swarm/feeds_test.go
@@ -26,11 +26,11 @@ import (
"testing"
"github.com/ethereum/go-ethereum/swarm/api"
- "github.com/ethereum/go-ethereum/swarm/storage/mru/lookup"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds/lookup"
"github.com/ethereum/go-ethereum/swarm/testutil"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/swarm/storage/mru"
+ "github.com/ethereum/go-ethereum/swarm/storage/feeds"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
@@ -65,7 +65,7 @@ func TestCLIFeedUpdate(t *testing.T) {
}
// compose a topic. We'll be doing quotes about Miguel de Cervantes
- var topic mru.Topic
+ var topic feeds.Topic
subject := []byte("Miguel de Cervantes")
copy(topic[:], subject[:])
name := "quotes"
@@ -95,19 +95,19 @@ func TestCLIFeedUpdate(t *testing.T) {
// build the same topic as before, this time
// we use NewTopic to create a topic automatically.
- topic, err = mru.NewTopic(name, subject)
+ topic, err = feeds.NewTopic(name, subject)
if err != nil {
t.Fatal(err)
}
// Feed configures whose updates we will be looking up.
- feed := mru.Feed{
+ feed := feeds.Feed{
Topic: topic,
User: address,
}
// Build a query to get the latest update
- query := mru.NewQueryLatest(&feed, lookup.NoClue)
+ query := feeds.NewQueryLatest(&feed, lookup.NoClue)
// retrieve content!
reader, err := client.QueryFeed(query, "")
@@ -139,7 +139,7 @@ func TestCLIFeedUpdate(t *testing.T) {
cmd.ExpectExit()
// verify we can deserialize the result as a valid JSON
- var request mru.Request
+ var request feeds.Request
err = json.Unmarshal([]byte(matches[0]), &request)
if err != nil {
t.Fatal(err)