diff --git a/cli/demo_sidechain.sh b/cli/demo_sidechain.sh index dd3cae137..160d41b4e 100755 --- a/cli/demo_sidechain.sh +++ b/cli/demo_sidechain.sh @@ -104,21 +104,21 @@ ICGACCOUNTBOB=//BobIncognito echo " Bob's incognito account = ${ICGACCOUNTBOB}" echo "" -echo "* Shield ${INITIALFUNDS} tokens to Alice's account on L2" -${CLIENT} transfer //Alice ${VAULT} ${INITIALFUNDS} +echo "* Shield ${INITIALFUNDS} tokens to Charlie's account on L2" +${CLIENT} transfer //Charlie ${VAULT} ${INITIALFUNDS} echo "" echo "* Waiting 30 seconds" sleep 30 echo "" -echo "Get balance of Alice's incognito account (on worker 1)" -${CLIENTWORKER1} trusted --mrenclave ${MRENCLAVE} balance //Alice +echo "Get balance of Charlie's incognito account (on worker 1)" +${CLIENTWORKER1} trusted --mrenclave ${MRENCLAVE} balance //Charlie echo "" -# Send funds from Alice to Bobs account, on worker 1. -echo "* First transfer: Send ${AMOUNTTRANSFER} funds from Alice's incognito account to Bob's incognito account (on worker 1)" -$CLIENTWORKER1 trusted --mrenclave ${MRENCLAVE} --direct transfer //Alice ${ICGACCOUNTBOB} ${AMOUNTTRANSFER} +# Send funds from Charlie to Bobs account, on worker 1. +echo "* First transfer: Send ${AMOUNTTRANSFER} funds from Charlie's incognito account to Bob's incognito account (on worker 1)" +$CLIENTWORKER1 trusted --mrenclave ${MRENCLAVE} --direct transfer //Charlie ${ICGACCOUNTBOB} ${AMOUNTTRANSFER} echo "" # Prevent nonce clash when sending direct trusted calls to different workers. @@ -126,9 +126,9 @@ echo "* Waiting 2 seconds" sleep 2 echo "" -# Send funds from Alice to Bobs account, on worker 2. -echo "* Second transfer: Send ${AMOUNTTRANSFER} funds from Alice's incognito account to Bob's incognito account (on worker 2)" -$CLIENTWORKER2 trusted --mrenclave ${MRENCLAVE} --direct transfer //Alice ${ICGACCOUNTBOB} ${AMOUNTTRANSFER} +# Send funds from Charlie to Bobs account, on worker 2. +echo "* Second transfer: Send ${AMOUNTTRANSFER} funds from Charlie's incognito account to Bob's incognito account (on worker 2)" +$CLIENTWORKER2 trusted --mrenclave ${MRENCLAVE} --direct transfer //Charlie ${ICGACCOUNTBOB} ${AMOUNTTRANSFER} echo "" # Prevent getter being executed too early and returning an outdated result, before the transfer was made. @@ -136,9 +136,9 @@ echo "* Waiting 2 seconds" sleep 2 echo "" -echo "* Get balance of Alice's incognito account (on worker 1)" -ALICE_BALANCE=$(${CLIENTWORKER1} trusted --mrenclave ${MRENCLAVE} balance //Alice | xargs) -echo "$ALICE_BALANCE" +echo "* Get balance of Charlie's incognito account (on worker 1)" +CHARLIE_BALANCE=$(${CLIENTWORKER1} trusted --mrenclave ${MRENCLAVE} balance //Charlie | xargs) +echo "$CHARLIE_BALANCE" echo "" echo "* Get balance of Bob's incognito account (on worker 2)" @@ -146,15 +146,15 @@ BOB_BALANCE=$(${CLIENTWORKER2} trusted --mrenclave ${MRENCLAVE} balance ${ICGACC echo "$BOB_BALANCE" echo "" -ALICE_EXPECTED_BALANCE=$(( 1 * UNIT )) +CHARLIE_EXPECTED_BALANCE=$(( 1 * UNIT )) BOB_EXPECTED_BALANCE=$(( 4 * UNIT )) -echo "* Verifying Alice's balance" -if (( ALICE_BALANCE >= ALICE_EXPECTED_BALANCE ? ALICE_BALANCE - ALICE_EXPECTED_BALANCE > FEE_TOLERANCE : ALICE_EXPECTED_BALANCE - ALICE_BALANCE > FEE_TOLERANCE)); then - echo "Alice's balance is wrong (expected: $ALICE_EXPECTED_BALANCE, actual: $ALICE_BALANCE), tolerance = $FEE_TOLERANCE" +echo "* Verifying Charlie's balance" +if (( CHARLIE_BALANCE >= CHARLIE_EXPECTED_BALANCE ? CHARLIE_BALANCE - CHARLIE_EXPECTED_BALANCE > FEE_TOLERANCE : CHARLIE_EXPECTED_BALANCE - CHARLIE_BALANCE > FEE_TOLERANCE)); then + echo "Charlie's balance is wrong (expected: $CHARLIE_EXPECTED_BALANCE, actual: $CHARLIE_BALANCE), tolerance = $FEE_TOLERANCE" exit 1 else - echo "Alice's balance is correct ($ALICE_BALANCE)" + echo "Charlie's balance is correct ($CHARLIE_BALANCE)" fi echo ""