Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
1ba67897
Commit
1ba67897
authored
Sep 23, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jrpc test more field
parent
05a5231c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
jrpc_channel_test.go
plugin/dapp/retrieve/rpc/jrpc_channel_test.go
+25
-2
No files found.
plugin/dapp/retrieve/rpc/jrpc_channel_test.go
View file @
1ba67897
...
...
@@ -8,11 +8,14 @@ import (
"strings"
"testing"
"github.com/33cn/chain33/common"
commonlog
"github.com/33cn/chain33/common/log"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util/testnode"
"github.com/33cn/plugin/plugin/dapp/retrieve/rpc"
pty
"github.com/33cn/plugin/plugin/dapp/retrieve/types"
"github.com/stretchr/testify/assert"
...
...
@@ -67,8 +70,28 @@ func testPrepareCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
}
func
testPerformCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
rpc
.
RetrievePerformTx
{}
return
jrpc
.
Call
(
"retrieve.CreateRawRetrievePerformTx"
,
params
,
nil
)
params
:=
rpc
.
RetrievePerformTx
{
BackupAddr
:
"b"
,
DefaultAddr
:
"d"
,
Assets
:
[]
rpc
.
Asset
{{
"e"
,
"s"
}},
}
var
txS
string
t
.
Log
(
"tx info"
,
"x"
,
params
.
Assets
)
err
:=
jrpc
.
Call
(
"retrieve.CreateRawRetrievePerformTx"
,
&
params
,
&
txS
)
var
tx
types
.
Transaction
bytes
,
err
:=
common
.
FromHex
(
txS
)
if
err
!=
nil
{
return
err
}
err
=
types
.
Decode
(
bytes
,
&
tx
)
if
err
!=
nil
{
return
err
}
var
p2
pty
.
RetrieveAction
err
=
types
.
Decode
(
tx
.
Payload
,
&
p2
)
t
.
Log
(
"asset"
,
p2
.
GetPerform
()
.
GetAssets
())
return
err
}
func
testCancelCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
...
...
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