Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
cf799e5e
Unverified
Commit
cf799e5e
authored
Mar 26, 2018
by
Guillaume Ballet
Committed by
GitHub
Mar 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
whisper: switch all remaining components from v5 to v6
parents
c053f114
3d013c19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
config.go
cmd/geth/config.go
+1
-1
flags.go
cmd/utils/flags.go
+1
-1
geth.go
mobile/geth.go
+1
-1
client.go
whisper/shhclient/client.go
+10
-10
No files found.
cmd/geth/config.go
View file @
cf799e5e
...
...
@@ -32,7 +32,7 @@ import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
"github.com/naoina/toml"
)
...
...
cmd/utils/flags.go
View file @
cf799e5e
...
...
@@ -55,7 +55,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/p2p/netutil"
"github.com/ethereum/go-ethereum/params"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
"gopkg.in/urfave/cli.v1"
)
...
...
mobile/geth.go
View file @
cf799e5e
...
...
@@ -34,7 +34,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
// NodeConfig represents the collection of configuration values to fine tune the Geth
...
...
whisper/shhclient/client.go
View file @
cf799e5e
...
...
@@ -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/whisperv
5
"
whisper
"github.com/ethereum/go-ethereum/whisper/whisperv
6
"
)
// Client defines typed wrappers for the Whisper v
5
RPC API.
// Client defines typed wrappers for the Whisper v
6
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
(
e
c
*
Client
)
SubscribeMessages
(
ctx
context
.
Context
,
criteria
whisper
.
Criteria
,
ch
chan
<-
*
whisper
.
Message
)
(
ethereum
.
Subscription
,
error
)
{
return
e
c
.
c
.
ShhSubscribe
(
ctx
,
ch
,
"messages"
,
criteria
)
func
(
s
c
*
Client
)
SubscribeMessages
(
ctx
context
.
Context
,
criteria
whisper
.
Criteria
,
ch
chan
<-
*
whisper
.
Message
)
(
ethereum
.
Subscription
,
error
)
{
return
s
c
.
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
(
e
c
*
Client
)
NewMessageFilter
(
ctx
context
.
Context
,
criteria
whisper
.
Criteria
)
(
string
,
error
)
{
func
(
s
c
*
Client
)
NewMessageFilter
(
ctx
context
.
Context
,
criteria
whisper
.
Criteria
)
(
string
,
error
)
{
var
id
string
return
id
,
e
c
.
c
.
CallContext
(
ctx
,
&
id
,
"shh_newMessageFilter"
,
criteria
)
return
id
,
s
c
.
c
.
CallContext
(
ctx
,
&
id
,
"shh_newMessageFilter"
,
criteria
)
}
// DeleteMessageFilter removes the filter associated with the given id.
func
(
e
c
*
Client
)
DeleteMessageFilter
(
ctx
context
.
Context
,
id
string
)
error
{
func
(
s
c
*
Client
)
DeleteMessageFilter
(
ctx
context
.
Context
,
id
string
)
error
{
var
ignored
bool
return
e
c
.
c
.
CallContext
(
ctx
,
&
ignored
,
"shh_deleteMessageFilter"
,
id
)
return
s
c
.
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
(
e
c
*
Client
)
FilterMessages
(
ctx
context
.
Context
,
id
string
)
([]
*
whisper
.
Message
,
error
)
{
func
(
s
c
*
Client
)
FilterMessages
(
ctx
context
.
Context
,
id
string
)
([]
*
whisper
.
Message
,
error
)
{
var
messages
[]
*
whisper
.
Message
return
messages
,
e
c
.
c
.
CallContext
(
ctx
,
&
messages
,
"shh_getFilterMessages"
,
id
)
return
messages
,
s
c
.
c
.
CallContext
(
ctx
,
&
messages
,
"shh_getFilterMessages"
,
id
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment