Commit 8687a4d2 authored by 张振华's avatar 张振华

Merge branch 'master' into guess-rpc-test

parents 3610d578 6fae0e58
#!/usr/bin/env bash
RAW_TX_HASH=""
CASE_ERR=""
#color
RED='\033[1;31m'
GRE='\033[1;32m'
NOC='\033[0m'
echo_rst() {
if [ "$2" -eq 0 ]; then
echo -e "${GRE}$1 ok${NOC}"
elif [ "$2" -eq 2 ]; then
echo -e "${GRE}$1 not support${NOC}"
CASE_ERR="err"
echo $CASE_ERR
else
echo -e "${RED}$1 fail${NOC}"
CASE_ERR="err"
echo $CASE_ERR
fi
}
chain33_BlockWait() {
local MAIN_HTTP=$2
local req='"method":"Chain33.GetLastHeader","params":[]'
cur_height=$(curl -ksd "{$req}" "${MAIN_HTTP}" | jq ".result.height")
expect=$((cur_height + ${1}))
local count=0
while true; do
new_height=$(curl -ksd "{$req}" "${MAIN_HTTP}" | jq ".result.height")
if [ "${new_height}" -ge "${expect}" ]; then
break
fi
count=$((count + 1))
sleep 1
done
echo "wait new block $count s, cur height=$expect,old=$cur_height"
}
chain33_QueryTx() {
local MAIN_HTTP=$2
chain33_BlockWait 1 "$MAIN_HTTP"
local txhash="$1"
local req='"method":"Chain33.QueryTransaction","params":[{"hash":"'"$txhash"'"}]'
local times=10
while true; do
ret=$(curl -ksd "{$req}" "${MAIN_HTTP}" | jq -r ".result.tx.hash")
if [ "${ret}" != "${1}" ]; then
chain33_BlockWait 1 "$MAIN_HTTP"
times=$((times - 1))
if [ $times -le 0 ]; then
echo "====query tx=$1 failed"
curl -ksd "{$req}" "${MAIN_HTTP}"
exit 1
fi
else
RAW_TX_HASH=$txhash
echo "====query tx=$RAW_TX_HASH success"
break
fi
done
}
chain33_SendTx() {
local signedTx=$1
local MAIN_HTTP=$2
req='"method":"Chain33.SendTransaction","params":[{"token":"BTY","data":"'"$signedTx"'"}]'
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
err=$(jq '(.error)' <<<"$resp")
txhash=$(jq -r ".result" <<<"$resp")
if [ "$err" == null ]; then
chain33_QueryTx "$txhash" "$MAIN_HTTP"
else
echo "send tx error:$err"
fi
}
chain33_SendToAddress() {
local from="$1"
local to="$2"
local amount=$3
local MAIN_HTTP=$4
local req='"method":"Chain33.SendToAddress", "params":[{"from":"'"$from"'","to":"'"$to"'", "amount":'"$amount"', "note":"test\n"}]'
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
ok=$(jq '(.error|not) and (.result.hash|length==66)' <<<"$resp")
[ "$ok" == true ]
hash=$(jq -r ".result.hash" <<<"$resp")
chain33_QueryTx "$hash" "$MAIN_HTTP"
}
chain33_ImportPrivkey() {
local pri="$1"
local acc="$2"
local label="$3"
local MAIN_HTTP=$4
local req='"method":"Chain33.ImportPrivkey", "params":[{"privkey":"'"$pri"'", "label":"'"$label"'"}]'
resp=$(curl -ksd "{$req}" "$MAIN_HTTP")
ok=$(jq '(.error|not) and (.result.label=="'"$label"'") and (.result.acc.addr == "'"$acc"'")' <<<"$resp")
[ "$ok" == true ]
}
chain33_SignRawTx() {
local txHex="$1"
local priKey="$2"
local MAIN_HTTP=$3
local req='"method":"Chain33.SignRawTx","params":[{"privkey":"'"$priKey"'","txHex":"'"$txHex"'","expire":"120s"}]'
signedTx=$(curl -ksd "{$req}" "${MAIN_HTTP}" | jq -r ".result")
if [ "$signedTx" != null ]; then
chain33_SendTx "$signedTx" "${MAIN_HTTP}"
else
echo "signedTx null error"
fi
}
......@@ -2,11 +2,13 @@
# shellcheck disable=SC2128
RPC_TESTFILE=test-rpc.sh
DAPP_TEST_COMMON=dapp-test-common.sh
function dapp_test_rpc() {
local ip=$1
echo "============ # dapp rpc test begin ============="
if [ -d dapptest ]; then
cp $DAPP_TEST_COMMON dapptest/
cd dapptest || return
dir=$(find . -maxdepth 1 -type d ! -name dapptest ! -name . | sed 's/^\.\///')
for app in $dir; do
......
......@@ -78,6 +78,9 @@ function base_init() {
sed -i $sedfix 's/^Title.*/Title="local"/g' chain33.toml
sed -i $sedfix 's/^TestNet=.*/TestNet=true/g' chain33.toml
sed -i $sedfix 's/^powLimitBits=.*/powLimitBits="0x1f2fffff"/g' chain33.toml
sed -i $sedfix 's/^targetTimePerBlock=.*/targetTimePerBlock=1/g' chain33.toml
# p2p
sed -i $sedfix 's/^seeds=.*/seeds=["chain33:13802","chain32:13802","chain31:13802"]/g' chain33.toml
#sed -i $sedfix 's/^enable=.*/enable=true/g' chain33.toml
......@@ -96,6 +99,9 @@ function base_init() {
sed -i $sedfix 's/^nodeGroupFrozenCoins=.*/nodeGroupFrozenCoins=20/g' chain33.toml
# ticket
sed -i $sedfix 's/^ticketPrice =.*/ticketPrice = 10000/g' chain33.toml
}
function start() {
......@@ -140,7 +146,7 @@ function start() {
${CLI} block hash -t 0
res=$(${CLI} block hash -t 0 | jq -r ".hash")
#in case changes result in genesis change
if [ "${res}" != "0xa87972dfc3510cb934cb987bcb88036f7a1ffd7dc069cb9a5f0af179895fd2e8" ]; then
if [ "${res}" != "0x67c58d6ba9175313f0468ae4e0ddec946549af7748037c2fdd5d54298afd20b6" ]; then
echo "genesis hash error!"
exit 1
fi
......@@ -200,6 +206,7 @@ function miner() {
fi
sleep 1
echo "=========== # close auto mining ============="
result=$(${1} wallet auto_mine -f 0 | jq ".isok")
if [ "${result}" = "false" ]; then
......@@ -328,6 +335,30 @@ function transfer() {
block_wait "${1}" 1
}
function dapp_test_address() {
echo "=========== # import private key dapptest1 mining ============="
result=$(${1} account import_key -k 56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138 -l dapptest1 | jq ".label")
echo "${result}"
if [ -z "${result}" ]; then
exit 1
fi
sleep 1
echo "=========== # import private key dapptest2 mining ============="
result=$(${1} account import_key -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989 -l dapptest2 | jq ".label")
echo "${result}"
if [ -z "${result}" ]; then
exit 1
fi
sleep 1
hash=$(${1} send coins transfer -a 1500 -n transfer -t 1PUiGcbsccfxW3zuvHXZBJfznziph5miAo -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989)
echo "${hash}"
block_wait "${1}" 1
}
function base_config() {
# sync
transfer "${CLI}"
......@@ -337,10 +368,12 @@ function base_config() {
function rpc_test() {
if [ "$DAPP" == "" ]; then
system_test_rpc "http://${1}:8801"
dapp_test_address "${CLI}"
dapp_test_rpc "http://${1}:8801"
fi
if [ "$DAPP" == "paracross" ]; then
#system_test_rpc "http://${1}:8901"
system_test_rpc "http://${1}:8901"
dapp_test_address "${CLI}"
dapp_test_rpc "http://${1}:8901"
fi
......@@ -370,7 +403,7 @@ function main() {
dapp_run test "${ip}"
### rpc test ###
rpc_test "${ip}"
# rpc_test "${ip}"
### finish ###
check_docker_container
......
......@@ -92,7 +92,7 @@ fundKeyAddr = "1BQXS6TxaYYG5mADaWij4AxhZZUTpw95a5"
coinReward = 18
coinDevFund = 12
ticketPrice = 10000
powLimitBits = "0x1f00ffff"
powLimitBits="0x1f00ffff"
retargetAdjustmentFactor = 4
futureBlockTime = 16
ticketFrozenTime = 5 #5s only for test
......@@ -100,7 +100,7 @@ ticketWithdrawTime = 10 #10s only for test
ticketMinerWaitTime = 2 #2s only for test
maxTxNumber = 1600 #160
targetTimespan = 2304
targetTimePerBlock = 16
targetTimePerBlock=16
[mver.consensus.ForkChainParamV1]
futureBlockTime = 15
......
......@@ -438,7 +438,7 @@ func (client *commitMsgClient) getNodeStatus(start, end int64) ([]*pt.ParacrossN
//2,如果20个块都是 commit tx的空块,20个块打包一次发送,尽量减少commit tx造成的空块
//3,如果形如xxoxx的块排列,x代表commit空块,o代表实际的块,即只要不全部是commit块,也要全部打包一起发出去
//如果=0 意味着全部是paracross commit tx,延迟发送
if needSentTxs == 0 && count < types.TxGroupMaxCount {
if needSentTxs == 0 && len(ret) < types.TxGroupMaxCount {
plog.Debug("para commitmsg getNodeStatus all self consensus commit tx,send delay", "start", start, "end", end)
return nil, nil
}
......
......@@ -244,7 +244,7 @@ function run_testcases() {
blackwhite_BlackwhiteTimeoutDoneTx "$gID"
#查询部分
block_wait 1
block_wait 3
blackwhite_GetBlackwhiteRoundInfo "$gID"
blackwhite_GetBlackwhiteByStatusAndAddr "$gID" "${gameAddr1}"
blackwhite_GetBlackwhiteloopResult "$gID"
......
......@@ -23,48 +23,34 @@ echo_rst() {
lottery_addCreator_unsignedTx="0a066d616e616765123c0a3a0a0f6c6f74746572792d63726561746f721222313271796f6361794e46374c7636433971573461767873324537553431664b5366761a0361646420a08d0630c788b8f7ccbadbc0703a223151344e687572654a784b4e4266373164323642394a336642516f5163666d657a32"
lottery_addCreator_unsignedTx_para="0a12757365722e702e706172612e6d616e616765123c0a3a0a0f6c6f74746572792d63726561746f721222313271796f6361794e46374c7636433971573461767873324537553431664b5366761a0361646420a08d0630a8bba1b887e7dade2b3a22314469484633317577783977356a6a733571514269474a6b4e686e71656564763157"
lottery_creator_addr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
lottery_creator_priv="0x4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
gID=""
gResp=""
glAddr=""
gameAddr1=""
gameAddr2=""
gameAddr3=""
lottExecAddr=""
luckyNumber=""
purNum=30
drawNum=40
opRatio=5
devRatio=5
luckyNumber=""
init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
echo "ispara=$ispara"
if [[ $ispara == true ]]; then
lottExecAddr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.lottery"}]}' ${MAIN_HTTP} | jq -r ".result")
chain33_SendTransaction "${lottery_addCreator_unsignedTx_para}" "${lottery_creator_addr}"
chain33_SendTransaction "${lottery_addCreator_unsignedTx_para}" "${lottery_creator_priv}"
else
lottExecAddr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"lottery"}]}' ${MAIN_HTTP} | jq -r ".result")
chain33_SendTransaction "${lottery_addCreator_unsignedTx}" "${lottery_creator_addr}"
chain33_SendTransaction "${lottery_addCreator_unsignedTx}" "${lottery_creator_priv}"
fi
echo "lottExecAddr=$lottExecAddr"
}
chain33_NewAccount() {
label=$1
result=$(curl -ksd '{"method":"Chain33.NewAccount","params":[{"label":"'"$label"'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.acc.addr")
[[ $result != "" ]]
rst=$?
echo_rst "$FUNCNAME" "$rst"
glAddr=$result
echo "$glAddr"
}
function block_wait() {
if [[ $# -lt 1 ]]; then
echo "wrong block_wait params"
......@@ -142,10 +128,12 @@ chain33_SendToAddress() {
chain33_SendTransaction() {
rawTx=$1
addr=$2
priv=$2
#签名交易
resp=$(curl -ksd '{"method":"Chain33.SignRawTx","params":[{"addr":"'"$addr"'","txHex":"'"$rawTx"'","expire":"120s","fee":10000000,"index":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
set -x
resp=$(curl -ksd '{"method":"Chain33.SignRawTx","params":[{"privkey":"'"$priv"'","txHex":"'"$rawTx"'","expire":"120s","fee":10000000,"index":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
ok=$(echo "${resp}" | jq -r ".error")
set +x
[[ $ok == null ]]
rst=$?
echo_rst "chain33_SignRawTx" "$rst"
......@@ -166,7 +154,7 @@ chain33_SendTransaction() {
lottery_LotteryCreate() {
#创建交易
addr=$1
priv=$1
set -x
resp=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"lottery","actionName":"LotteryCreate",
"payload":{"purBlockNum":'"$purNum"',"drawBlockNum":'"$drawNum"', "opRewardRatio":'"$opRatio"',"devRewardRatio":'"$devRatio"',"fee":1000000}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
......@@ -177,14 +165,14 @@ lottery_LotteryCreate() {
echo_rst "$FUNCNAME" "$rst"
#发送交易
rawTx=$(echo "${resp}" | jq -r ".result")
chain33_SendTransaction "${rawTx}" "${addr}"
chain33_SendTransaction "${rawTx}" "${priv}"
gID="${gResp}"
echo "gameID $gID"
}
lottery_LotteryBuy() {
#创建交易
addr=$1
priv=$1
amount=$2
number=$3
way=$4
......@@ -198,12 +186,12 @@ lottery_LotteryBuy() {
echo_rst "$FUNCNAME" "$rst"
#发送交易
rawTx=$(echo "${resp}" | jq -r ".result")
chain33_SendTransaction "${rawTx}" "${addr}"
chain33_SendTransaction "${rawTx}" "${priv}"
}
lottery_LotteryDraw() {
#创建交易
addr=$1
priv=$1
set -x
resp=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"lottery","actionName":"LotteryDraw",
"payload":{"lotteryId":"'"$gID"'","fee":1000000}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
......@@ -214,12 +202,12 @@ lottery_LotteryDraw() {
echo_rst "$FUNCNAME" "$rst"
#发送交易
rawTx=$(echo "${resp}" | jq -r ".result")
chain33_SendTransaction "${rawTx}" "${addr}"
chain33_SendTransaction "${rawTx}" "${priv}"
}
lottery_LotteryClose() {
#创建交易
addr=$1
priv=$1
set -x
resp=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"lottery","actionName":"LotteryClose",
"payload":{"lotteryId":"'"$gID"'","fee":1000000}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
......@@ -230,7 +218,7 @@ lottery_LotteryClose() {
echo_rst "$FUNCNAME" "$rst"
#发送交易
rawTx=$(echo "${resp}" | jq -r ".result")
chain33_SendTransaction "${rawTx}" "${addr}"
chain33_SendTransaction "${rawTx}" "${priv}"
}
lottery_GetLotteryNormalInfo() {
......@@ -377,27 +365,20 @@ lottery_GetLotteryRoundGainInfo() {
}
function run_testcases() {
#先创建账户地址
chain33_NewAccount "lottery111"
gameAddr1="${glAddr}"
chain33_NewAccount "lottery222"
gameAddr2="${glAddr}"
chain33_NewAccount "lottery333"
gameAddr3="${glAddr}"
#给每个账户分别转帐
origAddr="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
#账户地址
gameAddr1="1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
gamePriv1="0x56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138"
gameAddr2="1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX"
gamePriv2="0x2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989"
#该账户需要转账
gameAddr3="12HKLEn6g4FH39yUbHh4EVJWcFo5CXg22d"
gamePriv3="0x9d4f8ab11361be596468b265cb66946c87873d4a119713fd0c3d8302eae0a8e4"
#主链中相应账户需要转帐
M_HTTP=${MAIN_HTTP//8901/8801}
chain33_SendToAddress "${origAddr}" "${gameAddr1}" 300000000 "${M_HTTP}"
chain33_SendToAddress "${origAddr}" "${gameAddr2}" 300000000 "${M_HTTP}"
chain33_SendToAddress "${origAddr}" "${gameAddr3}" 300000000 "${M_HTTP}"
chain33_SendToAddress "${gameAddr1}" "${gameAddr3}" 300000000 "${M_HTTP}"
#平行链相应账户需要转帐
chain33_SendToAddress "${origAddr}" "${gameAddr1}" 300000000 "${MAIN_HTTP}"
chain33_SendToAddress "${origAddr}" "${gameAddr2}" 300000000 "${MAIN_HTTP}"
chain33_SendToAddress "${origAddr}" "${gameAddr3}" 300000000 "${MAIN_HTTP}"
chain33_SendToAddress "${gameAddr1}" "${gameAddr3}" 300000000 "${MAIN_HTTP}"
#给游戏合约中转帐
chain33_SendToAddress "${gameAddr1}" "${lottExecAddr}" 200000000 "${MAIN_HTTP}"
......@@ -405,14 +386,14 @@ function run_testcases() {
chain33_SendToAddress "${gameAddr3}" "${lottExecAddr}" 200000000 "${MAIN_HTTP}"
#创建游戏
lottery_LotteryCreate "${lottery_creator_addr}"
lottery_LotteryCreate "${lottery_creator_priv}"
lottery_GetLotteryNormalInfo "$gID" "${lottery_creator_addr}"
lottery_GetLotteryCurrentInfo "$gID" 1 0
#第一次投注
lottery_LotteryBuy "${gameAddr1}" 1 12345 1
lottery_LotteryBuy "${gameAddr2}" 1 66666 2
lottery_LotteryBuy "${gameAddr3}" 1 56789 5
lottery_LotteryBuy "${gamePriv1}" 1 12345 1
lottery_LotteryBuy "${gamePriv2}" 1 66666 2
lottery_LotteryBuy "${gamePriv3}" 1 56789 5
#查询
lottery_GetLotteryCurrentInfo "$gID" 2 3
lottery_GetLotteryPurchaseAddr "$gID" 3
......@@ -420,8 +401,8 @@ function run_testcases() {
lottery_GetLotteryBuyRoundInfo "$gID" "${gameAddr2}" 1 1 "66666"
#第二次投注
lottery_LotteryBuy "${gameAddr1}" 1 12321 1
lottery_LotteryBuy "${gameAddr3}" 1 78987 5
lottery_LotteryBuy "${gamePriv1}" 1 12321 1
lottery_LotteryBuy "${gamePriv3}" 1 78987 5
#查询
lottery_GetLotteryCurrentInfo "$gID" 2 5
lottery_GetLotteryPurchaseAddr "$gID" 3
......@@ -430,7 +411,7 @@ function run_testcases() {
#游戏开奖
block_wait ${drawNum} "${M_HTTP}"
lottery_LotteryDraw "${lottery_creator_addr}"
lottery_LotteryDraw "${lottery_creator_priv}"
lottery_GetLotteryCurrentInfo "$gID" 3 0
#游戏查询
......@@ -442,7 +423,7 @@ function run_testcases() {
lottery_GetLotteryRoundGainInfo "$gID" "${gameAddr3}" 1 2
#关闭游戏
lottery_LotteryClose "${lottery_creator_addr}"
lottery_LotteryClose "${lottery_creator_priv}"
lottery_GetLotteryCurrentInfo "$gID" 4 0
}
......
......@@ -108,6 +108,8 @@ searchHashMatchedBlockDepth=10000
genesisAmount=100000000
#主链支持平行链共识tx分叉高度,需要和主链保持严格一致
MainForkParacrossCommitTx=-1
#平行链自共识开启对应的主链高度,需要大于等于MainForkParacrossCommitTx
MainParaSelfConsensusForkHeight=-1
[store]
name="mavl"
......@@ -154,7 +156,7 @@ tokenApprs = [
]
[exec.sub.paracross]
#平行链自共识停止n个后,超级账户可以直接参与投票
#平行链自共识停止n个空块的对应主链高度后,超级账户可以直接参与投票
paraConsensusStopBlocks=100
[pprof]
......
......@@ -38,7 +38,7 @@ function para_set_toml() {
sed -i $xsedfix 's/^emptyBlockInterval=.*/emptyBlockInterval=4/g' "${1}"
sed -i $xsedfix '/^emptyBlockInterval=.*/a MainBlockHashForkHeight=1' "${1}"
sed -i $xsedfix '/^emptyBlockInterval=.*/a MainParaSelfConsensusForkHeight=50' "${1}"
sed -i $xsedfix 's/^MainParaSelfConsensusForkHeight=.*/MainParaSelfConsensusForkHeight=50/g' "${1}"
sed -i $xsedfix 's/^MainForkParacrossCommitTx=.*/MainForkParacrossCommitTx=1/g' "${1}"
# rpc
......@@ -61,6 +61,10 @@ function para_set_wallet() {
para_import_key "${PARA_CLI}" "0x4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01" "test"
#1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
para_import_key "${PARA_CLI}" "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588" "relay"
#1PUiGcbsccfxW3zuvHXZBJfznziph5miAo
para_import_key "${PARA_CLI}" "0x56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" "dapptest1"
#1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
para_import_key "${PARA_CLI}" "0x2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989" "dapptest2"
#super node behalf test
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
......@@ -117,6 +121,8 @@ function para_transfer() {
#relay rpc test
para_transfer2account "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
para_transfer2account "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
para_transfer2account "1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
para_transfer2account "1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX"
block_wait "${CLI}" 2
echo "=========== # main chain send to paracross ============="
......@@ -597,6 +603,7 @@ function para_nodegroup_behalf_quit_test() {
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588
hash=$(${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115)
echo "${hash}"
query_tx "${PARA_CLI}" "${hash}"
......@@ -663,6 +670,7 @@ function para_nodemanage_test() {
echo "=========== # para chain node vote quit ============="
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588
hash=$(${PARA_CLI} send para node -o vote -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -v yes -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115)
echo "${hash}"
query_tx "${PARA_CLI}" "${hash}"
......@@ -718,6 +726,7 @@ function para_nodemanage_test() {
echo "=========== # para chain node vote quit ============="
${PARA_CLI} send para node -o vote -a 1NNaYHkscJaLJ2wUrFNeh6cQXBS4TrFYeB -v yes -k 0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${PARA_CLI} send para node -o vote -a 1NNaYHkscJaLJ2wUrFNeh6cQXBS4TrFYeB -v yes -k 0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
${PARA_CLI} send para node -o vote -a 1NNaYHkscJaLJ2wUrFNeh6cQXBS4TrFYeB -v yes -k 0x794443611e7369a57b078881445b93b754cbc9b9b8f526535ab9c6d21d29203d
hash=$(${PARA_CLI} send para node -o vote -a 1NNaYHkscJaLJ2wUrFNeh6cQXBS4TrFYeB -v yes -k 0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115)
echo "${hash}"
query_tx "${PARA_CLI}" "${hash}"
......
......@@ -332,7 +332,7 @@ func nodeGroupApply(cmd *cobra.Command, args []string) {
payload := &pt.ParaNodeGroupConfig{Op: op, Addrs: addrs, CoinsFrozen: int64(math.Trunc((coins+0.0000001)*1e4)) * 1e4}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pt.ParaX),
ActionName: "NodeGroupApply",
ActionName: "NodeGroupConfig",
Payload: types.MustPBToJSON(payload),
}
......@@ -446,7 +446,7 @@ func paraInfo(cmd *cobra.Command, args []string) {
Title: title,
Height: height,
}
var res pt.RespParacrossDone
var res pt.ParacrossHeightStatusRsp
ctx := jsonclient.NewRPCCtx(rpcLaddr, "paracross.GetTitleHeight", params, &res)
ctx.Run()
}
......
......@@ -225,13 +225,9 @@ func hasCommited(addrs []string, addr string) (bool, int) {
}
func getDappForkHeight(fork string) int64 {
paraConfigFork := ""
if fork == pt.ForkCommitTx {
paraConfigFork = "MainForkParacrossCommitTx"
}
var forkHeight int64
if types.IsPara() {
forkHeight = types.Conf("config.consensus.sub.para").GInt(paraConfigFork)
forkHeight = types.Conf("config.consensus.sub.para").GInt("MainForkParacrossCommitTx")
if forkHeight <= 0 {
forkHeight = types.MaxHeight
}
......@@ -348,6 +344,7 @@ func (a *action) Commit(commit *pt.ParacrossCommitAction) (*types.Receipt, error
}
if a.exec.GetMainHeight() >= getDappForkHeight(pt.ForkCommitTx) {
stat.MainHeight = commit.Status.MainBlockHeight
stat.MainHash = commit.Status.MainBlockHash
}
receipt = makeCommitReceipt(a.fromaddr, commit, nil, stat)
} else {
......@@ -388,8 +385,7 @@ func (a *action) Commit(commit *pt.ParacrossCommitAction) (*types.Receipt, error
}
//add commit done receipt
receiptDone := makeDoneReceipt(a.fromaddr, commit, stat, int32(most), int32(commitCount), int32(len(nodes)))
receipt.KV = append(receipt.KV, receiptDone.KV...)
receipt.Logs = append(receipt.Logs, receiptDone.Logs...)
receipt = mergeReceipt(receipt, receiptDone)
//平行连进行奖励分配,考虑可能的失败,需要在保存共识高度等数据之前处理
if types.IsPara() {
......
......@@ -8,6 +8,7 @@ import (
"encoding/hex"
"fmt"
"github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/types"
pt "github.com/33cn/plugin/plugin/dapp/paracross/types"
......@@ -22,6 +23,31 @@ func (p *Paracross) Query_GetTitle(in *types.ReqString) (types.Message, error) {
return p.paracrossGetHeight(in.GetData())
}
// Query_GetTitleHeight query paracross status with title and height
func (p *Paracross) Query_GetTitleHeight(in *pt.ReqParacrossTitleHeight) (types.Message, error) {
if in == nil {
return nil, types.ErrInvalidParam
}
stat, err := p.paracrossGetStateTitleHeight(in.Title, in.Height)
if err != nil {
clog.Error("paracross.GetTitleHeight", "title", title, "height", in.Height, "err", err.Error())
return nil, err
}
status := stat.(*pt.ParacrossHeightStatus)
res := &pt.ParacrossHeightStatusRsp{
Status: status.Status,
Title: status.Title,
Height: status.Height,
MainHeight: status.MainHeight,
MainHash: common.ToHex(status.MainHash),
}
for i, addr := range status.Details.Addrs {
res.CommitAddrs = append(res.CommitAddrs, addr)
res.CommitBlockHash = append(res.CommitBlockHash, common.ToHex(status.Details.BlockHash[i]))
}
return res, nil
}
// Query_GetTitleByHash query paracross title by block hash
func (p *Paracross) Query_GetTitleByHash(in *pt.ReqParacrossTitleHash) (types.Message, error) {
if in == nil {
......@@ -99,8 +125,8 @@ func (p *Paracross) Query_ListTitles(in *types.ReqNil) (types.Message, error) {
return p.paracrossListTitles()
}
// Query_GetTitleHeight query title height
func (p *Paracross) Query_GetTitleHeight(in *pt.ReqParacrossTitleHeight) (types.Message, error) {
// Query_GetDoneTitleHeight query title height
func (p *Paracross) Query_GetDoneTitleHeight(in *pt.ReqParacrossTitleHeight) (types.Message, error) {
if in == nil {
return nil, types.ErrInvalidParam
}
......
......@@ -163,6 +163,18 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return nil, errors.Wrapf(pt.ErrParaNodeAddrExisted, "nodeAddr existed:%s", config.Addr)
}
nodeGroupStatus, err := getNodeGroupStatus(a.db, config.Title)
if err != nil {
return nil, errors.Wrapf(pt.ErrParaNodeGroupNotSet, "nodegroup not exist:%s", config.Title)
}
if config.CoinsFrozen < nodeGroupStatus.CoinsFrozen {
clog.Error("nodeJoin coinfrozen not enough", "title", config.Title, "addr", config.Addr,
"config", config.CoinsFrozen, "nodegroupConfig", nodeGroupStatus.CoinsFrozen)
return nil, errors.Wrapf(pt.ErrParaNodeGroupFrozenCoinsNotEnough,
"coinFrozen not enough:%d,expected:%d", config.CoinsFrozen, nodeGroupStatus.CoinsFrozen)
}
receipt := &types.Receipt{Ty: types.ExecOk}
if !types.IsPara() {
r, err := a.nodeGroupCoinsFrozen(a.fromaddr, config.CoinsFrozen, 1)
......@@ -223,9 +235,16 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return nil, err
}
//代替别人退出或者自己退出都允许,但代替别人退出时候创建账户也必须匹配
if a.fromaddr != stat.FromAddr && a.fromaddr != config.Addr {
clog.Error("nodeaccount.nodeQuit wrong addr", "createAddr", stat.FromAddr, "confAddr", config.Addr, "fromAddr", a.fromaddr)
return nil, types.ErrNotAllow
}
if stat.Status == pt.ParacrossNodeQuiting || stat.Status == pt.ParacrossNodeQuited {
clog.Error("nodeaccount.nodeQuit wrong status", "status", stat)
return nil, errors.Wrapf(pt.ErrParaUnSupportNodeOper, "nodeAddr %s was quit status:%d", a.fromaddr, stat.Status)
return nil, errors.Wrapf(pt.ErrParaUnSupportNodeOper, "nodeAddr %s was quit status:%d", config.Addr, stat.Status)
}
if stat.Status == pt.ParacrossNodeAdded {
......@@ -233,12 +252,12 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
if err != nil {
return nil, errors.Wrapf(err, "getNodes for title:%s", config.Title)
}
if !validNode(a.fromaddr, nodes) {
return nil, errors.Wrapf(pt.ErrParaNodeAddrNotExisted, "nodeAddr not existed:%s", a.fromaddr)
if !validNode(config.Addr, nodes) {
return nil, errors.Wrapf(pt.ErrParaNodeAddrNotExisted, "nodeAddr not existed:%s", config.Addr)
}
//不允许最后一个账户退出
if len(nodes) == 1 {
return nil, errors.Wrapf(pt.ErrParaNodeGroupLastAddr, "nodeAddr last one:%s", a.fromaddr)
return nil, errors.Wrapf(pt.ErrParaNodeGroupLastAddr, "nodeAddr last one:%s", config.Addr)
}
}
......@@ -354,21 +373,6 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return nil, errors.Wrapf(pt.ErrNodeNotForTheTitle, "not validNode:%s", a.fromaddr)
}
if a.fromaddr == config.Addr {
return nil, errors.Wrapf(pt.ErrParaNodeVoteSelf, "not allow to vote self:%s", a.fromaddr)
}
// 如果投票账户是group账户,需计算此账户之外的投票
if validNode(config.Addr, nodes) {
temp := make(map[string]struct{})
for k := range nodes {
if k != config.Addr {
temp[k] = struct{}{}
}
}
nodes = temp
}
stat, err := getNodeAddr(a.db, config.Title, config.Addr)
if err != nil {
return nil, err
......@@ -422,6 +426,14 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return nil, err
}
stat.Status = pt.ParacrossNodeQuited
if !types.IsPara() {
r, err := a.nodeGroupCoinsActive(stat.FromAddr, stat.CoinsFrozen, 1)
if err != nil {
return nil, err
}
receiptGroup.KV = append(receiptGroup.KV, r.KV...)
receiptGroup.Logs = append(receiptGroup.Logs, r.Logs...)
}
}
} else {
if stat.Status == pt.ParacrossNodeAdding {
......@@ -512,6 +524,10 @@ func (a *action) checkConfig(title string) error {
}
func getAddrGroup(addr string) []string {
addr = strings.Trim(addr, " ")
if addr == "" {
return nil
}
if strings.Contains(addr, ",") {
repeats := make(map[string]bool)
var addrs []string
......@@ -521,7 +537,7 @@ func getAddrGroup(addr string) []string {
ss := strings.Split(s, ",")
for _, v := range ss {
v = strings.Trim(v, " ")
if !repeats[v] {
if v != "" && !repeats[v] {
addrs = append(addrs, v)
repeats[v] = true
}
......@@ -562,7 +578,7 @@ func (a *action) nodeGroupCoinsFrozen(createAddr string, configCoinsFrozen int64
r, err := a.coinsAccount.ExecFrozen(createAddr, realExecAddr, nodeCounts*configCoinsFrozen)
if err != nil {
clog.Error("node group apply", "addr", createAddr, "realExec", realExec, "realAddr", realExecAddr, "amount", configCoinsFrozen)
clog.Error("node group apply", "addr", createAddr, "realExec", realExec, "realAddr", realExecAddr, "amount", nodeCounts*configCoinsFrozen)
return nil, err
}
......@@ -607,6 +623,11 @@ func (a *action) nodeGroupApply(config *pt.ParaNodeGroupConfig) (*types.Receipt,
}
addrs := getAddrGroup(config.Addrs)
if len(addrs) == 0 {
clog.Error("node group apply addrs null", "addrs", config.Addrs)
return nil, types.ErrInvalidParam
}
receipt := &types.Receipt{Ty: types.ExecOk}
//main chain
if !types.IsPara() {
......@@ -639,7 +660,7 @@ func (a *action) nodeGroupQuit(config *pt.ParaNodeGroupConfig) (*types.Receipt,
if err != nil {
return nil, err
}
if status != nil && status.Status != pt.ParacrossNodeGroupApply {
if status.Status != pt.ParacrossNodeGroupApply {
clog.Error("node group apply exist", "status", status.Status)
return nil, pt.ErrParaNodeGroupStatusWrong
}
......@@ -727,6 +748,10 @@ func (a *action) nodeGroupApprove(config *pt.ParaNodeGroupConfig) (*types.Receip
return nil, pt.ErrParaNodeGroupStatusWrong
}
if status.CoinsFrozen < config.CoinsFrozen {
clog.Error("node group approve not apply status", "status", status.Status)
return nil, pt.ErrParaNodeGroupFrozenCoinsNotEnough
}
applyAddrs, err := checkNodeGroupAddrsMatch(status.ApplyAddr, config.Addrs)
if err != nil {
return nil, err
......@@ -796,7 +821,8 @@ func (a *action) NodeGroupConfig(config *pt.ParaNodeGroupConfig) (*types.Receipt
return nil, pt.ErrInvalidTitle
}
if len(config.Addrs) == 0 {
s := strings.Trim(config.Addrs, " ")
if len(s) == 0 {
return nil, types.ErrInvalidParam
}
......@@ -832,9 +858,6 @@ func (a *action) NodeConfig(config *pt.ParaNodeAddrConfig) (*types.Receipt, erro
return a.nodeJoin(config)
} else if config.Op == pt.ParaNodeQuit {
if config.Addr != a.fromaddr {
return nil, types.ErrFromAddr
}
return a.nodeQuit(config)
} else if config.Op == pt.ParaNodeVote {
......
......@@ -306,3 +306,27 @@ func TestNodeManageSuite(t *testing.T) {
func (suite *NodeManageTestSuite) TearDownSuite() {
}
func TestGetAddrGroup(t *testing.T) {
addrs := " 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4, 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR, 1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k, ,,, 1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs , "
retAddrs := getAddrGroup(addrs)
expectAddrs := []string{"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4", "1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR", "1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k", "1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"}
assert.Equal(t, expectAddrs, retAddrs)
addrs = " 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 , , "
retAddrs = getAddrGroup(addrs)
expectAddrs = []string{"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"}
assert.Equal(t, expectAddrs, retAddrs)
addrs = " , "
ret := getAddrGroup(addrs)
assert.Equal(t, []string(nil), ret)
assert.Equal(t, 0, len(ret))
addrs = " "
ret = getAddrGroup(addrs)
assert.Equal(t, []string(nil), ret)
assert.Equal(t, 0, len(ret))
}
......@@ -20,6 +20,18 @@ message ParacrossHeightStatus {
int64 height = 3;
ParacrossStatusDetails details = 4;
int64 mainHeight = 5;
bytes mainHash = 6;
}
message ParacrossHeightStatusRsp {
int32 status = 1;
string title = 2;
int64 height = 3;
int64 mainHeight = 4;
string mainHash = 5;
repeated string commitAddrs = 6;
repeated string commitBlockHash = 7;
}
message ParacrossStatus {
......@@ -263,7 +275,8 @@ message ParacrossAsset {
service paracross {
rpc GetTitle(ReqString) returns (ParacrossConsensusStatus) {}
rpc ListTitles(ReqNil) returns (RespParacrossTitles) {}
rpc GetTitleHeight(ReqParacrossTitleHeight) returns (RespParacrossDone) {}
rpc GetDoneTitleHeight(ReqParacrossTitleHeight) returns (RespParacrossDone) {}
rpc GetTitleHeight(ReqParacrossTitleHeight) returns (ParacrossHeightStatusRsp) {}
rpc GetAssetTxResult(ReqHash) returns (ParacrossAsset) {}
rpc IsSync(ReqNil) returns (IsCaughtUp) {}
}
\ No newline at end of file
......@@ -72,12 +72,12 @@ func (c *Jrpc) ListTitles(req *types.ReqNil, result *interface{}) error {
return err
}
func (c *channelClient) GetTitleHeight(ctx context.Context, req *pt.ReqParacrossTitleHeight) (*pt.RespParacrossDone, error) {
func (c *channelClient) GetTitleHeight(ctx context.Context, req *pt.ReqParacrossTitleHeight) (*pt.ParacrossHeightStatusRsp, error) {
data, err := c.Query(pt.GetExecName(), "GetTitleHeight", req)
if err != nil {
return nil, err
}
if resp, ok := data.(*pt.RespParacrossDone); ok {
if resp, ok := data.(*pt.ParacrossHeightStatusRsp); ok {
return resp, nil
}
return nil, types.ErrDecode
......@@ -93,6 +93,17 @@ func (c *Jrpc) GetTitleHeight(req *pt.ReqParacrossTitleHeight, result *interface
return err
}
func (c *channelClient) GetDoneTitleHeight(ctx context.Context, req *pt.ReqParacrossTitleHeight) (*pt.RespParacrossDone, error) {
data, err := c.Query(pt.GetExecName(), "GetDoneTitleHeight", req)
if err != nil {
return nil, err
}
if resp, ok := data.(*pt.RespParacrossDone); ok {
return resp, nil
}
return nil, types.ErrDecode
}
func (c *channelClient) GetAssetTxResult(ctx context.Context, req *types.ReqHash) (*pt.ParacrossAsset, error) {
data, err := c.Query(pt.GetExecName(), "GetAssetTxResult", req)
if err != nil {
......
......@@ -77,17 +77,27 @@ func TestChannelClient_GetTitleHeight(t *testing.T) {
client := newGrpc(api)
client.Init("paracross", nil, nil, nil)
req := &pt.ReqParacrossTitleHeight{}
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.ParacrossHeightStatusRsp{}, nil)
_, err := client.GetTitleHeight(context.Background(), req)
assert.Nil(t, err)
}
func TestChannelClient_GetTitleDoneHeight(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newGrpc(api)
client.Init("paracross", nil, nil, nil)
req := &pt.ReqParacrossTitleHeight{}
api.On("Query", pt.GetExecName(), "GetDoneTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
_, err := client.GetDoneTitleHeight(context.Background(), req)
assert.Nil(t, err)
}
func TestJrpc_GetTitleHeight(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
j := newJrpc(api)
req := &pt.ReqParacrossTitleHeight{}
var result interface{}
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.RespParacrossDone{}, nil)
api.On("Query", pt.GetExecName(), "GetTitleHeight", req).Return(&pt.ParacrossHeightStatusRsp{}, nil)
err := j.GetTitleHeight(req, &result)
assert.Nil(t, err)
}
......
......@@ -7,6 +7,7 @@ package types
import (
"encoding/json"
"fmt"
"strings"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/log/log15"
......@@ -177,6 +178,7 @@ func createRawCommitTx(status *ParacrossNodeStatus, name string, fee int64) (*ty
// CreateRawNodeConfigTx create raw tx for node config
func CreateRawNodeConfigTx(config *ParaNodeAddrConfig) (*types.Transaction, error) {
config.Title = types.GetTitle()
config.Addr = strings.Trim(config.Addr, " ")
action := &ParacrossAction{
Ty: ParacrossActionNodeConfig,
......
......@@ -79,6 +79,7 @@ type ParacrossHeightStatus struct {
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
Details *ParacrossStatusDetails `protobuf:"bytes,4,opt,name=details,proto3" json:"details,omitempty"`
MainHeight int64 `protobuf:"varint,5,opt,name=mainHeight,proto3" json:"mainHeight,omitempty"`
MainHash []byte `protobuf:"bytes,6,opt,name=mainHash,proto3" json:"mainHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
......@@ -144,6 +145,100 @@ func (m *ParacrossHeightStatus) GetMainHeight() int64 {
return 0
}
func (m *ParacrossHeightStatus) GetMainHash() []byte {
if m != nil {
return m.MainHash
}
return nil
}
type ParacrossHeightStatusRsp struct {
Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
MainHeight int64 `protobuf:"varint,4,opt,name=mainHeight,proto3" json:"mainHeight,omitempty"`
MainHash string `protobuf:"bytes,5,opt,name=mainHash,proto3" json:"mainHash,omitempty"`
CommitAddrs []string `protobuf:"bytes,6,rep,name=commitAddrs,proto3" json:"commitAddrs,omitempty"`
CommitBlockHash []string `protobuf:"bytes,7,rep,name=commitBlockHash,proto3" json:"commitBlockHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ParacrossHeightStatusRsp) Reset() { *m = ParacrossHeightStatusRsp{} }
func (m *ParacrossHeightStatusRsp) String() string { return proto.CompactTextString(m) }
func (*ParacrossHeightStatusRsp) ProtoMessage() {}
func (*ParacrossHeightStatusRsp) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{2}
}
func (m *ParacrossHeightStatusRsp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ParacrossHeightStatusRsp.Unmarshal(m, b)
}
func (m *ParacrossHeightStatusRsp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ParacrossHeightStatusRsp.Marshal(b, m, deterministic)
}
func (m *ParacrossHeightStatusRsp) XXX_Merge(src proto.Message) {
xxx_messageInfo_ParacrossHeightStatusRsp.Merge(m, src)
}
func (m *ParacrossHeightStatusRsp) XXX_Size() int {
return xxx_messageInfo_ParacrossHeightStatusRsp.Size(m)
}
func (m *ParacrossHeightStatusRsp) XXX_DiscardUnknown() {
xxx_messageInfo_ParacrossHeightStatusRsp.DiscardUnknown(m)
}
var xxx_messageInfo_ParacrossHeightStatusRsp proto.InternalMessageInfo
func (m *ParacrossHeightStatusRsp) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *ParacrossHeightStatusRsp) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *ParacrossHeightStatusRsp) GetHeight() int64 {
if m != nil {
return m.Height
}
return 0
}
func (m *ParacrossHeightStatusRsp) GetMainHeight() int64 {
if m != nil {
return m.MainHeight
}
return 0
}
func (m *ParacrossHeightStatusRsp) GetMainHash() string {
if m != nil {
return m.MainHash
}
return ""
}
func (m *ParacrossHeightStatusRsp) GetCommitAddrs() []string {
if m != nil {
return m.CommitAddrs
}
return nil
}
func (m *ParacrossHeightStatusRsp) GetCommitBlockHash() []string {
if m != nil {
return m.CommitBlockHash
}
return nil
}
type ParacrossStatus struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
......@@ -157,7 +252,7 @@ func (m *ParacrossStatus) Reset() { *m = ParacrossStatus{} }
func (m *ParacrossStatus) String() string { return proto.CompactTextString(m) }
func (*ParacrossStatus) ProtoMessage() {}
func (*ParacrossStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{2}
return fileDescriptor_6a397e38c9ea6747, []int{3}
}
func (m *ParacrossStatus) XXX_Unmarshal(b []byte) error {
......@@ -213,7 +308,7 @@ func (m *ParacrossConsensusStatus) Reset() { *m = ParacrossConsensusStat
func (m *ParacrossConsensusStatus) String() string { return proto.CompactTextString(m) }
func (*ParacrossConsensusStatus) ProtoMessage() {}
func (*ParacrossConsensusStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{3}
return fileDescriptor_6a397e38c9ea6747, []int{4}
}
func (m *ParacrossConsensusStatus) XXX_Unmarshal(b []byte) error {
......@@ -277,7 +372,7 @@ func (m *ParaNodeAddrConfig) Reset() { *m = ParaNodeAddrConfig{} }
func (m *ParaNodeAddrConfig) String() string { return proto.CompactTextString(m) }
func (*ParaNodeAddrConfig) ProtoMessage() {}
func (*ParaNodeAddrConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{4}
return fileDescriptor_6a397e38c9ea6747, []int{5}
}
func (m *ParaNodeAddrConfig) XXX_Unmarshal(b []byte) error {
......@@ -345,7 +440,7 @@ func (m *ParaNodeVoteDetail) Reset() { *m = ParaNodeVoteDetail{} }
func (m *ParaNodeVoteDetail) String() string { return proto.CompactTextString(m) }
func (*ParaNodeVoteDetail) ProtoMessage() {}
func (*ParaNodeVoteDetail) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{5}
return fileDescriptor_6a397e38c9ea6747, []int{6}
}
func (m *ParaNodeVoteDetail) XXX_Unmarshal(b []byte) error {
......@@ -396,7 +491,7 @@ func (m *ParaNodeAddrStatus) Reset() { *m = ParaNodeAddrStatus{} }
func (m *ParaNodeAddrStatus) String() string { return proto.CompactTextString(m) }
func (*ParaNodeAddrStatus) ProtoMessage() {}
func (*ParaNodeAddrStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{6}
return fileDescriptor_6a397e38c9ea6747, []int{7}
}
func (m *ParaNodeAddrStatus) XXX_Unmarshal(b []byte) error {
......@@ -473,7 +568,7 @@ func (m *ReceiptParaNodeConfig) Reset() { *m = ReceiptParaNodeConfig{} }
func (m *ReceiptParaNodeConfig) String() string { return proto.CompactTextString(m) }
func (*ReceiptParaNodeConfig) ProtoMessage() {}
func (*ReceiptParaNodeConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{7}
return fileDescriptor_6a397e38c9ea6747, []int{8}
}
func (m *ReceiptParaNodeConfig) XXX_Unmarshal(b []byte) error {
......@@ -535,7 +630,7 @@ func (m *ReceiptParaNodeVoteRecord) Reset() { *m = ReceiptParaNodeVoteRe
func (m *ReceiptParaNodeVoteRecord) String() string { return proto.CompactTextString(m) }
func (*ReceiptParaNodeVoteRecord) ProtoMessage() {}
func (*ReceiptParaNodeVoteRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{8}
return fileDescriptor_6a397e38c9ea6747, []int{9}
}
func (m *ReceiptParaNodeVoteRecord) XXX_Unmarshal(b []byte) error {
......@@ -594,7 +689,7 @@ func (m *ReceiptParaNodeVoteDone) Reset() { *m = ReceiptParaNodeVoteDone
func (m *ReceiptParaNodeVoteDone) String() string { return proto.CompactTextString(m) }
func (*ReceiptParaNodeVoteDone) ProtoMessage() {}
func (*ReceiptParaNodeVoteDone) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{9}
return fileDescriptor_6a397e38c9ea6747, []int{10}
}
func (m *ReceiptParaNodeVoteDone) XXX_Unmarshal(b []byte) error {
......@@ -679,7 +774,7 @@ func (m *ParaNodeGroupConfig) Reset() { *m = ParaNodeGroupConfig{} }
func (m *ParaNodeGroupConfig) String() string { return proto.CompactTextString(m) }
func (*ParaNodeGroupConfig) ProtoMessage() {}
func (*ParaNodeGroupConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{10}
return fileDescriptor_6a397e38c9ea6747, []int{11}
}
func (m *ParaNodeGroupConfig) XXX_Unmarshal(b []byte) error {
......@@ -752,7 +847,7 @@ func (m *ParaNodeGroupStatus) Reset() { *m = ParaNodeGroupStatus{} }
func (m *ParaNodeGroupStatus) String() string { return proto.CompactTextString(m) }
func (*ParaNodeGroupStatus) ProtoMessage() {}
func (*ParaNodeGroupStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{11}
return fileDescriptor_6a397e38c9ea6747, []int{12}
}
func (m *ParaNodeGroupStatus) XXX_Unmarshal(b []byte) error {
......@@ -836,7 +931,7 @@ func (m *ReceiptParaNodeGroupConfig) Reset() { *m = ReceiptParaNodeGroup
func (m *ReceiptParaNodeGroupConfig) String() string { return proto.CompactTextString(m) }
func (*ReceiptParaNodeGroupConfig) ProtoMessage() {}
func (*ReceiptParaNodeGroupConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{12}
return fileDescriptor_6a397e38c9ea6747, []int{13}
}
func (m *ReceiptParaNodeGroupConfig) XXX_Unmarshal(b []byte) error {
......@@ -899,7 +994,7 @@ func (m *ReqParacrossNodeInfo) Reset() { *m = ReqParacrossNodeInfo{} }
func (m *ReqParacrossNodeInfo) String() string { return proto.CompactTextString(m) }
func (*ReqParacrossNodeInfo) ProtoMessage() {}
func (*ReqParacrossNodeInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{13}
return fileDescriptor_6a397e38c9ea6747, []int{14}
}
func (m *ReqParacrossNodeInfo) XXX_Unmarshal(b []byte) error {
......@@ -952,7 +1047,7 @@ func (m *RespParacrossNodeAddrs) Reset() { *m = RespParacrossNodeAddrs{}
func (m *RespParacrossNodeAddrs) String() string { return proto.CompactTextString(m) }
func (*RespParacrossNodeAddrs) ProtoMessage() {}
func (*RespParacrossNodeAddrs) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{14}
return fileDescriptor_6a397e38c9ea6747, []int{15}
}
func (m *RespParacrossNodeAddrs) XXX_Unmarshal(b []byte) error {
......@@ -991,7 +1086,7 @@ func (m *RespParacrossNodeGroups) Reset() { *m = RespParacrossNodeGroups
func (m *RespParacrossNodeGroups) String() string { return proto.CompactTextString(m) }
func (*RespParacrossNodeGroups) ProtoMessage() {}
func (*RespParacrossNodeGroups) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{15}
return fileDescriptor_6a397e38c9ea6747, []int{16}
}
func (m *RespParacrossNodeGroups) XXX_Unmarshal(b []byte) error {
......@@ -1033,7 +1128,7 @@ func (m *ParaBlock2MainMap) Reset() { *m = ParaBlock2MainMap{} }
func (m *ParaBlock2MainMap) String() string { return proto.CompactTextString(m) }
func (*ParaBlock2MainMap) ProtoMessage() {}
func (*ParaBlock2MainMap) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{16}
return fileDescriptor_6a397e38c9ea6747, []int{17}
}
func (m *ParaBlock2MainMap) XXX_Unmarshal(b []byte) error {
......@@ -1093,7 +1188,7 @@ func (m *ParaBlock2MainInfo) Reset() { *m = ParaBlock2MainInfo{} }
func (m *ParaBlock2MainInfo) String() string { return proto.CompactTextString(m) }
func (*ParaBlock2MainInfo) ProtoMessage() {}
func (*ParaBlock2MainInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{17}
return fileDescriptor_6a397e38c9ea6747, []int{18}
}
func (m *ParaBlock2MainInfo) XXX_Unmarshal(b []byte) error {
......@@ -1146,7 +1241,7 @@ func (m *ParacrossNodeStatus) Reset() { *m = ParacrossNodeStatus{} }
func (m *ParacrossNodeStatus) String() string { return proto.CompactTextString(m) }
func (*ParacrossNodeStatus) ProtoMessage() {}
func (*ParacrossNodeStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{18}
return fileDescriptor_6a397e38c9ea6747, []int{19}
}
func (m *ParacrossNodeStatus) XXX_Unmarshal(b []byte) error {
......@@ -1276,7 +1371,7 @@ func (m *ParacrossCommitAction) Reset() { *m = ParacrossCommitAction{} }
func (m *ParacrossCommitAction) String() string { return proto.CompactTextString(m) }
func (*ParacrossCommitAction) ProtoMessage() {}
func (*ParacrossCommitAction) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{19}
return fileDescriptor_6a397e38c9ea6747, []int{20}
}
func (m *ParacrossCommitAction) XXX_Unmarshal(b []byte) error {
......@@ -1316,7 +1411,7 @@ func (m *ParacrossMinerAction) Reset() { *m = ParacrossMinerAction{} }
func (m *ParacrossMinerAction) String() string { return proto.CompactTextString(m) }
func (*ParacrossMinerAction) ProtoMessage() {}
func (*ParacrossMinerAction) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{20}
return fileDescriptor_6a397e38c9ea6747, []int{21}
}
func (m *ParacrossMinerAction) XXX_Unmarshal(b []byte) error {
......@@ -1373,7 +1468,7 @@ func (m *ParacrossAction) Reset() { *m = ParacrossAction{} }
func (m *ParacrossAction) String() string { return proto.CompactTextString(m) }
func (*ParacrossAction) ProtoMessage() {}
func (*ParacrossAction) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{21}
return fileDescriptor_6a397e38c9ea6747, []int{22}
}
func (m *ParacrossAction) XXX_Unmarshal(b []byte) error {
......@@ -1751,7 +1846,7 @@ func (m *ReceiptParacrossCommit) Reset() { *m = ReceiptParacrossCommit{}
func (m *ReceiptParacrossCommit) String() string { return proto.CompactTextString(m) }
func (*ReceiptParacrossCommit) ProtoMessage() {}
func (*ReceiptParacrossCommit) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{22}
return fileDescriptor_6a397e38c9ea6747, []int{23}
}
func (m *ReceiptParacrossCommit) XXX_Unmarshal(b []byte) error {
......@@ -1811,7 +1906,7 @@ func (m *ReceiptParacrossMiner) Reset() { *m = ReceiptParacrossMiner{} }
func (m *ReceiptParacrossMiner) String() string { return proto.CompactTextString(m) }
func (*ReceiptParacrossMiner) ProtoMessage() {}
func (*ReceiptParacrossMiner) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{23}
return fileDescriptor_6a397e38c9ea6747, []int{24}
}
func (m *ReceiptParacrossMiner) XXX_Unmarshal(b []byte) error {
......@@ -1857,7 +1952,7 @@ func (m *ReceiptParacrossDone) Reset() { *m = ReceiptParacrossDone{} }
func (m *ReceiptParacrossDone) String() string { return proto.CompactTextString(m) }
func (*ReceiptParacrossDone) ProtoMessage() {}
func (*ReceiptParacrossDone) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{24}
return fileDescriptor_6a397e38c9ea6747, []int{25}
}
func (m *ReceiptParacrossDone) XXX_Unmarshal(b []byte) error {
......@@ -1946,7 +2041,7 @@ func (m *ReceiptParacrossRecord) Reset() { *m = ReceiptParacrossRecord{}
func (m *ReceiptParacrossRecord) String() string { return proto.CompactTextString(m) }
func (*ReceiptParacrossRecord) ProtoMessage() {}
func (*ReceiptParacrossRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{25}
return fileDescriptor_6a397e38c9ea6747, []int{26}
}
func (m *ReceiptParacrossRecord) XXX_Unmarshal(b []byte) error {
......@@ -1994,7 +2089,7 @@ func (m *ParacrossTx) Reset() { *m = ParacrossTx{} }
func (m *ParacrossTx) String() string { return proto.CompactTextString(m) }
func (*ParacrossTx) ProtoMessage() {}
func (*ParacrossTx) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{26}
return fileDescriptor_6a397e38c9ea6747, []int{27}
}
func (m *ParacrossTx) XXX_Unmarshal(b []byte) error {
......@@ -2035,7 +2130,7 @@ func (m *ReqParacrossTitleHeight) Reset() { *m = ReqParacrossTitleHeight
func (m *ReqParacrossTitleHeight) String() string { return proto.CompactTextString(m) }
func (*ReqParacrossTitleHeight) ProtoMessage() {}
func (*ReqParacrossTitleHeight) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{27}
return fileDescriptor_6a397e38c9ea6747, []int{28}
}
func (m *ReqParacrossTitleHeight) XXX_Unmarshal(b []byte) error {
......@@ -2088,7 +2183,7 @@ func (m *RespParacrossDone) Reset() { *m = RespParacrossDone{} }
func (m *RespParacrossDone) String() string { return proto.CompactTextString(m) }
func (*RespParacrossDone) ProtoMessage() {}
func (*RespParacrossDone) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{28}
return fileDescriptor_6a397e38c9ea6747, []int{29}
}
func (m *RespParacrossDone) XXX_Unmarshal(b []byte) error {
......@@ -2176,7 +2271,7 @@ func (m *RespParacrossTitles) Reset() { *m = RespParacrossTitles{} }
func (m *RespParacrossTitles) String() string { return proto.CompactTextString(m) }
func (*RespParacrossTitles) ProtoMessage() {}
func (*RespParacrossTitles) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{29}
return fileDescriptor_6a397e38c9ea6747, []int{30}
}
func (m *RespParacrossTitles) XXX_Unmarshal(b []byte) error {
......@@ -2216,7 +2311,7 @@ func (m *ReqParacrossTitleHash) Reset() { *m = ReqParacrossTitleHash{} }
func (m *ReqParacrossTitleHash) String() string { return proto.CompactTextString(m) }
func (*ReqParacrossTitleHash) ProtoMessage() {}
func (*ReqParacrossTitleHash) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{30}
return fileDescriptor_6a397e38c9ea6747, []int{31}
}
func (m *ReqParacrossTitleHash) XXX_Unmarshal(b []byte) error {
......@@ -2276,7 +2371,7 @@ func (m *ParacrossAsset) Reset() { *m = ParacrossAsset{} }
func (m *ParacrossAsset) String() string { return proto.CompactTextString(m) }
func (*ParacrossAsset) ProtoMessage() {}
func (*ParacrossAsset) Descriptor() ([]byte, []int) {
return fileDescriptor_6a397e38c9ea6747, []int{31}
return fileDescriptor_6a397e38c9ea6747, []int{32}
}
func (m *ParacrossAsset) XXX_Unmarshal(b []byte) error {
......@@ -2377,6 +2472,7 @@ func (m *ParacrossAsset) GetSuccess() bool {
func init() {
proto.RegisterType((*ParacrossStatusDetails)(nil), "types.ParacrossStatusDetails")
proto.RegisterType((*ParacrossHeightStatus)(nil), "types.ParacrossHeightStatus")
proto.RegisterType((*ParacrossHeightStatusRsp)(nil), "types.ParacrossHeightStatusRsp")
proto.RegisterType((*ParacrossStatus)(nil), "types.ParacrossStatus")
proto.RegisterType((*ParacrossConsensusStatus)(nil), "types.ParacrossConsensusStatus")
proto.RegisterType((*ParaNodeAddrConfig)(nil), "types.ParaNodeAddrConfig")
......@@ -2412,112 +2508,116 @@ func init() {
func init() { proto.RegisterFile("paracross.proto", fileDescriptor_6a397e38c9ea6747) }
var fileDescriptor_6a397e38c9ea6747 = []byte{
// 1679 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6e, 0x1b, 0x47,
0x12, 0xe6, 0xf0, 0x57, 0x2c, 0x49, 0x94, 0xd4, 0xb6, 0x64, 0x9a, 0xeb, 0xf5, 0x12, 0x03, 0xef,
0x42, 0x58, 0x78, 0x65, 0xaf, 0xb4, 0xf0, 0x62, 0x61, 0x2c, 0x76, 0x65, 0xd9, 0x16, 0x05, 0xff,
0x20, 0x18, 0x29, 0x3f, 0x97, 0x00, 0x19, 0x0f, 0x5b, 0xd2, 0x20, 0xe4, 0xf4, 0x78, 0xba, 0x69,
0x4b, 0xb9, 0x05, 0x48, 0xf2, 0x22, 0xc9, 0x39, 0xc7, 0x9c, 0x83, 0x1c, 0x93, 0x43, 0x9e, 0x21,
0xc8, 0x03, 0xe4, 0x15, 0x82, 0xae, 0xee, 0xe9, 0xe9, 0x1e, 0x52, 0x8c, 0x23, 0x04, 0x08, 0x72,
0x63, 0x55, 0x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 0x1f, 0x80, 0xa7, 0x31, 0x17, 0x1a,
0x0c, 0xcb, 0x85, 0x8a, 0xe7, 0xf1, 0xa8, 0xd7, 0x9b, 0x85, 0x05, 0x25, 0xea, 0x57, 0xc8, 0x53,
0xe8, 0xe4, 0xb6, 0xf3, 0xa8, 0x8a, 0xeb, 0xb3, 0x9a, 0xb6, 0x77, 0x21, 0xb6, 0xfc, 0x0a, 0xb9,
0x0f, 0xab, 0xfb, 0x54, 0x20, 0x02, 0xcc, 0x32, 0xd8, 0x29, 0xf4, 0xc9, 0xea, 0xf5, 0xd6, 0xcb,
0xf1, 0xa0, 0xb8, 0x5f, 0x21, 0xb7, 0xa1, 0x79, 0xc0, 0x0f, 0xcf, 0x93, 0xa8, 0x1c, 0xc1, 0x9a,
0x26, 0x0f, 0xf8, 0x5e, 0x38, 0x39, 0x39, 0x15, 0x6f, 0xa7, 0x7e, 0xe5, 0x45, 0x13, 0xbf, 0xf0,
0xee, 0xfc, 0x1c, 0x00, 0x00, 0xff, 0xff, 0x16, 0xa8, 0xae, 0xc0, 0x3e, 0x16, 0x00, 0x00,
// 1743 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x18, 0x4b, 0x6f, 0x1c, 0x45,
0x73, 0x67, 0x9f, 0xde, 0xb2, 0xbd, 0xb6, 0x3b, 0xb1, 0xb3, 0xd9, 0x2f, 0x5f, 0xb2, 0x1a, 0x05,
0x64, 0xa1, 0xe0, 0x04, 0x1b, 0x05, 0xa1, 0x08, 0x81, 0xe3, 0x24, 0x5e, 0x2b, 0x0f, 0x45, 0x63,
0xf3, 0xb8, 0x20, 0x31, 0x59, 0xb7, 0xed, 0x11, 0xbb, 0x33, 0x93, 0xe9, 0xde, 0xc4, 0xe6, 0x86,
0x04, 0xfc, 0x07, 0xce, 0x70, 0xe6, 0x47, 0x70, 0x84, 0x03, 0x12, 0xff, 0x00, 0x71, 0xe1, 0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c4, 0x9e, 0x17, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
......@@ -2534,7 +2634,8 @@ const _ = grpc.SupportPackageIsVersion4
type ParacrossClient interface {
GetTitle(ctx context.Context, in *types.ReqString, opts ...grpc.CallOption) (*ParacrossConsensusStatus, error)
ListTitles(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*RespParacrossTitles, error)
GetTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*RespParacrossDone, error)
GetDoneTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*RespParacrossDone, error)
GetTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*ParacrossHeightStatusRsp, error)
GetAssetTxResult(ctx context.Context, in *types.ReqHash, opts ...grpc.CallOption) (*ParacrossAsset, error)
IsSync(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.IsCaughtUp, error)
}
......@@ -2565,8 +2666,17 @@ func (c *paracrossClient) ListTitles(ctx context.Context, in *types.ReqNil, opts
return out, nil
}
func (c *paracrossClient) GetTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*RespParacrossDone, error) {
func (c *paracrossClient) GetDoneTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*RespParacrossDone, error) {
out := new(RespParacrossDone)
err := c.cc.Invoke(ctx, "/types.paracross/GetDoneTitleHeight", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paracrossClient) GetTitleHeight(ctx context.Context, in *ReqParacrossTitleHeight, opts ...grpc.CallOption) (*ParacrossHeightStatusRsp, error) {
out := new(ParacrossHeightStatusRsp)
err := c.cc.Invoke(ctx, "/types.paracross/GetTitleHeight", in, out, opts...)
if err != nil {
return nil, err
......@@ -2596,7 +2706,8 @@ func (c *paracrossClient) IsSync(ctx context.Context, in *types.ReqNil, opts ...
type ParacrossServer interface {
GetTitle(context.Context, *types.ReqString) (*ParacrossConsensusStatus, error)
ListTitles(context.Context, *types.ReqNil) (*RespParacrossTitles, error)
GetTitleHeight(context.Context, *ReqParacrossTitleHeight) (*RespParacrossDone, error)
GetDoneTitleHeight(context.Context, *ReqParacrossTitleHeight) (*RespParacrossDone, error)
GetTitleHeight(context.Context, *ReqParacrossTitleHeight) (*ParacrossHeightStatusRsp, error)
GetAssetTxResult(context.Context, *types.ReqHash) (*ParacrossAsset, error)
IsSync(context.Context, *types.ReqNil) (*types.IsCaughtUp, error)
}
......@@ -2641,6 +2752,24 @@ func _Paracross_ListTitles_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _Paracross_GetDoneTitleHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqParacrossTitleHeight)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParacrossServer).GetDoneTitleHeight(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.paracross/GetDoneTitleHeight",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParacrossServer).GetDoneTitleHeight(ctx, req.(*ReqParacrossTitleHeight))
}
return interceptor(ctx, in, info, handler)
}
func _Paracross_GetTitleHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqParacrossTitleHeight)
if err := dec(in); err != nil {
......@@ -2708,6 +2837,10 @@ var _Paracross_serviceDesc = grpc.ServiceDesc{
Handler: _Paracross_ListTitles_Handler,
},
{
MethodName: "GetDoneTitleHeight",
Handler: _Paracross_GetDoneTitleHeight_Handler,
},
{
MethodName: "GetTitleHeight",
Handler: _Paracross_GetTitleHeight_Handler,
},
......
......@@ -64,9 +64,9 @@ func (p *ParacrossType) GetLogMap() map[int64]*types.LogInfo {
TyLogParaNodeConfig: {Ty: reflect.TypeOf(ReceiptParaNodeConfig{}), Name: "LogParaNodeConfig"},
TyLogParaNodeGroupUpdate: {Ty: reflect.TypeOf(types.ReceiptConfig{}), Name: "LogParaNodeGroupUpdate"},
TyLogParaNodeVoteDone: {Ty: reflect.TypeOf(ReceiptParaNodeVoteDone{}), Name: "LogParaNodeVoteDone"},
TyLogParaNodeGroupApply: {Ty: reflect.TypeOf(ReceiptParaNodeConfig{}), Name: "LogParaNodeGroupApply"},
TyLogParaNodeGroupApprove: {Ty: reflect.TypeOf(ReceiptParaNodeConfig{}), Name: "LogParaNodeGroupApprove"},
TyLogParaNodeGroupQuit: {Ty: reflect.TypeOf(ReceiptParaNodeConfig{}), Name: "LogParaNodeGroupQuit"},
TyLogParaNodeGroupApply: {Ty: reflect.TypeOf(ReceiptParaNodeGroupConfig{}), Name: "LogParaNodeGroupApply"},
TyLogParaNodeGroupApprove: {Ty: reflect.TypeOf(ReceiptParaNodeGroupConfig{}), Name: "LogParaNodeGroupApprove"},
TyLogParaNodeGroupQuit: {Ty: reflect.TypeOf(ReceiptParaNodeGroupConfig{}), Name: "LogParaNodeGroupQuit"},
}
}
......@@ -126,7 +126,7 @@ func (p ParacrossType) CreateTx(action string, message json.RawMessage) (*types.
return nil, types.ErrInvalidParam
}
return CreateRawNodeConfigTx(&param)
} else if action == "NodeGroupApply" {
} else if action == "NodeGroupConfig" {
if !types.IsPara() {
return nil, types.ErrNotSupport
}
......
all:
chmod +x ./build.sh
./build.sh $(OUT) $(FLAG)
#!/bin/sh
strpwd=$(pwd)
strcmd=${strpwd##*dapp/}
strapp=${strcmd%/cmd*}
OUT_DIR="${1}/$strapp"
#FLAG=$2
mkdir -p "${OUT_DIR}"
cp ./build/* "${OUT_DIR}"
OUT_TESTDIR="${1}/dapptest/$strapp"
mkdir -p "${OUT_TESTDIR}"
cp ./build/test-rpc.sh "${OUT_TESTDIR}"
#!/usr/bin/env bash
# shellcheck disable=SC2128
set -e
set -o pipefail
MAIN_HTTP=""
GAME_ID=""
# shellcheck source=/dev/null
source ../dapp-test-common.sh
pokerbull_PlayRawTx() {
echo "========== # pokerbull play tx begin =========="
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Play","payload":{"gameId":"pokerbull-abc", "value":"1000000000", "round":1}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" ${MAIN_HTTP}
echo "========== # pokerbull play tx end =========="
chain33_BlockWait 1 ${MAIN_HTTP}
}
pokerbull_QuitRawTx() {
echo "========== # pokerbull quit tx begin =========="
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Quit","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" ${MAIN_HTTP}
echo "========== # pokerbull quit tx end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
pokerbull_ContinueRawTx() {
echo "========== # pokerbull continue tx begin =========="
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Continue","payload":{"gameId":"'$GAME_ID'"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989" ${MAIN_HTTP}
echo "========== # pokerbull continue tx end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
pokerbull_StartRawTx() {
echo "========== # pokerbull start tx begin =========="
tx=$(curl -ksd '{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Start","payload":{"value":"1000000000", "playerNum":"2"}}]}' ${MAIN_HTTP} | jq -r ".result")
data=$(curl -ksd '{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]}' ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" ${MAIN_HTTP}
GAME_ID=$RAW_TX_HASH
echo "========== # pokerbull start tx end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
pokerbull_QueryResult() {
echo "========== # pokerbull query result begin =========="
local req='"method":"Chain33.Query","params":[{"execer":"pokerbull","funcName":"QueryGameByID","payload":{"gameId":"'$GAME_ID'"}}]'
data=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
ok=$(jq '(.game.gameId == "$GAME_ID")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
data=$(curl -ksd '{"method":"Chain33.Query","params":[{"execer":"pokerbull","funcName":"QueryGameByAddr","payload":{"addr":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"}}]}' ${MAIN_HTTP} | jq -r ".result")
[ "$data" != null ]
echo_rst "$FUNCNAME" "$?"
data=$(curl -ksd '{"method":"Chain33.Query","params":[{"execer":"pokerbull","funcName":"QueryGameByStatus","payload":{"status":"3"}}]}' ${MAIN_HTTP} | jq -r ".result")
[ "$data" != null ]
echo_rst "$FUNCNAME" "$?"
echo "========== # pokerbull query result end =========="
}
init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
echo "ipara=$ispara"
if [ "$ispara" == true ]; then
pokerbull_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.pokerbull"}]}' ${MAIN_HTTP} | jq -r ".result")
else
pokerbull_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"pokerbull"}]}' ${MAIN_HTTP} | jq -r ".result")
fi
local from="1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
chain33_SendToAddress "$from" "$pokerbull_addr" 10000000000 ${MAIN_HTTP}
from="1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX"
chain33_SendToAddress "$from" "$pokerbull_addr" 10000000000 ${MAIN_HTTP}
chain33_BlockWait 1 "${MAIN_HTTP}"
}
function run_test() {
pokerbull_StartRawTx
pokerbull_ContinueRawTx
pokerbull_QuitRawTx
pokerbull_PlayRawTx
pokerbull_QueryResult
}
function main() {
MAIN_HTTP="$1"
echo "=========== # pokerbull rpc test ============="
echo "ip=$MAIN_HTTP"
init
run_test
if [ -n "$CASE_ERR" ]; then
echo -e "${RED}=============Pokerbull Rpc Test Fail=============${NOC}"
exit 1
else
echo -e "${GRE}=============Pokerbull Rpc Test Pass==============${NOC}"
fi
}
main "$1"
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package commands
package cmd
import (
"fmt"
......
......@@ -6,7 +6,7 @@ package pokerbull
import (
"github.com/33cn/chain33/pluginmgr"
"github.com/33cn/plugin/plugin/dapp/pokerbull/commands"
"github.com/33cn/plugin/plugin/dapp/pokerbull/cmd"
"github.com/33cn/plugin/plugin/dapp/pokerbull/executor"
"github.com/33cn/plugin/plugin/dapp/pokerbull/types"
)
......@@ -16,6 +16,6 @@ func init() {
Name: types.PokerBullX,
ExecName: executor.GetName(),
Exec: executor.Init,
Cmd: commands.PokerBullCmd,
Cmd: cmd.PokerBullCmd,
})
}
all:
chmod +x ./build.sh
./build.sh $(OUT) $(FLAG)
\ No newline at end of file
#!/bin/sh
strpwd=$(pwd)
strcmd=${strpwd##*dapp/}
strapp=${strcmd%/cmd*}
OUT_DIR="${1}/$strapp"
#FLAG=$2
mkdir -p "${OUT_DIR}"
cp ./build/* "${OUT_DIR}"
OUT_TESTDIR="${1}/dapptest/$strapp"
mkdir -p "${OUT_TESTDIR}"
cp ./build/test-rpc.sh "${OUT_TESTDIR}"
#!/usr/bin/env bash
# shellcheck disable=SC2128
set -e
set -o pipefail
MAIN_HTTP=""
# shellcheck source=/dev/null
source ../dapp-test-common.sh
retrieve_Backup() {
echo "========== # retrieve backup begin =========="
local req='"method":"retrieve.CreateRawRetrieveBackupTx","params":[{"backupAddr":"1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX","defaultAddr":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo","delayPeriod": 61}]'
tx=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
local reqDecode='"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]'
data=$(curl -ksd "{$reqDecode}" ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" ${MAIN_HTTP}
echo "========== # retrieve backup end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
retrieve_Prepare() {
echo "========== # retrieve prepare begin =========="
local req='"method":"retrieve.CreateRawRetrievePrepareTx","params":[{"backupAddr":"1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX","defaultAddr":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"}]'
tx=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
local reqDecode='"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]'
data=$(curl -ksd "{$reqDecode}" ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989" ${MAIN_HTTP}
echo "========== # retrieve prepare end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
retrieve_Perform() {
echo "========== # retrieve perform begin =========="
local req='"method":"retrieve.CreateRawRetrievePerformTx","params":[{"backupAddr":"1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX","defaultAddr":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"}]'
tx=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
local reqDecode='"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]'
data=$(curl -ksd "{$reqDecode}" ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989" ${MAIN_HTTP}
echo "========== # retrieve perform end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
retrieve_Cancel() {
echo "========== # retrieve cancel begin =========="
local req='"method":"retrieve.CreateRawRetrieveCancelTx","params":[{"backupAddr":"1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX","defaultAddr":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"}]'
tx=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
local reqDecode='"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'"$tx"'"}]'
data=$(curl -ksd "{$reqDecode}" ${MAIN_HTTP} | jq -r ".result.txs[0]")
ok=$(jq '(.execer != "")' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
chain33_SignRawTx "$tx" "56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" ${MAIN_HTTP}
echo "========== # retrieve cancel end =========="
chain33_BlockWait 1 "${MAIN_HTTP}"
}
retrieve_QueryResult() {
echo "========== # retrieve query result begin =========="
local status=$1
local req='"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX", "defaultAddress":"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"}}]'
data=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
ok=$(jq '(.status == '"$status"')' <<<"$data")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
echo "========== # retrieve query result end =========="
}
init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
echo "ipara=$ispara"
if [ "$ispara" == true ]; then
retrieve_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.retrieve"}]}' ${MAIN_HTTP} | jq -r ".result")
else
retrieve_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"retrieve"}]}' ${MAIN_HTTP} | jq -r ".result")
fi
local from="1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
chain33_SendToAddress "$from" "$retrieve_addr" 1000000000 ${MAIN_HTTP}
from="1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX"
chain33_SendToAddress "$from" "$retrieve_addr" 1000000000 ${MAIN_HTTP}
chain33_BlockWait 1 "${MAIN_HTTP}"
}
function run_test() {
retrieve_Backup
retrieve_QueryResult 1
retrieve_Prepare
retrieve_QueryResult 2
retrieve_Cancel
retrieve_QueryResult 4
retrieve_Backup
retrieve_QueryResult 1
retrieve_Prepare
retrieve_QueryResult 2
sleep 61
retrieve_Perform
retrieve_QueryResult 3
}
function main() {
MAIN_HTTP="$1"
echo "=========== # retrieve rpc test ============="
echo "ip=$MAIN_HTTP"
init
run_test
if [ -n "$CASE_ERR" ]; then
echo -e "${RED}=============retrieve Rpc Test Fail=============${NOC}"
exit 1
else
echo -e "${GRE}=============retrieve Rpc Test Pass==============${NOC}"
fi
}
main "$1"
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package commands
package cmd
import (
"fmt"
......
......@@ -6,7 +6,7 @@ package retrieve
import (
"github.com/33cn/chain33/pluginmgr"
"github.com/33cn/plugin/plugin/dapp/retrieve/commands"
"github.com/33cn/plugin/plugin/dapp/retrieve/cmd"
"github.com/33cn/plugin/plugin/dapp/retrieve/executor"
"github.com/33cn/plugin/plugin/dapp/retrieve/rpc"
"github.com/33cn/plugin/plugin/dapp/retrieve/types"
......@@ -17,7 +17,7 @@ func init() {
Name: types.RetrieveX,
ExecName: executor.GetName(),
Exec: executor.Init,
Cmd: commands.RetrieveCmd,
Cmd: cmd.RetrieveCmd,
RPC: rpc.Init,
})
}
......@@ -16,7 +16,7 @@ func (c *channelClient) Backup(ctx context.Context, v *rt.BackupRetrieve) (*type
Ty: rt.RetrieveActionBackup,
Value: &rt.RetrieveAction_Backup{Backup: v},
}
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(backup))
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(backup))
if err != nil {
return nil, err
}
......@@ -29,7 +29,7 @@ func (c *channelClient) Prepare(ctx context.Context, v *rt.PrepareRetrieve) (*ty
Ty: rt.RetrieveActionPrepare,
Value: &rt.RetrieveAction_Prepare{Prepare: v},
}
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(prepare))
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(prepare))
if err != nil {
return nil, err
}
......@@ -43,7 +43,7 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty
Ty: rt.RetrieveActionPerform,
Value: &rt.RetrieveAction_Perform{Perform: v},
}
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(perform))
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(perform))
if err != nil {
return nil, err
}
......@@ -56,7 +56,7 @@ func (c *channelClient) Cancel(ctx context.Context, v *rt.CancelRetrieve) (*type
Ty: rt.RetrieveActionCancel,
Value: &rt.RetrieveAction_Cancel{Cancel: v},
}
tx, err := types.CreateFormatTx(string(rt.ExecerRetrieve), types.Encode(cancel))
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(cancel))
if err != nil {
return nil, err
}
......
......@@ -15,15 +15,15 @@ cmd目录下有两个文件Makefile和build.sh 负责在make时候把build里面
也可以通过dapp参数关键字all来run所有的dapp, all模式会自动删除pass的dapp的资源
1. make docker-compose [PROJ=xx] [DAPP=xx]
1. 如果PROJ 和DAPP都不设置如 make docker-compose, 只会run 系统的test case,不会run任何dapp
1. 如果PROJ不设置,系统会缺省采用build关键字作为docker-compose的service工程名,如果设置以设置为准,
不同PROJ可以实现docker compose 并行
1. 如果DAPP不设置,则不run任何dapp,如果设置,则只run 指定的dapp,run结束后需要手动 make docker-compose-down DAPP=xx释放
1. 如果DAPP=all 或者ALL, 则run 所有提供testcase的dapp
1. make docker-compose down [PROJ=xx] [DAPP=xx]
负责clean make docker-compose 或make fork-test 创建了的docker资源, PROJ 和DAPP规则同上
1. make fork-test [PROJ=xx] [DAPP=xx] 分叉测试
1. make docker-compose [proj=xx] [dapp=xx]
1. 如果proj 和dapp都不设置如 make docker-compose, 只会run 系统的test case,不会run任何dapp
1. 如果proj不设置,系统会缺省采用build关键字作为docker-compose的service工程名,如果设置以设置为准,
不同proj可以实现docker compose 并行
1. 如果dapp不设置,则不run任何dapp,如果设置,则只run 指定的dapp,run结束后需要手动 make docker-compose-down dapp=xx释放
1. 如果dapp=all 或者ALL, 则run 所有提供testcase的dapp
1. make docker-compose down [proj=xx] [dapp=xx]
负责clean make docker-compose 或make fork-test 创建了的docker资源, proj 和dapp规则同上
1. make fork-test [proj=xx] [dapp=xx] 分叉测试
1. 规则同make docker-compose
......
all:
chmod +x ./build.sh
./build.sh $(OUT) $(FLAG)
\ No newline at end of file
#!/usr/bin/env bash
strpwd=$(pwd)
strcmd=${strpwd##*dapp/}
strapp=${strcmd%/cmd*}
OUT_DIR="${1}/$strapp"
#FLAG=$2
mkdir -p "${OUT_DIR}"
cp ./build/* "${OUT_DIR}"
OUT_TESTDIR="${1}/dapptest/$strapp"
mkdir -p "${OUT_TESTDIR}"
cp ./build/test-rpc.sh "${OUT_TESTDIR}"
#!/usr/bin/env bash
# shellcheck disable=SC2128
MAIN_HTTP=""
CASE_ERR=""
tokenAddr="1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
recvAddr="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
superManager="0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc"
tokenSymbol="ABCDE"
token_addr=""
execName="token"
#color
RED='\033[1;31m'
GRE='\033[1;32m'
NOC='\033[0m'
# $2=0 means true, other false
function echo_rst() {
if [ "$2" -eq 0 ]; then
echo -e "${GRE}$1 ok${NOC}"
else
echo -e "${RED}$1 fail${NOC}"
CASE_ERR="FAIL"
fi
}
function chain33_ImportPrivkey() {
local pri=$2
local acc=$3
local req='"method":"Chain33.ImportPrivkey", "params":[{"privkey":"'"$pri"'", "label":"tokenAddr"}]'
echo "#request: $req"
resp=$(curl -ksd "{$req}" "$1")
echo "#response: $resp"
ok=$(jq '(.error|not) and (.result.label=="tokenAddr") and (.result.acc.addr == "'"$acc"'")' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
}
function Chain33_SendToAddress() {
local from="$1"
local to="$2"
local amount=$3
local req='"method":"Chain33.SendToAddress", "params":[{"from":"'"$from"'","to":"'"$to"'", "amount":'"$amount"', "note":"test\n"}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
# echo "#response: $resp"
ok=$(jq '(.error|not) and (.result.hash|length==66)' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
hash=$(jq '(.result.hash)' <<<"$resp")
echo "hash=$hash"
# query_tx "$hash"
}
function chain33_unlock() {
ok=$(curl -k -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ]
rst=$?
echo_rst "$FUNCNAME" "$rst"
}
function block_wait() {
local req='"method":"Chain33.GetLastHeader","params":[]'
cur_height=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq ".result.height")
expect=$((cur_height + ${1}))
local count=0
while true; do
new_height=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq ".result.height")
if [ "${new_height}" -ge "${expect}" ]; then
break
fi
count=$((count + 1))
sleep 1
done
echo "wait new block $count s, cur height=$expect,old=$cur_height"
}
function signRawTx() {
unsignedTx=$1
addr=$2
signedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.SignRawTx","params":[{"addr":"'"${addr}"'","txHex":"'"${unsignedTx}"'","expire":"120s"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "$signedTx" == "null" ]; then
return 1
else
return 0
fi
}
function sendSignedTx() {
txHash=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.SendTransaction","params":[{"token":"","data":"'"${signedTx}"'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "$txHash" == "null" ]; then
return 1
else
return 0
fi
}
# 查询交易的执行结果
# 根据传入的规则,校验查询的结果 (参数1: 校验规则 参数2: 预期匹配结果)
function queryTransaction() {
validator=$1
expectRes=$2
echo "txhash=${txHash}"
res=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.QueryTransaction","params":[{"hash":"'"${txHash}"'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r "${validator}")
if [ "${res}" != "${expectRes}" ]; then
return 1
else
return 0
fi
}
function init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
echo "ipara=$ispara"
chain33_ImportPrivkey "${MAIN_HTTP}" "${superManager}" "${tokenAddr}"
if [ "$ispara" == true ]; then
execName="user.p.para.token"
token_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.token"}]}' ${MAIN_HTTP} | jq -r ".result")
Chain33_SendToAddress "$recvAddr" "$tokenAddr" 100000000000
block_wait 1
Chain33_SendToAddress "$tokenAddr" "$token_addr" 1000000000
block_wait 1
else
token_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"token"}]}' ${MAIN_HTTP} | jq -r ".result")
from="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
Chain33_SendToAddress "$from" "$tokenAddr" 10000000000
block_wait 1
Chain33_SendToAddress "$tokenAddr" "$token_addr" 1000000000
block_wait 1
fi
echo "token=$token_addr"
updateConfig
}
function updateConfig() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "manage","actionName":"Modify","payload":{ "key": "token-blacklist","value": "BTY","op": "add","addr": ""}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "update config create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "update config signRawTx" "$?"
sendSignedTx
echo_rst "update config sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "update config queryExecRes" "$?"
}
function token_preCreate() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"token.CreateRawTokenPreCreateTx","params":[{"name": "yinhebib", "symbol": "'"${tokenSymbol}"'", "total": 100000000000, "price": 100, "category": 1,"owner":"'${tokenAddr}'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token preCreate create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token preCreate signRawTx" "$?"
sendSignedTx
echo_rst "token preCreate sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token preCreate queryExecRes" "$?"
}
function token_getPreCreated() {
res=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Query","params":[{"execer":"'"${execName}"'","funcName":"GetTokens","payload":{"queryAll":true,"status":0,"tokens":[],"symbolOnly":false}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".error | not")
if [ "${res}" != "true" ]; then
echo_rst "token preCreate create tx" 1
return
fi
}
function token_finish() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"token.CreateRawTokenFinishTx","params":[{"symbol": "'"${tokenSymbol}"'", "owner":"'${tokenAddr}'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token finish create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token finish signRawTx" "$?"
sendSignedTx
echo_rst "token finish sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token finish queryExecRes" "$?"
}
function token_getFinishCreated() {
res=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Query","params":[{"execer":"'"${execName}"'","funcName":"GetTokens","payload":{"queryAll":true,"status":1,"tokens":[],"symbolOnly":false}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.tokens" | grep "symbol")
if [ "${res}" != "" ]; then
echo_rst "token get finishCreated create tx" 0
else
echo_rst "token get finishCreated create tx" 1
fi
}
function token_assets() {
res=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Query","params":[{"execer": "'"${execName}"'","funcName":"GetAccountTokenAssets","payload": {"address":"'"${recvAddr}"'", "execer": "token"}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
if [ "${res}" == "" ]; then
echo_rst "token get balance tx" 1
return
fi
tokenInfo=$(echo "${res}" | jq -r '.result.tokenAssets' | grep -A 6 -B 1 "${tokenSymbol}")
addr=$(echo "${tokenInfo}" | grep "addr" | awk -F '"' '{print $4}')
balance=$(echo "${tokenInfo}" | grep "balance" | awk -F '"' '{print $4}')
if [ "${addr}" == "${recvAddr}" ] && [ "${balance}" -eq 1000000000 ]; then
echo_rst "token get assets tx" 0
else
echo_rst "token get assets tx" 1
fi
}
function token_balance() {
res=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"token.GetTokenBalance","params":[{"addresses": ["'${tokenAddr}'"],"tokenSymbol":"'"${tokenSymbol}"'","execer": "'"${execName}"'"}]}' -H 'content-type:text/plain;' ${MAIN_HTTP})
if [ "${res}" == "" ]; then
echo_rst "token get balance tx" 1
return
fi
addr=$(echo "${res}" | jq -r ".result[0].addr")
balance=$(echo "${res}" | jq -r ".result[0].balance")
if [ "${addr}" == "${tokenAddr}" ] && [ "${balance}" -eq 100000000000 ]; then
echo_rst "token get balance tx" 0
else
echo_rst "token get balance tx" 1
fi
}
function token_burn() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"token.CreateRawTokenBurnTx","params":[{"symbol": "'"${tokenSymbol}"'","amount": 10000}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token burn create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token burn signRawTx" "$?"
sendSignedTx
echo_rst "token burn sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token burn queryExecRes" "$?"
}
function token_mint() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"token.CreateRawTokenMintTx","params":[{"symbol": "'"${tokenSymbol}"'","amount": 10000}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token mint create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token mint signRawTx" "$?"
sendSignedTx
echo_rst "token mint sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token mint queryExecRes" "$?"
}
function token_transfer() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'"${execName}"'","actionName":"Transfer","payload": {"cointoken":"'"${tokenSymbol}"'", "amount": "1000000000", "note": "", "to": "'"${recvAddr}"'"}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token transfer create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token transfer signRawTx" "$?"
sendSignedTx
echo_rst "token transfer sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token transfer queryExecRes" "$?"
}
function token_sendExec() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'"${execName}"'","actionName":"TransferToExec","payload": {"cointoken":"'"${tokenSymbol}"'", "amount": "10", "note": "", "to": "'"${token_addr}"'", "execName": "'"${execName}"'"}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token sendExec create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token sendExec signRawTx" "$?"
sendSignedTx
echo_rst "token sendExec sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token sendExec queryExecRes" "$?"
}
function token_withdraw() {
unsignedTx=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'"${execName}"'","actionName":"Withdraw","payload": {"cointoken":"'"${tokenSymbol}"'", "amount": "10", "note": "", "to": "'"${token_addr}"'", "execName": "'"${execName}"'"}}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result")
if [ "${unsignedTx}" == "" ]; then
echo_rst "token withdraw create tx" 1
return
fi
signRawTx "${unsignedTx}" "${tokenAddr}"
echo_rst "token withdraw signRawTx" "$?"
sendSignedTx
echo_rst "token withdraw sendSignedTx" "$?"
block_wait 1
queryTransaction ".error | not" "true"
echo_rst "token withdraw queryExecRes" "$?"
}
function run_test() {
local ip=$1
set -x
token_preCreate
token_getPreCreated
token_finish
token_getFinishCreated
token_balance
token_burn
token_mint
token_transfer
token_sendExec
token_assets
token_withdraw
set +x
}
function main() {
local ip=$1
MAIN_HTTP=$ip
echo "=========== # token rpc test ============="
echo "main_ip=$MAIN_HTTP"
init
run_test "$ip"
if [ -n "$CASE_ERR" ]; then
echo -e "${RED}=============Token Rpc Test Fail=============${NOC}"
exit 1
else
echo -e "${GRE}=============Token Rpc Test Pass==============${NOC}"
fi
}
main "$1"
......@@ -47,19 +47,23 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
go func() {
defer mem.wg.Done()
for msg := range client.Recv() {
var err error
var reply interface{}
switch msg.Ty {
case types.EventTx:
mlog.Info("Receive msg from para mempool")
tx := msg.GetData().(*types.Transaction)
reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx)
if err != nil {
msg.Reply(client.NewMessage(mem.key, types.EventReply, err))
} else {
msg.Reply(client.NewMessage(mem.key, types.EventReply, reply))
}
reply, err = mem.mainGrpcCli.SendTransaction(context.Background(), tx)
case types.EventGetProperFee:
reply, err = mem.mainGrpcCli.GetProperFee(context.Background(), &types.ReqNil{})
default:
msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport))
}
if err != nil {
msg.Reply(client.NewMessage(mem.key, types.EventReply, err))
} else {
msg.Reply(client.NewMessage(mem.key, types.EventReply, reply))
}
}
}()
}
......
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