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
085f8917
Commit
085f8917
authored
Dec 01, 2018
by
lash
Committed by
Viktor Trón
Dec 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/pss: Add same api interface for all Send* methods (#18218)
parent
54abb97e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
api.go
swarm/pss/api.go
+4
-0
pss_test.go
swarm/pss/pss_test.go
+2
-2
No files found.
swarm/pss/api.go
View file @
085f8917
...
...
@@ -164,6 +164,10 @@ func (pssapi *API) SendSym(symkeyhex string, topic Topic, msg hexutil.Bytes) err
return
pssapi
.
Pss
.
SendSym
(
symkeyhex
,
topic
,
msg
[
:
])
}
func
(
pssapi
*
API
)
SendRaw
(
addr
hexutil
.
Bytes
,
topic
Topic
,
msg
hexutil
.
Bytes
)
error
{
return
pssapi
.
Pss
.
SendRaw
(
PssAddress
(
addr
),
topic
,
msg
[
:
])
}
func
(
pssapi
*
API
)
GetPeerTopics
(
pubkeyhex
string
)
([]
Topic
,
error
)
{
topics
,
_
,
err
:=
pssapi
.
Pss
.
GetPublickeyPeers
(
pubkeyhex
)
return
topics
,
err
...
...
swarm/pss/pss_test.go
View file @
085f8917
...
...
@@ -1064,7 +1064,7 @@ func testSendRaw(t *testing.T) {
// send and verify delivery
lmsg
:=
[]
byte
(
"plugh"
)
err
=
clients
[
1
]
.
Call
(
nil
,
"pss_sendRaw"
,
loaddrhex
,
topic
,
lmsg
)
err
=
clients
[
1
]
.
Call
(
nil
,
"pss_sendRaw"
,
loaddrhex
,
topic
,
hexutil
.
Encode
(
lmsg
)
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -1077,7 +1077,7 @@ func testSendRaw(t *testing.T) {
t
.
Fatalf
(
"test message (left) timed out: %v"
,
cerr
)
}
rmsg
:=
[]
byte
(
"xyzzy"
)
err
=
clients
[
0
]
.
Call
(
nil
,
"pss_sendRaw"
,
roaddrhex
,
topic
,
rmsg
)
err
=
clients
[
0
]
.
Call
(
nil
,
"pss_sendRaw"
,
roaddrhex
,
topic
,
hexutil
.
Encode
(
rmsg
)
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
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