-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added support for back and forth send #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, couple of nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm. @robert-zaremba can you take a final look
for (( b=0; b<$num_msgs; b++)) | ||
do | ||
cat unsignedto.json | jq '.body.messages |= . + [.[-1]]' > unsignedto.json.bk | ||
mv unsignedto.json.bk unsignedto.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just write it to unsignedto.json? Any issues with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not there, added few comments.
@@ -0,0 +1,73 @@ | |||
#/bin/sh | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a documentation to this script. What are the parameters? Also we need a help message.
echo "** Balance of Account 1 after send_load :: **" | ||
balance_query $acc1 | ||
echo "** Balance of Account 2 after send_load :: **" | ||
balance_query $acc2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to print, we want to check that the balance is correct. Please add an assertion to check that the balance didn't change.
cat unsignedto.json | jq '.body.messages |= . + [.[-1]]' > unsignedto.json.bk | ||
mv unsignedto.json.bk unsignedto.json | ||
cat unsignedfrom.json | jq '.body.messages |= . + [.[-1]]' > unsignedfrom.json.bk | ||
mv unsignedfrom.json.bk unsignedfrom.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I feel that some of this operations would be better done in a Go or JS script - for example this one.
unsignedTxto=$("${DAEMON}" tx bank send "${acc1}" "${acc2}" 1000000"${DENOM}" --chain-id "${CHAINID}" --output json --generate-only --gas 500000 > unsignedto.json) | ||
unsignedTxtores=$(echo "${unsignedTxto}") | ||
unsignedTxfrom=$("${DAEMON}" tx bank send "${acc2}" "${acc1}" 1000000"${DENOM}" --chain-id "${CHAINID}" --output json --generate-only --gas 500000 > unsignedfrom.json) | ||
unsignedTxfromres=$(echo "${unsignedTxfrom}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and unsignedTxtores
is not used
seqto=$(expr $seq1no + $a) | ||
signTxto=$("${DAEMON}" tx sign unsignedto.json --from "${acc1}" --chain-id "${CHAINID}" --keyring-backend test --home $DAEMON_HOME-1 --node $RPC --signature-only=false --sequence $seqto --gas 500000 > signedto.json) | ||
signTxtores=$(echo "${signTxto}") | ||
broadcastto=$("${DAEMON}" tx broadcast signedto.json --output json --chain-id "${CHAINID}" --gas 500000 --node $RPC --broadcast-mode async) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this should be run in parallel - &
, same for the "from" tx below.
closing this, we gonna rewrite in python |
Closes #8