Commit b1b2c9f7 authored by liuyuhang's avatar liuyuhang

add autonomy rpc test

parent 1a47e08d
......@@ -2,6 +2,7 @@
RAW_TX_HASH=""
LAST_BLOCK_HASH=""
LAST_BLOCK_HEIGHT=0
CASE_ERR=""
RETURN_RESP=""
......@@ -191,6 +192,13 @@ chain33_LastBlockhash() {
echo -e "######\\n last blockhash is $LAST_BLOCK_HASH \\n######"
}
chain33_LastBlockHeight() {
local MAIN_HTTP=$1
result=$(curl -ksd '{"method":"Chain33.GetLastHeader","params":[{}]}' -H 'content-type:text/plain;' "${MAIN_HTTP}" | jq -r ".result.height")
LAST_BLOCK_HEIGHT=$result
echo -e "######\\n last blockheight is $LAST_BLOCK_HEIGHT \\n######"
}
chain33_applyCoins() {
echo "chain33_getMainChainCoins"
if [ "$#" -lt 3 ]; then
......
......@@ -112,6 +112,9 @@ function base_init() {
#relay genesis
sed -i $sedfix 's/^genesis="12qyocayNF7.*/genesis="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"/g' chain33.toml
#autonomy
sed -i $sedfix 's/^useBalance=.*/useBalance=true/g' chain33.toml
sed -i $sedfix 's/^total="16htvcBNS.*/total="1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx"/g' chain33.toml
}
function start() {
......@@ -425,6 +428,15 @@ function dapp_test_address() {
# block_wait "${1}" 1
tx_wait "${1}" "${hash}"
#autonomy allocation for rpc test 1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx
result=$(${1} account import_key -k 1c3e6cac2f887e1ab9180e2d5772dc4ba01accb8d4df434faba097003eb35482 -l autonomytest | jq ".label")
echo "${result}"
if [ -z "${result}" ]; then
exit 1
fi
hash=$(${1} send coins transfer -a 6300 -n transfer -t 1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
}
function base_config() {
......@@ -480,4 +492,4 @@ function main() {
}
# run script
main
main
\ No newline at end of file
This diff is collapsed.
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