@@ -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.
2929type 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