Commit c09fc0ee authored by lyn's avatar lyn Committed by vipwzw

update linter

parent 098d0214
...@@ -254,26 +254,15 @@ function token_burn() { ...@@ -254,26 +254,15 @@ function token_burn() {
fi fi
signRawTx "${unsignedTx}" "${tokenAddr}" signRawTx "${unsignedTx}" "${tokenAddr}"
if [ $? -ne 0 ]; then echo_rst "token burn signRawTx" "$?"
rst=$?
echo_rst "token burn signRawTx" "$rst"
return
fi
sendSignedTx sendSignedTx
if [ $? -ne 0 ]; then echo_rst "token burn sendSignedTx" "$?"
rst=$?
echo_rst "token burn sendSignedTx" "$rst"
return
fi
block_wait 1 block_wait 1
queryTransaction ".error | not" "true" queryTransaction ".error | not" "true"
if [ $? -ne 0 ]; then echo_rst "token burn queryExecRes" "$?"
rst=$?
echo_rst "token burn queryExecRes" "$rst"
fi
} }
function token_mint() { function token_mint() {
...@@ -284,26 +273,15 @@ function token_mint() { ...@@ -284,26 +273,15 @@ function token_mint() {
fi fi
signRawTx "${unsignedTx}" "${tokenAddr}" signRawTx "${unsignedTx}" "${tokenAddr}"
if [ $? -ne 0 ]; then echo_rst "token mint signRawTx" "$?"
rst=$?
echo_rst "token mint signRawTx" "$rst"
return
fi
sendSignedTx sendSignedTx
if [ $? -ne 0 ]; then echo_rst "token mint sendSignedTx" "$?"
rst=$?
echo_rst "token mint sendSignedTx" "$rst"
return
fi
block_wait 1 block_wait 1
queryTransaction ".error | not" "true" queryTransaction ".error | not" "true"
if [ $? -ne 0 ]; then echo_rst "token mint queryExecRes" "$?"
rst=$?
echo_rst "token mint queryExecRes" "$rst"
fi
} }
function token_transfer() { 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") 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")
...@@ -313,26 +291,15 @@ function token_transfer() { ...@@ -313,26 +291,15 @@ function token_transfer() {
fi fi
signRawTx "${unsignedTx}" "${tokenAddr}" signRawTx "${unsignedTx}" "${tokenAddr}"
if [ $? -ne 0 ]; then echo_rst "token transfer signRawTx" "$?"
rst=$?
echo_rst "token transfer signRawTx" "$rst"
return
fi
sendSignedTx sendSignedTx
if [ $? -ne 0 ]; then echo_rst "token transfer sendSignedTx" "$?"
rst=$?
echo_rst "token transfer sendSignedTx" "$rst"
return
fi
block_wait 1 block_wait 1
queryTransaction ".error | not" "true" queryTransaction ".error | not" "true"
if [ $? -ne 0 ]; then echo_rst "token transfer queryExecRes" "$?"
rst=$?
echo_rst "token transfer queryExecRes" "$rst"
fi
} }
function token_sendExec() { function token_sendExec() {
...@@ -343,28 +310,18 @@ function token_sendExec() { ...@@ -343,28 +310,18 @@ function token_sendExec() {
fi fi
signRawTx "${unsignedTx}" "${tokenAddr}" signRawTx "${unsignedTx}" "${tokenAddr}"
if [ $? -ne 0 ]; then echo_rst "token sendExec signRawTx" "$?"
rst=$?
echo_rst "token sendExec signRawTx" "$rst"
return
fi
sendSignedTx sendSignedTx
if [ $? -ne 0 ]; then echo_rst "token sendExec sendSignedTx" "$?"
rst=$?
echo_rst "token sendExec sendSignedTx" "$rst"
return
fi
block_wait 1 block_wait 1
queryTransaction ".error | not" "true" queryTransaction ".error | not" "true"
if [ $? -ne 0 ]; then echo_rst "token sendExec queryExecRes" "$?"
rst=$?
echo_rst "token sendExec queryExecRes" "$rst"
fi
} }
function token_withdraw() { 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") 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 if [ "${unsignedTx}" == "" ]; then
...@@ -373,26 +330,15 @@ function token_withdraw() { ...@@ -373,26 +330,15 @@ function token_withdraw() {
fi fi
signRawTx "${unsignedTx}" "${tokenAddr}" signRawTx "${unsignedTx}" "${tokenAddr}"
if [ $? -ne 0 ]; then echo_rst "token withdraw signRawTx" "$?"
rst=$?
echo_rst "token withdraw signRawTx" "$rst"
return
fi
sendSignedTx sendSignedTx
if [ $? -ne 0 ]; then echo_rst "token withdraw sendSignedTx" "$?"
rst=$?
echo_rst "token withdraw sendSignedTx" "$rst"
return
fi
block_wait 1 block_wait 1
queryTransaction ".error | not" "true" queryTransaction ".error | not" "true"
if [ $? -ne 0 ]; then echo_rst "token withdraw queryExecRes" "$?"
rst=$?
echo_rst "token withdraw queryExecRes" "$rst"
fi
} }
function run_test() { function run_test() {
...@@ -429,4 +375,4 @@ function main() { ...@@ -429,4 +375,4 @@ function main() {
fi fi
} }
main "$1" main "$1"
\ No newline at end of file
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