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
c4de64ff
Commit
c4de64ff
authored
Jul 31, 2019
by
liuyuhang
Committed by
33cn
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del internal rpc logic
parent
07c216d2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
310 additions
and
489 deletions
+310
-489
proposal_board.go
plugin/dapp/autonomy/commands/proposal_board.go
+44
-4
proposal_project.go
plugin/dapp/autonomy/commands/proposal_project.go
+52
-5
proposal_rule.go
plugin/dapp/autonomy/commands/proposal_rule.go
+61
-6
board_jrpc_channel_test.go
plugin/dapp/autonomy/rpc/board_jrpc_channel_test.go
+41
-4
jrpc.go
plugin/dapp/autonomy/rpc/jrpc.go
+0
-219
project_jrpc_channel_test.go
plugin/dapp/autonomy/rpc/project_jrpc_channel_test.go
+51
-5
rpc.go
plugin/dapp/autonomy/rpc/rpc.go
+0
-240
rule_jrpc_channel_test.go
plugin/dapp/autonomy/rpc/rule_jrpc_channel_test.go
+61
-6
No files found.
plugin/dapp/autonomy/commands/proposal_board.go
View file @
c4de64ff
...
...
@@ -12,6 +12,7 @@ import (
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"encoding/json"
)
// AutonomyCmd 自治系统命令行
...
...
@@ -104,8 +105,18 @@ func proposalBoard(cmd *cobra.Command, args []string) {
EndBlockHeight
:
endBlock
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropBoard"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.PropBoardTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -132,8 +143,17 @@ func revokeProposalBoard(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalBoard
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropBoard"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.RevokeProposalBoardTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -169,8 +189,18 @@ func voteProposalBoard(cmd *cobra.Command, args []string) {
ProposalID
:
ID
,
Approve
:
isapp
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropBoard"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.VoteProposalBoardTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -197,8 +227,18 @@ func terminateProposalBoard(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalBoard
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropBoard"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.TerminateProposalBoardTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
plugin/dapp/autonomy/commands/proposal_project.go
View file @
c4de64ff
...
...
@@ -10,6 +10,7 @@ import (
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"encoding/json"
)
// ProposalProjectCmd 创建提案命令
...
...
@@ -86,8 +87,18 @@ func proposalProject(cmd *cobra.Command, args []string) {
ProjectNeedBlockNum
:
projectNeedBlockNum
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropProject"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.PropProjectTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -114,8 +125,17 @@ func revokeProposalProject(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalProject
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropProject"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.RevokeProposalProjectTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -151,8 +171,17 @@ func voteProposalProject(cmd *cobra.Command, args []string) {
ProposalID
:
ID
,
Approve
:
isapp
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropProject"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.VoteProposalProjectTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -189,8 +218,17 @@ func pubVoteProposalProject(cmd *cobra.Command, args []string) {
ProposalID
:
ID
,
Oppose
:
isopp
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PubVotePropProject"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.PubVoteProposalProjectTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -217,8 +255,17 @@ func terminateProposalProject(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalProject
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropProject"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.TerminateProposalProjectTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
plugin/dapp/autonomy/commands/proposal_rule.go
View file @
c4de64ff
...
...
@@ -10,6 +10,7 @@ import (
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"encoding/json"
)
// ProposalRuleCmd 创建提案命令
...
...
@@ -73,9 +74,18 @@ func proposalRule(cmd *cobra.Command, args []string) {
StartBlockHeight
:
startBlock
,
EndBlockHeight
:
endBlock
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropRule"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.PropRuleTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -102,8 +112,17 @@ func revokeProposalRule(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalRule
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropRule"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.RevokeProposalRuleTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -139,8 +158,17 @@ func voteProposalRule(cmd *cobra.Command, args []string) {
ProposalID
:
ID
,
Approve
:
isapp
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropRule"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.VoteProposalRuleTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -167,8 +195,17 @@ func terminateProposalRule(cmd *cobra.Command, args []string) {
params
:=
&
auty
.
RevokeProposalRule
{
ProposalID
:
ID
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropRule"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.TerminateProposalRuleTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -254,8 +291,17 @@ func transferFund(cmd *cobra.Command, args []string) {
Amount
:
amount
*
types
.
Coin
,
Note
:
note
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"Transfer"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.TransferFundTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -289,8 +335,17 @@ func commentProposal(cmd *cobra.Command, args []string) {
RepHash
:
repHash
,
Comment
:
comment
,
}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"CommentProp"
,
Payload
:
payLoad
,
}
var
res
string
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
autonomy.CommentProposalTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
rpcLaddr
,
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
ctx
.
RunWithoutMarshal
()
}
...
...
plugin/dapp/autonomy/rpc/board_jrpc_channel_test.go
View file @
c4de64ff
...
...
@@ -13,30 +13,67 @@ import (
"github.com/33cn/chain33/types"
_
"github.com/33cn/plugin/plugin"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"encoding/json"
)
func
testPropBoardTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
ProposalBoard
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropBoard"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.PropBoardTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testRevokeProposalBoardTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
RevokeProposalBoard
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropBoard"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.RevokeProposalBoardTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testVoteProposalBoardTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
VoteProposalBoard
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropBoard"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.VoteProposalBoardTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testTerminateProposalBoardTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
TerminateProposalBoard
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropBoard"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.TerminateProposalBoardTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testGetProposalBoardCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
...
...
plugin/dapp/autonomy/rpc/jrpc.go
deleted
100644 → 0
View file @
07c216d2
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
rpc
import
(
"context"
"encoding/hex"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
// 提案董事会相关
// PropBoardTx 提案董事会成员RPC接口
func
(
c
*
Jrpc
)
PropBoardTx
(
parm
*
auty
.
ProposalBoard
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
propBoard
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// RevokeProposalBoardTx 撤销提案董事会成员的RPC接口
func
(
c
*
Jrpc
)
RevokeProposalBoardTx
(
parm
*
auty
.
RevokeProposalBoard
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
revokeProposalBoard
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// VoteProposalBoardTx 投票提案董事会成员的RPC接口
func
(
c
*
Jrpc
)
VoteProposalBoardTx
(
parm
*
auty
.
VoteProposalBoard
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
voteProposalBoard
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// TerminateProposalBoardTx 终止提案董事会成员的RPC接口
func
(
c
*
Jrpc
)
TerminateProposalBoardTx
(
parm
*
auty
.
TerminateProposalBoard
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
terminateProposalBoard
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// 提案项目相关
// PropProjectTx 提案项目RPC接口
func
(
c
*
Jrpc
)
PropProjectTx
(
parm
*
auty
.
ProposalProject
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
propProject
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// RevokeProposalProjectTx 撤销提案项目的RPC接口
func
(
c
*
Jrpc
)
RevokeProposalProjectTx
(
parm
*
auty
.
RevokeProposalProject
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
revokeProposalProject
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// VoteProposalProjectTx 董事会投票提案项目的RPC接口
func
(
c
*
Jrpc
)
VoteProposalProjectTx
(
parm
*
auty
.
VoteProposalProject
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
voteProposalProject
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// PubVoteProposalProjectTx 全体持票人投票提案项目的RPC接口
func
(
c
*
Jrpc
)
PubVoteProposalProjectTx
(
parm
*
auty
.
PubVoteProposalProject
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
pubVoteProposalProject
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// TerminateProposalProjectTx 终止提案项目的RPC接口
func
(
c
*
Jrpc
)
TerminateProposalProjectTx
(
parm
*
auty
.
TerminateProposalProject
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
terminateProposalProject
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// 提案规则相关
// PropRuleTx 提案规则RPC接口
func
(
c
*
Jrpc
)
PropRuleTx
(
parm
*
auty
.
ProposalRule
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
propRule
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// RevokeProposalRuleTx 撤销提案规则RPC接口
func
(
c
*
Jrpc
)
RevokeProposalRuleTx
(
parm
*
auty
.
RevokeProposalRule
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
revokeProposalRule
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// VoteProposalRuleTx 投票提案规则RPC接口
func
(
c
*
Jrpc
)
VoteProposalRuleTx
(
parm
*
auty
.
VoteProposalRule
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
voteProposalRule
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// TerminateProposalRuleTx 终止提案规则RPC接口
func
(
c
*
Jrpc
)
TerminateProposalRuleTx
(
parm
*
auty
.
TerminateProposalRule
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
terminateProposalRule
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// TransferFundTx 资金转入自治系统合约中
func
(
c
*
Jrpc
)
TransferFundTx
(
parm
*
auty
.
TransferFund
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
transferFund
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
// CommentProposalTx 提案评论
func
(
c
*
Jrpc
)
CommentProposalTx
(
parm
*
auty
.
Comment
,
result
*
interface
{})
error
{
if
parm
==
nil
{
return
types
.
ErrInvalidParam
}
reply
,
err
:=
c
.
cli
.
commentProposal
(
context
.
Background
(),
parm
)
if
err
!=
nil
{
return
err
}
*
result
=
hex
.
EncodeToString
(
reply
.
Data
)
return
nil
}
plugin/dapp/autonomy/rpc/project_jrpc_channel_test.go
View file @
c4de64ff
...
...
@@ -13,36 +13,82 @@ import (
"github.com/33cn/chain33/types"
_
"github.com/33cn/plugin/plugin"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"encoding/json"
)
func
testPropProjectTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
ProposalProject
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropProject"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.PropProjectTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testRevokeProposalProjectTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
RevokeProposalProject
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropProject"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.RevokeProposalProjectTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testVoteProposalProjectTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
VoteProposalProject
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropProject"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.VoteProposalProjectTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testPubVoteProposalProjectTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
PubVoteProposalProject
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PubVotePropProject"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.PubVoteProposalProjectTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testTerminateProposalProjectTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
TerminateProposalProject
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropProject"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.TerminateProposalProjectTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testGetProposalProjectCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
...
...
plugin/dapp/autonomy/rpc/rpc.go
deleted
100644 → 0
View file @
07c216d2
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
rpc
import
(
"golang.org/x/net/context"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
// Proposal Board 相关的接口
func
(
c
*
channelClient
)
propBoard
(
ctx
context
.
Context
,
head
*
auty
.
ProposalBoard
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionPropBoard
,
Value
:
&
auty
.
AutonomyAction_PropBoard
{
PropBoard
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
revokeProposalBoard
(
ctx
context
.
Context
,
head
*
auty
.
RevokeProposalBoard
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionRvkPropBoard
,
Value
:
&
auty
.
AutonomyAction_RvkPropBoard
{
RvkPropBoard
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
voteProposalBoard
(
ctx
context
.
Context
,
head
*
auty
.
VoteProposalBoard
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionVotePropBoard
,
Value
:
&
auty
.
AutonomyAction_VotePropBoard
{
VotePropBoard
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
terminateProposalBoard
(
ctx
context
.
Context
,
head
*
auty
.
TerminateProposalBoard
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionTmintPropBoard
,
Value
:
&
auty
.
AutonomyAction_TmintPropBoard
{
TmintPropBoard
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
// Proposal Project 相关的接口
func
(
c
*
channelClient
)
propProject
(
ctx
context
.
Context
,
head
*
auty
.
ProposalProject
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionPropProject
,
Value
:
&
auty
.
AutonomyAction_PropProject
{
PropProject
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
revokeProposalProject
(
ctx
context
.
Context
,
head
*
auty
.
RevokeProposalProject
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionRvkPropProject
,
Value
:
&
auty
.
AutonomyAction_RvkPropProject
{
RvkPropProject
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
voteProposalProject
(
ctx
context
.
Context
,
head
*
auty
.
VoteProposalProject
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionVotePropProject
,
Value
:
&
auty
.
AutonomyAction_VotePropProject
{
VotePropProject
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
pubVoteProposalProject
(
ctx
context
.
Context
,
head
*
auty
.
PubVoteProposalProject
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionPubVotePropProject
,
Value
:
&
auty
.
AutonomyAction_PubVotePropProject
{
PubVotePropProject
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
terminateProposalProject
(
ctx
context
.
Context
,
head
*
auty
.
TerminateProposalProject
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionTmintPropProject
,
Value
:
&
auty
.
AutonomyAction_TmintPropProject
{
TmintPropProject
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
// Proposal Rule 相关的接口
func
(
c
*
channelClient
)
propRule
(
ctx
context
.
Context
,
head
*
auty
.
ProposalRule
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionPropRule
,
Value
:
&
auty
.
AutonomyAction_PropRule
{
PropRule
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
revokeProposalRule
(
ctx
context
.
Context
,
head
*
auty
.
RevokeProposalRule
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionRvkPropRule
,
Value
:
&
auty
.
AutonomyAction_RvkPropRule
{
RvkPropRule
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
voteProposalRule
(
ctx
context
.
Context
,
head
*
auty
.
VoteProposalRule
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionVotePropRule
,
Value
:
&
auty
.
AutonomyAction_VotePropRule
{
VotePropRule
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
terminateProposalRule
(
ctx
context
.
Context
,
head
*
auty
.
TerminateProposalRule
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionTmintPropRule
,
Value
:
&
auty
.
AutonomyAction_TmintPropRule
{
TmintPropRule
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
transferFund
(
ctx
context
.
Context
,
head
*
auty
.
TransferFund
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionTransfer
,
Value
:
&
auty
.
AutonomyAction_Transfer
{
Transfer
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
func
(
c
*
channelClient
)
commentProposal
(
ctx
context
.
Context
,
head
*
auty
.
Comment
)
(
*
types
.
UnsignTx
,
error
)
{
val
:=
&
auty
.
AutonomyAction
{
Ty
:
auty
.
AutonomyActionCommentProp
,
Value
:
&
auty
.
AutonomyAction_CommentProp
{
CommentProp
:
head
},
}
tx
:=
&
types
.
Transaction
{
Payload
:
types
.
Encode
(
val
),
}
data
,
err
:=
types
.
FormatTxEncode
(
types
.
ExecName
(
auty
.
AutonomyX
),
tx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
types
.
UnsignTx
{
Data
:
data
},
nil
}
plugin/dapp/autonomy/rpc/rule_jrpc_channel_test.go
View file @
c4de64ff
...
...
@@ -13,30 +13,67 @@ import (
"github.com/33cn/chain33/types"
_
"github.com/33cn/plugin/plugin"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"encoding/json"
)
func
testPropRuleTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
ProposalRule
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"PropRule"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.PropRuleTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testRevokeProposalRuleTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
RevokeProposalRule
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"RvkPropRule"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.RevokeProposalRuleTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testVoteProposalRuleTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
VoteProposalRule
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"VotePropRule"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.VoteProposalRuleTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testTerminateProposalRuleTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
TerminateProposalRule
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"TmintPropRule"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.TerminateProposalRuleTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testGetProposalRuleCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
...
...
@@ -61,14 +98,32 @@ func testListProposalRuleCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
func
testTransferFundTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
TransferFund
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"Transfer"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.TransferFundTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testCommentProposalTxCmd
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
&
auty
.
Comment
{}
payLoad
,
err
:=
json
.
Marshal
(
params
)
if
err
!=
nil
{
return
err
}
pm
:=
&
rpctypes
.
CreateTxIn
{
Execer
:
types
.
ExecName
(
auty
.
AutonomyX
),
ActionName
:
"CommentProp"
,
Payload
:
payLoad
,
}
var
res
string
return
jrpc
.
Call
(
"
autonomy.CommentProposalTx"
,
params
,
&
res
)
return
jrpc
.
Call
(
"
Chain33.CreateTransaction"
,
pm
,
&
res
)
}
func
testListProposalCommentCmd
(
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