Commit 3d7a1005 authored by mdj33's avatar mdj33

add common addr func for main and para chain

parent 4f10b8d6
......@@ -166,44 +166,27 @@ chain33_LastBlockhash() {
echo -e "######\\n last blockhash is $LAST_BLOCK_HASH \\n######"
}
ip=$(echo "$ip" | cut -d':' -f 1)
chain33_getMainChainCoins() {
chain33_applyCoins() {
echo "chain33_getMainChainCoins"
if [ "$#" -lt 3 ]; then
echo "chain33_getMainCoins wrong params"
exit 1
fi
local MAIN_HTTP=$1
local targetAddr=$2
local count=$3
if [ $count -gt 10000000000 ]; then
echo "chain33_getMainCoins wrong coins count,should less than 100 00000000"
local targetAddr=$1
local count=$2
local ip=$3
if [ "$count" -gt 15000000000 ]; then
echo "chain33_getMainCoins wrong coins count,should less than 150 00000000"
exit 1
fi
local poolAddr="0x9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40"
M_HTTP=${MAIN_HTTP//8901/8801}
chain33_SendToAddress "${poolAddr}" "${targetAddr}" $count "${M_HTTP}"
local poolAddr="1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx"
chain33_SendToAddress "${poolAddr}" "${targetAddr}" "$count" "${ip}"
}
chain33_getParaChainCoins() {
echo "chain33_getParaChainCoins"
if [ "$#" -lt 3 ]; then
echo "chain33_getParaChainCoins wrong params"
exit 1
fi
local MAIN_HTTP=$1
local targetAddr=$2
local count=$3
if [ $count -gt 100000000000 ]; then
echo "chain33_getMainCoins wrong coins count,should less than 1000 00000000"
exit 1
fi
local poolAddr="0x9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40"
P_HTTP=${MAIN_HTTP//8801/8901}
chain33_SendToAddress "${poolAddr}" "${targetAddr}" $count "${P_HTTP}"
chain33_debug_function() {
set -x
eval "$@"
set +x
}
......@@ -103,6 +103,9 @@ function base_init() {
# ticket
sed -i $sedfix 's/^ticketPrice =.*/ticketPrice = 10000/g' chain33.toml
#relay genesis
sed -i $sedfix 's/^genesis="12qyocayNF7.*/genesis="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"/g' chain33.toml
}
function start() {
......@@ -377,6 +380,11 @@ function dapp_test_address() {
if [ -z "${result}" ]; then
exit 1
fi
result=$(${1} account import_key -k 9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40 -l rpctestpooladdr | jq ".label")
echo "${result}"
if [ -z "${result}" ]; then
exit 1
fi
sleep 1
......@@ -384,7 +392,7 @@ function dapp_test_address() {
echo "${hash}"
#total allocation for rpc test
hash=$(${1} send coins transfer -a 5000 -n transfer -t 1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989)
hash=$(${1} send coins transfer -a 8000 -n transfer -t 1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989)
echo "${hash}"
block_wait "${1}" 1
......
......@@ -50,7 +50,7 @@ function para_set_toml() {
sed -i $xsedfix 's/^whitelist=.*/whitelist=["localhost","127.0.0.1","0.0.0.0"]/g' "${1}"
sed -i $xsedfix 's/^ParaRemoteGrpcClient=.*/ParaRemoteGrpcClient="nginx:8803"/g' "${1}"
sed -i $xsedfix 's/^genesis="1JmFaA6unrCFYEWP.*/genesis="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"/g' "${1}"
sed -i $xsedfix 's/^genesis="1JmFaA6unrCFYEWP.*/genesis="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"/g' "${1}"
# shellcheck disable=SC1004
sed -i $xsedfix 's/^superManager=.*/superManager=["1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",\
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",\
......@@ -67,10 +67,10 @@ function para_set_toml() {
function para_set_wallet() {
echo "=========== # para set wallet ============="
para_import_key "${PARA_CLI}" "0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b" "paraAuthAccount"
para_import_key "${PARA_CLI2}" "0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4" "paraAuthAccount"
para_import_key "${PARA_CLI1}" "0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115" "paraAuthAccount"
para_import_key "${PARA_CLI4}" "0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71" "paraAuthAccount"
para_import_wallet "${PARA_CLI}" "0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b" "paraAuthAccount"
para_import_wallet "${PARA_CLI2}" "0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4" "paraAuthAccount"
para_import_wallet "${PARA_CLI1}" "0x7a80a1f75d7360c6123c32a78ecf978c1ac55636f87892df38d8b85a9aeff115" "paraAuthAccount"
para_import_wallet "${PARA_CLI4}" "0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71" "paraAuthAccount"
#14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
para_import_key "${PARA_CLI}" "0xCC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944" "genesis"
......@@ -82,6 +82,8 @@ function para_set_wallet() {
para_import_key "${PARA_CLI}" "0x56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138" "dapptest1"
#1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
para_import_key "${PARA_CLI}" "0x2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989" "dapptest2"
#1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx
para_import_key "${PARA_CLI}" "9d315182e56fde7fadb94408d360203894e5134216944e858f9b31f70e9ecf40" "rpctestpooladdr"
#super node behalf test
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
......@@ -92,7 +94,7 @@ function para_set_wallet() {
para_import_key "${PARA_CLI}" "0x794443611e7369a57b078881445b93b754cbc9b9b8f526535ab9c6d21d29203d" "othernode2"
}
function para_import_key() {
function para_import_wallet() {
local lable=$3
echo "=========== # save seed to wallet ============="
result=$(${1} seed save -p 1314fuzamei -s "tortoise main civil member grace happy century convince father cage beach hip maid merry rib" | jq ".isok")
......@@ -123,6 +125,16 @@ function para_import_key() {
${1} wallet status
}
function para_import_key() {
local lable=$3
echo "=========== # import private key ============="
echo "key: ${2}"
result=$(${1} account import_key -k "${2}" -l "$lable" | jq ".label")
if [ -z "${result}" ]; then
exit 1
fi
}
function para_transfer() {
echo "=========== # para chain transfer ============="
main_transfer2account "1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
......@@ -150,9 +162,6 @@ function para_transfer() {
#1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
main_transfer2paracross "0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5" 100
#relay rpc test
para_transfer2exec "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588" "relay"
para_transfer2exec "0x4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01" "relay"
block_wait "${CLI}" 2
# para_create_manage_nodegroup
......@@ -195,12 +204,6 @@ function main_transfer2paracross() {
echo "${hash1}"
}
function para_transfer2exec() {
echo "exec=$2,addr=${1}"
hash1=$(${PARA_CLI} send coins send_exec -a 500 -e "$2" -k "${1}")
echo "${hash1}"
}
function para_create_manage_nodegroup() {
echo "=========== # para chain send config ============="
para_configkey "${CLI}" "paracross-nodes-user.p.${PARANAME}." "1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
......
......@@ -5,93 +5,30 @@
source ../dapp-test-common.sh
MAIN_HTTP=""
CASE_ERR=""
#color
RED='\033[1;31m'
GRE='\033[1;32m'
NOC='\033[0m'
# $2=0 means true, other false
echo_rst() {
if [ "$2" -eq 0 ]; then
echo -e "${GRE}$1 ok${NOC}"
else
echo -e "${RED}$1 fail${NOC}"
CASE_ERR="err"
fi
}
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 query_tx() {
block_wait 1
local txhash="$1"
local req='"method":"Chain33.QueryTransaction","params":[{"hash":"'"$txhash"'"}]'
# echo "req=$req"
local times=10
while true; do
ret=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result.tx.hash")
echo "====query tx= ${1}, return=$ret "
if [ "${ret}" != "${1}" ]; then
block_wait 1
times=$((times - 1))
if [ $times -le 0 ]; then
echo "====query tx=$1 failed"
echo "req=$req"
curl -ksd "{$req}" ${MAIN_HTTP}
exit 1
fi
else
echo "====query tx=$1 success"
break
fi
done
}
relay_CreateRawRelaySaveBTCHeadTx() {
local req='"method":"relay.CreateRawRelaySaveBTCHeadTx","params":[{"hash":"5e7d9c599cd040ec2ba53f4dee28028710be8c135e779f65c56feadaae34c3f2","height":10,"version":536870912,"merkleRoot":"ab91cd4160e1379c337eee6b7a4bdbb7399d70268d86045aba150743c00c90b6","time":1530862108,"nonce":0,"bits":545259519,"previousHash":"604efe53975ab06cad8748fd703ad5bc960e8b752b2aae98f0f871a4a05abfc7","isReset":true}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
# echo "#resp: $resp"
ok=$(jq '(.error|not) and (.result != "")' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
chain33_SignRawTx "$rawtx" "0x22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "${MAIN_HTTP}"
signrawtx() {
txHex="$1"
priKey="$2"
local req='"method":"Chain33.SignRawTx","params":[{"privkey":"'"$priKey"'","txHex":"'"$txHex"'","expire":"120s"}]'
# echo "#request SignRawTx: $req"
signedTx=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result")
# echo "signedTx=$signedTx"
if [ "$signedTx" != null ]; then
sendTx "$signedTx"
else
echo "signedTx null error"
fi
}
sendTx() {
signedTx=$1
local req='"method":"Chain33.SendTransaction","params":[{"token":"BTY","data":"'"$signedTx"'"}]'
# echo "#request sendTx: $req"
# curl -ksd "{$req}" ${MAIN_HTTP}
resp=$(curl -ksd "{$req}" ${MAIN_HTTP})
err=$(jq '(.error)' <<<"$resp")
txhash=$(jq -r ".result" <<<"$resp")
if [ "$err" == null ]; then
# echo "tx hash: $txhash"
query_tx "$txhash"
else
echo "send tx error:$err"
fi
relay_CreateRawRelaySaveBTCHeadTx_11() {
local req='"method":"relay.CreateRawRelaySaveBTCHeadTx","params":[{"hash":"7b7a4a9b49db5a1162be515d380cd186e98c2bf0bb90f1145485d7c43343fc7c","height":11,"version":536870912,"merkleRoot":"cfa9b66696aea63b7266ffaa1cb4b96c8dd6959eaabf2eb14173f4adaa551f6f","time":1530862108,"nonce":1,"bits":545259519,"previousHash":"5e7d9c599cd040ec2ba53f4dee28028710be8c135e779f65c56feadaae34c3f2","isReset":false}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
# echo "#resp: $resp"
ok=$(jq '(.error|not) and (.result != "")' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
chain33_SignRawTx "$rawtx" "0x22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "${MAIN_HTTP}"
}
......@@ -104,11 +41,11 @@ relay_CreateRawRelayOrderTx() {
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
chain33_SignRawTx "$rawtx" "0x22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "${MAIN_HTTP}"
}
relay_CreateRawRelayAcceptTx() {
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
# echo "#request: $req"
id=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result.relayorders[0].id")
if [ "$id" == null ]; then
......@@ -125,12 +62,12 @@ relay_CreateRawRelayAcceptTx() {
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
chain33_SignRawTx "$rawtx" "0xec9162ea5fc2f473ab8240619a0a0f495ba9e9e5d4d9c434b8794a68280236c4" "${MAIN_HTTP}"
}
relay_CreateRawRelayRevokeTx() {
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
# echo "#request: $req"
id=$(curl -ksd "{$req}" ${MAIN_HTTP} | jq -r ".result.relayorders[0].id")
if [ "$id" == null ]; then
......@@ -147,7 +84,7 @@ relay_CreateRawRelayRevokeTx() {
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
chain33_SignRawTx "$rawtx" "0x22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "${MAIN_HTTP}"
}
......@@ -169,33 +106,7 @@ relay_CreateRawRelayConfirmTx() {
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
}
relay_CreateRawRelaySaveBTCHeadTx() {
local req='"method":"relay.CreateRawRelaySaveBTCHeadTx","params":[{"hash":"5e7d9c599cd040ec2ba53f4dee28028710be8c135e779f65c56feadaae34c3f2","height":10,"version":536870912,"merkleRoot":"ab91cd4160e1379c337eee6b7a4bdbb7399d70268d86045aba150743c00c90b6","time":1530862108,"nonce":0,"bits":545259519,"previousHash":"604efe53975ab06cad8748fd703ad5bc960e8b752b2aae98f0f871a4a05abfc7","isReset":true}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
# echo "#resp: $resp"
ok=$(jq '(.error|not) and (.result != "")' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "0x4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
}
relay_CreateRawRelaySaveBTCHeadTx_11() {
local req='"method":"relay.CreateRawRelaySaveBTCHeadTx","params":[{"hash":"7b7a4a9b49db5a1162be515d380cd186e98c2bf0bb90f1145485d7c43343fc7c","height":11,"version":536870912,"merkleRoot":"cfa9b66696aea63b7266ffaa1cb4b96c8dd6959eaabf2eb14173f4adaa551f6f","time":1530862108,"nonce":1,"bits":545259519,"previousHash":"5e7d9c599cd040ec2ba53f4dee28028710be8c135e779f65c56feadaae34c3f2","isReset":false}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" "${MAIN_HTTP}")
# echo "#resp: $resp"
ok=$(jq '(.error|not) and (.result != "")' <<<"$resp")
[ "$ok" == true ]
echo_rst "$FUNCNAME" "$?"
rawtx=$(jq -r ".result" <<<"$resp")
signrawtx "$rawtx" "0x4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"
chain33_SignRawTx "$rawtx" "0xec9162ea5fc2f473ab8240619a0a0f495ba9e9e5d4d9c434b8794a68280236c4" "${MAIN_HTTP}"
}
......@@ -211,7 +122,7 @@ query_GetRelayOrderByStatus() {
}
query_GetSellRelayOrder() {
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetSellRelayOrder","payload":{"addr":"1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3","status":"pending","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" ${MAIN_HTTP})
# echo "#response: $resp"
......@@ -222,7 +133,7 @@ query_GetSellRelayOrder() {
}
query_GetBuyRelayOrder() {
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetBuyRelayOrder","payload":{"addr":"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY","status":"locking","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
local req='"method":"Chain33.Query", "params":[{"execer":"relay","funcName":"GetBuyRelayOrder","payload":{"addr":"1EZKahMRfoMiKp1BewjWrQWoaJ9kmC4hum","status":"locking","coins":["BTC"],"pageNumber":0,"pageSize":0}}]'
# echo "#request: $req"
resp=$(curl -ksd "{$req}" ${MAIN_HTTP})
# echo "#response: $resp"
......@@ -261,17 +172,49 @@ init() {
if [ "$ispara" == true ]; then
relay_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.relay"}]}' ${MAIN_HTTP} | jq -r ".result")
else
# chain33_ImportPrivkey "${MAIN_HTTP}" "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588" "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
relay_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"relay"}]}' ${MAIN_HTTP} | jq -r ".result")
fi
echo "relayaddr=$relay_addr"
local testAddr="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"
chain33_getMainChainCoins "${MAIN_HTTP}" "$testAddr" 10000000000
chain33_getParaChainCoins "${MAIN_HTTP}" "$testAddr" 10000000000
chain33_SendToAddress "$testAddr" "$relay_addr" 8000000000 "${MAIN_HTTP}"
local main_ip=${MAIN_HTTP//8901/8801}
#main chain import pri key
#1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3
chain33_ImportPrivkey "22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3" "relay_sell" "${main_ip}"
#1EZKahMRfoMiKp1BewjWrQWoaJ9kmC4hum
chain33_ImportPrivkey "ec9162ea5fc2f473ab8240619a0a0f495ba9e9e5d4d9c434b8794a68280236c4" "1EZKahMRfoMiKp1BewjWrQWoaJ9kmC4hum" "relay_acc" "$main_ip"
local sellAddr="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"
local accepAddr="1EZKahMRfoMiKp1BewjWrQWoaJ9kmC4hum"
if [ "$ispara" == false ]; then
chain33_applyCoins "$sellAddr" 12000000000 "${main_ip}"
chain33_QueryBalance "${sellAddr}" "$main_ip"
chain33_applyCoins "$accepAddr" 12000000000 "${main_ip}"
chain33_QueryBalance "${accepAddr}" "$main_ip"
else
# tx fee
chain33_applyCoins "$sellAddr" 1000000000 "${main_ip}"
chain33_QueryBalance "${sellAddr}" "$main_ip"
chain33_applyCoins "$accepAddr" 1000000000 "${main_ip}"
chain33_QueryBalance "${accepAddr}" "$main_ip"
local para_ip="${MAIN_HTTP}"
#para chain import pri key
chain33_ImportPrivkey "22968d29c6de695381a8719ef7bf00e2edb6cce500bb59a4fc73c41887610962" "1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3" "relay_sell" "$para_ip"
chain33_ImportPrivkey "ec9162ea5fc2f473ab8240619a0a0f495ba9e9e5d4d9c434b8794a68280236c4" "1EZKahMRfoMiKp1BewjWrQWoaJ9kmC4hum" "relay_acc" "$para_ip"
chain33_applyCoins "$sellAddr" 12000000000 "${para_ip}"
chain33_QueryBalance "${sellAddr}" "$para_ip"
chain33_applyCoins "$accepAddr" 12000000000 "${para_ip}"
chain33_QueryBalance "${accepAddr}" "$para_ip"
fi
block_wait 1
chain33_SendToAddress "$sellAddr" "$relay_addr" 10000000000 "${MAIN_HTTP}"
chain33_QueryExecBalance "${sellAddr}" "relay" "$MAIN_HTTP"
chain33_SendToAddress "$accepAddr" "$relay_addr" 10000000000 "${MAIN_HTTP}"
chain33_QueryExecBalance "${accepAddr}" "relay" "$MAIN_HTTP"
}
function run_testcases() {
......@@ -313,4 +256,4 @@ function rpc_test() {
fi
}
rpc_test "$1"
chain33_debug_function rpc_test "$1"
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