Commit 1e3095ef authored by liuyuhang's avatar liuyuhang Committed by 33cn

add comment test and rpc test

parent 2138931a
......@@ -97,7 +97,7 @@ func (a *Autonomy) Exec_Transfer(payload *auty.TransferFund, tx *types.Transacti
}
// Exec_Comment 评论提案
func (a *Autonomy) Exec_Comment(payload *auty.Comment, tx *types.Transaction, index int) (*types.Receipt, error) {
func (a *Autonomy) Exec_CommentProp(payload *auty.Comment, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.comment(payload)
return action.commentProp(payload)
}
\ No newline at end of file
......@@ -78,6 +78,6 @@ func (a *Autonomy) ExecDelLocal_TmintPropRule(payload *auty.TerminateProposalRul
}
// ExecDelLocal_TmintPropRule 终止提案规则
func (a *Autonomy) ExecDelLocal_Comment(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalComment(receiptData)
func (a *Autonomy) ExecDelLocal_CommentProp(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalCommentProp(receiptData)
}
\ No newline at end of file
......@@ -78,6 +78,6 @@ func (a *Autonomy) ExecLocal_TmintPropRule(payload *auty.TerminateProposalRule,
}
// ExecLocal_Comment 评论提案
func (a *Autonomy) ExecLocal_Comment(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalComment(receiptData)
func (a *Autonomy) ExecLocal_CommentProp(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalCommentProp(receiptData)
}
\ No newline at end of file
......@@ -147,7 +147,7 @@ func (a *Autonomy) listProposalRule(req *auty.ReqQueryProposalRule) (types.Messa
return &rep, nil
}
func (a *Autonomy) execLocalComment(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
func (a *Autonomy) execLocalCommentProp(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
var set []*types.KeyValue
for _, log := range receiptData.Logs {
......@@ -173,12 +173,17 @@ func (a *Autonomy) execLocalComment(receiptData *types.ReceiptData) (*types.Loca
func saveCommentHeightIndex(res *auty.ReceiptProposalComment) (kvs []*types.KeyValue) {
kv := &types.KeyValue{}
kv.Key = calcCommentHeight(res.Cmt.ProposalID, dapp.HeightIndexStr(res.Height, int64(res.Index)))
kv.Value = types.Encode(&auty.RelationCmt{RepCmtHash: res.Cmt.RepCmtHash, Comment: res.Cmt.Comment})
kv.Value = types.Encode(&auty.RelationCmt{
RepCmtHash: res.Cmt.RepCmtHash,
Comment: res.Cmt.Comment,
Height: res.Height,
Index: res.Index,
})
kvs = append(kvs, kv)
return kvs
}
func (a *Autonomy) execDelLocalComment(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
func (a *Autonomy) execDelLocalCommentProp(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
var set []*types.KeyValue
for _, log := range receiptData.Logs {
......
......@@ -260,3 +260,162 @@ func TestListProposalRule(t *testing.T) {
require.Equal(t, rsp.(*auty.ReplyQueryProposalRule).PropRules[1].Height, testcase2[0].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalRule).PropRules[1].Index, int32(testcase2[0].index))
}
func TestExecLocalCommentProp(t *testing.T) {
au := &Autonomy{}
propID := "11111111111111"
Repcmt := "2222222222"
comment := "3333333333"
receiptCmt := &auty.ReceiptProposalComment {
Cmt: &auty.Comment{
ProposalID: propID,
RepCmtHash:Repcmt,
Comment:comment,
},
Height: 11,
Index: 1,
}
receipt := &types.ReceiptData{
Logs: []*types.ReceiptLog{
{Ty: auty.TyLogCommentProp, Log:types.Encode(receiptCmt)},
},
}
set, err := au.execLocalCommentProp(receipt)
require.NoError(t, err)
require.NotNil(t, set)
require.Equal(t, set.KV[0].Key, calcCommentHeight(propID,
dapp.HeightIndexStr(receiptCmt.Height, int64(receiptCmt.Index))))
require.NotNil(t, set.KV[0].Value)
}
func TestExecDelLocalCommentProp(t *testing.T) {
au := &Autonomy{}
propID := "11111111111111"
Repcmt := "2222222222"
comment := "3333333333"
receiptCmt := &auty.ReceiptProposalComment {
Cmt: &auty.Comment{
ProposalID: propID,
RepCmtHash:Repcmt,
Comment:comment,
},
Height: 11,
Index: 1,
}
receipt := &types.ReceiptData{
Logs: []*types.ReceiptLog{
{Ty: auty.TyLogCommentProp, Log:types.Encode(receiptCmt)},
},
}
set, err := au.execDelLocalCommentProp(receipt)
require.NoError(t, err)
require.NotNil(t, set)
require.Equal(t, set.KV[0].Key, calcCommentHeight(propID,
dapp.HeightIndexStr(receiptCmt.Height, int64(receiptCmt.Index))))
require.Nil(t, set.KV[0].Value)
}
func TestListProposalComment(t *testing.T) {
au := &Autonomy{
dapp.DriverBase{},
}
_, _, kvdb := util.CreateTestDB()
au.SetLocalDB(kvdb)
type statu struct {
propId string
height int64
index int64
}
propID := "3333333333"
propID1 := "2222222"
propID2 := "111111111111"
testcase1 := []statu{
{propID, 10, 2},
{propID1, 15, 1},
{propID, 20, 1},
}
testcase2 := []statu{
{propID2, 10, 1},
{propID2, 20, 2},
{propID2, 20, 5},
}
var testcase []statu
testcase = append(testcase, testcase1...)
testcase = append(testcase, testcase2...)
cur := &auty.RelationCmt{
RepCmtHash:"aaaaaa",
Comment:"bbbbbbbbbb",
}
for _, tcase := range testcase {
key := calcCommentHeight(tcase.propId,
dapp.HeightIndexStr(tcase.height, int64(tcase.index)))
cur.Height = tcase.height
cur.Index = int32(tcase.index)
value := types.Encode(cur)
kvdb.Set(key, value)
}
// 反向查找
req := &auty.ReqQueryProposalComment{
ProposalID:propID2,
Count:10,
Direction:0,
Index: -1,
}
rsp, err := au.listProposalComment(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalComment).RltCmt), len(testcase2))
k := 2
for _, tcase := range testcase2 {
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[k].Height, tcase.height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[k].Index, int32(tcase.index))
k--
}
// 正向查找
req = &auty.ReqQueryProposalComment{
ProposalID:propID2,
Count:10,
Direction:1,
Index: -1,
}
rsp, err = au.listProposalComment(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalComment).RltCmt), len(testcase2))
for i, tcase := range testcase2 {
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[i].Height, tcase.height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[i].Index, int32(tcase.index))
}
// 翻页查找
req = &auty.ReqQueryProposalComment{
ProposalID:propID2,
Count:1,
Direction:0,
Index: -1,
}
rsp, err = au.listProposalComment(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalComment).RltCmt), 1)
height := rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Height
index := rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Index
require.Equal(t, height, testcase2[2].height)
require.Equal(t, index, int32(testcase2[2].index))
//
Index := height*types.MaxTxsPerBlock + int64(index)
req = &auty.ReqQueryProposalComment{
ProposalID:propID2,
Count:10,
Direction:0,
Index: Index,
}
rsp, err = au.listProposalComment(req)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalComment).RltCmt), 2)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Height, testcase2[1].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Index, int32(testcase2[1].index))
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[1].Height, testcase2[0].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[1].Index, int32(testcase2[0].index))
}
......@@ -325,10 +325,10 @@ func (a *action) transfer(tf *auty.TransferFund) (*types.Receipt, error) {
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
}
func (a *action) comment(cm *auty.Comment) (*types.Receipt, error) {
func (a *action) commentProp(cm *auty.Comment) (*types.Receipt, error) {
if cm.Comment == "" || cm.ProposalID == "" {
err := types.ErrInvalidParam
alog.Error("autonomy comment ", "addr", a.fromaddr, "execaddr", a.execaddr, "Comment or proposalID empty", err)
alog.Error("autonomy commentProp ", "addr", a.fromaddr, "execaddr", a.execaddr, "Comment or proposalID empty", err)
return nil, err
}
var logs []*types.ReceiptLog
......
......@@ -474,3 +474,96 @@ func TestUpgradeRule(t *testing.T) {
require.Equal(t, new.LargeProjectAmount, modify.LargeProjectAmount)
require.Equal(t, new.PublicPeriod, modify.PublicPeriod)
}
func TestTransfer(t *testing.T) {
env, exec, stateDB, _ := InitEnv()
opt1 := &auty.TransferFund{
Amount: types.Coin * 190,
}
pbtx, err := transferFundTx(opt1)
require.NoError(t, err)
pbtx, err = signTx(pbtx, PrivKeyA)
require.NoError(t, err)
exec.SetEnv(env.blockHeight, env.blockTime, env.difficulty)
receipt, err := exec.Exec(pbtx, int(1))
require.NoError(t, err)
require.NotNil(t, receipt)
for _, kv := range receipt.KV {
stateDB.Set(kv.Key, kv.Value)
}
// check
accCoin := account.NewCoinsAccount()
accCoin.SetDB(stateDB)
account := accCoin.LoadExecAccount(AddrA, address.ExecAddress(auty.AutonomyX))
require.Equal(t, total - types.Coin * 190, account.Balance)
account = accCoin.LoadExecAccount(autonomyFundAddr, address.ExecAddress(auty.AutonomyX))
require.Equal(t, types.Coin * 190, account.Balance)
}
func transferFundTx(parm *auty.TransferFund) (*types.Transaction, error) {
if parm == nil {
return nil, types.ErrInvalidParam
}
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionTransfer,
Value: &auty.AutonomyAction_Transfer{Transfer: parm},
}
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func TestComment(t *testing.T) {
env, exec, stateDB, kvdb := InitEnv()
propID := "11111111111111"
Repcmt := "2222222222"
comment := "3333333333"
opt1 := &auty.Comment{
ProposalID: propID,
RepCmtHash: Repcmt,
Comment:comment,
}
pbtx, err := commentPropTx(opt1)
require.NoError(t, err)
pbtx, err = signTx(pbtx, PrivKeyA)
require.NoError(t, err)
exec.SetEnv(env.blockHeight, env.blockTime, env.difficulty)
receipt, err := exec.Exec(pbtx, int(1))
require.NoError(t, err)
require.NotNil(t, receipt)
for _, kv := range receipt.KV {
stateDB.Set(kv.Key, kv.Value)
}
receiptData := &types.ReceiptData{Ty: receipt.Ty, Logs: receipt.Logs}
set, err := exec.ExecLocal(pbtx, receiptData, int(1))
require.NoError(t, err)
require.NotNil(t, set)
for _, kv := range set.KV {
kvdb.Set(kv.Key, kv.Value)
}
// check
value, err := kvdb.Get(calcCommentHeight(propID, drivers.HeightIndexStr(env.blockHeight, 1)))
require.NoError(t, err)
cmt := &auty.RelationCmt{}
err = types.Decode(value, cmt)
require.NoError(t, err)
require.Equal(t, cmt.Comment, comment)
require.Equal(t, cmt.RepCmtHash, Repcmt)
}
func commentPropTx(parm *auty.Comment) (*types.Transaction, error) {
if parm == nil {
return nil, types.ErrInvalidParam
}
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionCommentProp,
Value: &auty.AutonomyAction_CommentProp{CommentProp: parm},
}
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
\ No newline at end of file
......@@ -101,6 +101,8 @@ message ReqQueryProposalComment {
message RelationCmt {
string repCmtHash = 1;
string comment = 2;
int64 height = 3;
int32 index = 4;
}
message ReplyQueryProposalComment {
......
// 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_test
import (
"testing"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes "github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
_ "github.com/33cn/chain33/system"
_ "github.com/33cn/plugin/plugin"
)
func testPropBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.ProposalBoard{}
var res string
return jrpc.Call("autonomy.PropBoardTx", params, &res)
}
func testRevokeProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.RevokeProposalBoard{}
var res string
return jrpc.Call("autonomy.RevokeProposalBoardTx", params, &res)
}
func testVoteProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.VoteProposalBoard{}
var res string
return jrpc.Call("autonomy.VoteProposalBoardTx", params, &res)
}
func testTerminateProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.TerminateProposalBoard{}
var res string
return jrpc.Call("autonomy.TerminateProposalBoardTx", params, &res)
}
func testGetProposalBoardCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &types.ReqString{}
params.FuncName = auty.GetProposalBoard
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalBoard{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testListProposalBoardCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &auty.ReqQueryProposalBoard{}
params.FuncName = auty.ListProposalBoard
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalBoard{}
return jrpc.Call("Chain33.Query", params, rep)
}
......@@ -10,10 +10,8 @@ import (
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"
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/stretchr/testify/assert"
_ "github.com/33cn/chain33/system"
......@@ -43,6 +41,26 @@ func TestJRPCChannel(t *testing.T) {
{fn: testVoteProposalBoardTxCmd},
{fn: testTerminateProposalBoardTxCmd},
{fn: testGetProposalBoardCmd},
{fn: testListProposalBoardCmd},
{fn: testPropProjectTxCmd},
{fn: testRevokeProposalProjectTxCmd},
{fn: testVoteProposalProjectTxCmd},
{fn: testPubVoteProposalProjectTxCmd},
{fn: testTerminateProposalProjectTxCmd},
{fn: testGetProposalProjectCmd},
{fn: testListProposalProjectCmd},
{fn: testPropRuleTxCmd},
{fn: testRevokeProposalRuleTxCmd},
{fn: testVoteProposalRuleTxCmd},
{fn: testTerminateProposalRuleTxCmd},
{fn: testGetProposalRuleCmd},
{fn: testListProposalRuleCmd},
{fn: testTransferFundTxCmd},
{fn: testCommentProposalTxCmd},
{fn: testListProposalCommentCmd},
}
for index, testCase := range testCases {
err := testCase.fn(t, jrpcClient)
......@@ -55,37 +73,3 @@ func TestJRPCChannel(t *testing.T) {
}
}
}
func testPropBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.ProposalBoard{}
var res string
return jrpc.Call("autonomy.PropBoardTx", params, &res)
}
func testRevokeProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.RevokeProposalBoard{}
var res string
return jrpc.Call("autonomy.RevokeProposalBoardTx", params, &res)
}
func testVoteProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.VoteProposalBoard{}
var res string
return jrpc.Call("autonomy.VoteProposalBoardTx", params, &res)
}
func testTerminateProposalBoardTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.TerminateProposalBoard{}
var res string
return jrpc.Call("autonomy.TerminateProposalBoardTx", params, &res)
}
func testGetProposalBoardCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &auty.ReqQueryProposalBoard{}
params.FuncName = auty.GetProposalBoard
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalBoard{}
return jrpc.Call("Chain33.Query", params, rep)
}
// 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_test
import (
"testing"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes "github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
_ "github.com/33cn/chain33/system"
_ "github.com/33cn/plugin/plugin"
)
func testPropProjectTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.ProposalProject{}
var res string
return jrpc.Call("autonomy.PropProjectTx", params, &res)
}
func testRevokeProposalProjectTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.RevokeProposalProject{}
var res string
return jrpc.Call("autonomy.RevokeProposalProjectTx", params, &res)
}
func testVoteProposalProjectTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.VoteProposalProject{}
var res string
return jrpc.Call("autonomy.VoteProposalProjectTx", params, &res)
}
func testPubVoteProposalProjectTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.PubVoteProposalProject{}
var res string
return jrpc.Call("autonomy.PubVoteProposalProjectTx", params, &res)
}
func testTerminateProposalProjectTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.TerminateProposalProject{}
var res string
return jrpc.Call("autonomy.TerminateProposalProjectTx", params, &res)
}
func testGetProposalProjectCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &types.ReqString{}
params.FuncName = auty.GetProposalProject
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalProject{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testListProposalProjectCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &auty.ReqQueryProposalProject{}
params.FuncName = auty.ListProposalProject
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalProject{}
return jrpc.Call("Chain33.Query", params, rep)
}
// 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_test
import (
"testing"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes "github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
_ "github.com/33cn/chain33/system"
_ "github.com/33cn/plugin/plugin"
)
func testPropRuleTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.ProposalRule{}
var res string
return jrpc.Call("autonomy.PropRuleTx", params, &res)
}
func testRevokeProposalRuleTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.RevokeProposalRule{}
var res string
return jrpc.Call("autonomy.RevokeProposalRuleTx", params, &res)
}
func testVoteProposalRuleTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.VoteProposalRule{}
var res string
return jrpc.Call("autonomy.VoteProposalRuleTx", params, &res)
}
func testTerminateProposalRuleTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.TerminateProposalRule{}
var res string
return jrpc.Call("autonomy.TerminateProposalRuleTx", params, &res)
}
func testGetProposalRuleCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &types.ReqString{}
params.FuncName = auty.GetProposalRule
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalRule{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testListProposalRuleCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &auty.ReqQueryProposalRule{}
params.FuncName = auty.ListProposalRule
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalRule{}
return jrpc.Call("Chain33.Query", params, rep)
}
func testTransferFundTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.TransferFund{}
var res string
return jrpc.Call("autonomy.TransferFundTx", params, &res)
}
func testCommentProposalTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := &auty.Comment{}
var res string
return jrpc.Call("autonomy.CommentProposalTx", params, &res)
}
func testListProposalCommentCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
var rep interface{}
var params rpctypes.Query4Jrpc
req := &auty.ReqQueryProposalComment{}
params.FuncName = auty.ListProposalComment
params.Payload = types.MustPBToJSON(req)
rep = &auty.ReplyQueryProposalComment{}
return jrpc.Call("Chain33.Query", params, rep)
}
\ No newline at end of file
......@@ -442,6 +442,8 @@ func (m *ReqQueryProposalComment) GetIndex() int64 {
type RelationCmt struct {
RepCmtHash string `protobuf:"bytes,1,opt,name=repCmtHash" json:"repCmtHash,omitempty"`
Comment string `protobuf:"bytes,2,opt,name=comment" json:"comment,omitempty"`
Height int64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"`
Index int32 `protobuf:"varint,4,opt,name=index" json:"index,omitempty"`
}
func (m *RelationCmt) Reset() { *m = RelationCmt{} }
......@@ -463,6 +465,20 @@ func (m *RelationCmt) GetComment() string {
return ""
}
func (m *RelationCmt) GetHeight() int64 {
if m != nil {
return m.Height
}
return 0
}
func (m *RelationCmt) GetIndex() int32 {
if m != nil {
return m.Index
}
return 0
}
type ReplyQueryProposalComment struct {
RltCmt []*RelationCmt `protobuf:"bytes,1,rep,name=rltCmt" json:"rltCmt,omitempty"`
}
......@@ -500,47 +516,48 @@ func init() {
func init() { proto.RegisterFile("rule.proto", fileDescriptor4) }
var fileDescriptor4 = []byte{
// 671 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xd3, 0x4a,
0x14, 0x95, 0xe3, 0x38, 0xa9, 0x6f, 0xfb, 0xaa, 0x76, 0x9a, 0xd7, 0xe7, 0xd7, 0xf7, 0x54, 0x45,
0x5e, 0xa0, 0xa8, 0x48, 0x41, 0x7c, 0xa9, 0x82, 0x1d, 0x04, 0x68, 0x91, 0xba, 0x80, 0xa1, 0x62,
0x3f, 0xd8, 0xb7, 0x8d, 0x55, 0x7b, 0xc6, 0x8c, 0xc7, 0x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7c, 0x02, 0x9b, 0x14, 0x53, 0xa6, 0x19, 0x93, 0x4c, 0x2d, 0x19, 0xe7, 0xdc, 0x66,
0x5c, 0xa7, 0x6d, 0xdc, 0x09, 0xfc, 0xbb, 0x1a, 0x97, 0x5a, 0xcf, 0x11, 0xf4, 0x64, 0xaa, 0x26,
0xc6, 0x3e, 0x1d, 0x17, 0x52, 0xbf, 0x8d, 0x8b, 0xad, 0xa9, 0x65, 0x7c, 0xe9, 0x99, 0xdf, 0xd4,
0xd3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x28, 0x01, 0x71, 0xa1, 0xca, 0x06, 0x00, 0x00,
// 678 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xdb, 0x38,
0x10, 0x85, 0x2c, 0xcb, 0x8e, 0x26, 0xd9, 0x20, 0x61, 0xbc, 0x59, 0x6d, 0x5a, 0x04, 0x86, 0x0e,
0x85, 0x91, 0x02, 0x2e, 0xfa, 0x85, 0xa0, 0xbd, 0xb5, 0xee, 0x47, 0x0a, 0xe4, 0xd0, 0xb2, 0x41,
0xef, 0xac, 0x34, 0x89, 0x85, 0x48, 0xa4, 0x4a, 0x51, 0x46, 0x7c, 0xe8, 0xa9, 0x87, 0xfe, 0xe8,
0x5e, 0x0a, 0x52, 0x54, 0x2c, 0xd9, 0x46, 0xd2, 0x00, 0xbd, 0x69, 0x86, 0x8f, 0xe4, 0xbc, 0x37,
0x6f, 0x28, 0x00, 0x59, 0xa6, 0x38, 0xce, 0xa5, 0x50, 0x82, 0x78, 0x6a, 0x9e, 0x63, 0x71, 0xf0,
0x4f, 0x1a, 0x89, 0x2c, 0x13, 0xbc, 0xca, 0x86, 0x3f, 0x3b, 0x30, 0x78, 0x55, 0x2a, 0xc1, 0x45,
0x36, 0xff, 0x28, 0x45, 0x2e, 0x0a, 0x96, 0xd2, 0x32, 0x45, 0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x1b, 0xf8, 0x06, 0x00, 0x00,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment