@@ -22,10 +22,10 @@ import (
22
22
"github.com/ethereum/go-ethereum"
23
23
"github.com/ethereum/go-ethereum/common/hexutil"
24
24
"github.com/ethereum/go-ethereum/rpc"
25
- whisper "github.com/ethereum/go-ethereum/whisper/whisperv5 "
25
+ whisper "github.com/ethereum/go-ethereum/whisper/whisperv6 "
26
26
)
27
27
28
- // Client defines typed wrappers for the Whisper v5 RPC API.
28
+ // Client defines typed wrappers for the Whisper v6 RPC API.
29
29
type Client struct {
30
30
c * rpc.Client
31
31
}
@@ -168,27 +168,27 @@ func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) error {
168
168
// SubscribeMessages subscribes to messages that match the given criteria. This method
169
169
// is only supported on bi-directional connections such as websockets and IPC.
170
170
// 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 )
173
173
}
174
174
175
175
// NewMessageFilter creates a filter within the node. This filter can be used to poll
176
176
// for new messages (see FilterMessages) that satisfy the given criteria. A filter can
177
177
// 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 ) {
179
179
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 )
181
181
}
182
182
183
183
// 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 {
185
185
var ignored bool
186
- return ec .c .CallContext (ctx , & ignored , "shh_deleteMessageFilter" , id )
186
+ return sc .c .CallContext (ctx , & ignored , "shh_deleteMessageFilter" , id )
187
187
}
188
188
189
189
// FilterMessages retrieves all messages that are received between the last call to
190
190
// 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 ) {
192
192
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 )
194
194
}
0 commit comments