aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2018-03-22 22:48:52 +0800
committerGuillaume Ballet <gballet@gmail.com>2018-03-22 22:48:52 +0800
commit3d013c193942aad9820361795cf3a17bb99470b1 (patch)
tree13c43a625b4b80ef8d84184a6e23778f2d5657e9 /whisper
parent933972d139b0fe291cb01c7ad2c0f9d3109a68dd (diff)
downloaddexon-3d013c193942aad9820361795cf3a17bb99470b1.tar
dexon-3d013c193942aad9820361795cf3a17bb99470b1.tar.gz
dexon-3d013c193942aad9820361795cf3a17bb99470b1.tar.bz2
dexon-3d013c193942aad9820361795cf3a17bb99470b1.tar.lz
dexon-3d013c193942aad9820361795cf3a17bb99470b1.tar.xz
dexon-3d013c193942aad9820361795cf3a17bb99470b1.tar.zst
dexon-3d013c193942aad9820361795cf3a17bb99470b1.zip
whisper: some components are still using v5, switch to v6
Diffstat (limited to 'whisper')
-rw-r--r--whisper/shhclient/client.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go
index 61b4775d9..bbe694baa 100644
--- a/whisper/shhclient/client.go
+++ b/whisper/shhclient/client.go
@@ -22,10 +22,10 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc"
- whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
+ whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
)
-// Client defines typed wrappers for the Whisper v5 RPC API.
+// Client defines typed wrappers for the Whisper v6 RPC API.
type Client struct {
c *rpc.Client
}
@@ -168,27 +168,27 @@ func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) error {
// SubscribeMessages subscribes to messages that match the given criteria. This method
// is only supported on bi-directional connections such as websockets and IPC.
// NewMessageFilter uses polling and is supported over HTTP.
-func (ec *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
- return ec.c.ShhSubscribe(ctx, ch, "messages", criteria)
+func (sc *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
+ return sc.c.ShhSubscribe(ctx, ch, "messages", criteria)
}
// NewMessageFilter creates a filter within the node. This filter can be used to poll
// for new messages (see FilterMessages) that satisfy the given criteria. A filter can
// timeout when it was polled for in whisper.filterTimeout.
-func (ec *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error) {
+func (sc *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error) {
var id string
- return id, ec.c.CallContext(ctx, &id, "shh_newMessageFilter", criteria)
+ return id, sc.c.CallContext(ctx, &id, "shh_newMessageFilter", criteria)
}
// DeleteMessageFilter removes the filter associated with the given id.
-func (ec *Client) DeleteMessageFilter(ctx context.Context, id string) error {
+func (sc *Client) DeleteMessageFilter(ctx context.Context, id string) error {
var ignored bool
- return ec.c.CallContext(ctx, &ignored, "shh_deleteMessageFilter", id)
+ return sc.c.CallContext(ctx, &ignored, "shh_deleteMessageFilter", id)
}
// FilterMessages retrieves all messages that are received between the last call to
// this function and match the criteria that where given when the filter was created.
-func (ec *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error) {
+func (sc *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error) {
var messages []*whisper.Message
- return messages, ec.c.CallContext(ctx, &messages, "shh_getFilterMessages", id)
+ return messages, sc.c.CallContext(ctx, &messages, "shh_getFilterMessages", id)
}