Skip to content
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

Closed
wants to merge 22 commits into from

Conversation

kaustubhkapatral
Copy link
Contributor

@kaustubhkapatral kaustubhkapatral commented Jan 12, 2022

Closes #8

@kaustubhkapatral kaustubhkapatral marked this pull request as ready for review January 17, 2022 11:14
Copy link
Collaborator

@anilcse anilcse left a 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

Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Copy link
Collaborator

@anilcse anilcse left a 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
Copy link
Collaborator

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?

Copy link
Collaborator

@robert-zaremba robert-zaremba left a 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

Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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}")
Copy link
Collaborator

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)
Copy link
Collaborator

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.

@anilcse
Copy link
Collaborator

anilcse commented May 31, 2022

closing this, we gonna rewrite in python

@anilcse anilcse closed this May 31, 2022
@anilcse anilcse deleted the kappa/8-load_test branch May 31, 2022 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the send_load_test.sh to send tokens back and forth and check the respective balances at the end.
3 participants