Skip to content

Commit 3d013c1

Browse files
committed
whisper: some components are still using v5, switch to v6
1 parent 933972d commit 3d013c1

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

cmd/geth/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/ethereum/go-ethereum/eth"
3333
"github.com/ethereum/go-ethereum/node"
3434
"github.com/ethereum/go-ethereum/params"
35-
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
35+
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
3636
"github.com/naoina/toml"
3737
)
3838

cmd/utils/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import (
5555
"github.com/ethereum/go-ethereum/p2p/nat"
5656
"github.com/ethereum/go-ethereum/p2p/netutil"
5757
"github.com/ethereum/go-ethereum/params"
58-
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
58+
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
5959
"gopkg.in/urfave/cli.v1"
6060
)
6161

mobile/geth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/ethereum/go-ethereum/p2p"
3535
"github.com/ethereum/go-ethereum/p2p/nat"
3636
"github.com/ethereum/go-ethereum/params"
37-
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
37+
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
3838
)
3939

4040
// NodeConfig represents the collection of configuration values to fine tune the Geth

whisper/shhclient/client.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"github.com/ethereum/go-ethereum"
2323
"github.com/ethereum/go-ethereum/common/hexutil"
2424
"github.com/ethereum/go-ethereum/rpc"
25-
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
25+
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
2626
)
2727

28-
// Client defines typed wrappers for the Whisper v5 RPC API.
28+
// Client defines typed wrappers for the Whisper v6 RPC API.
2929
type Client struct {
3030
c *rpc.Client
3131
}
@@ -168,27 +168,27 @@ func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) error {
168168
// SubscribeMessages subscribes to messages that match the given criteria. This method
169169
// is only supported on bi-directional connections such as websockets and IPC.
170170
// NewMessageFilter uses polling and is supported over HTTP.
171-
func (ec *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
172-
return ec.c.ShhSubscribe(ctx, ch, "messages", criteria)
171+
func (sc *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
172+
return sc.c.ShhSubscribe(ctx, ch, "messages", criteria)
173173
}
174174

175175
// NewMessageFilter creates a filter within the node. This filter can be used to poll
176176
// for new messages (see FilterMessages) that satisfy the given criteria. A filter can
177177
// timeout when it was polled for in whisper.filterTimeout.
178-
func (ec *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error) {
178+
func (sc *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error) {
179179
var id string
180-
return id, ec.c.CallContext(ctx, &id, "shh_newMessageFilter", criteria)
180+
return id, sc.c.CallContext(ctx, &id, "shh_newMessageFilter", criteria)
181181
}
182182

183183
// DeleteMessageFilter removes the filter associated with the given id.
184-
func (ec *Client) DeleteMessageFilter(ctx context.Context, id string) error {
184+
func (sc *Client) DeleteMessageFilter(ctx context.Context, id string) error {
185185
var ignored bool
186-
return ec.c.CallContext(ctx, &ignored, "shh_deleteMessageFilter", id)
186+
return sc.c.CallContext(ctx, &ignored, "shh_deleteMessageFilter", id)
187187
}
188188

189189
// FilterMessages retrieves all messages that are received between the last call to
190190
// this function and match the criteria that where given when the filter was created.
191-
func (ec *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error) {
191+
func (sc *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error) {
192192
var messages []*whisper.Message
193-
return messages, ec.c.CallContext(ctx, &messages, "shh_getFilterMessages", id)
193+
return messages, sc.c.CallContext(ctx, &messages, "shh_getFilterMessages", id)
194194
}

0 commit comments

Comments
 (0)