Add balance check retries
This commit is contained in:
parent
af1283e92c
commit
102354c218
|
@ -20,11 +20,20 @@ garbage_address=vS3ngn1TfQmpsW1Z4NkLuqNAQFF3dYQw8UZ6TCx9bmq
|
||||||
check_balance_output() {
|
check_balance_output() {
|
||||||
declare expected_output="$1"
|
declare expected_output="$1"
|
||||||
exec 42>&1
|
exec 42>&1
|
||||||
output=$($solana_wallet "${entrypoint[@]}" balance | tee >(cat - >&42))
|
attempts=3
|
||||||
if [[ ! "$output" =~ $expected_output ]]; then
|
while [[ $attempts -gt 0 ]]; do
|
||||||
echo "Balance is incorrect. Expected: $expected_output"
|
output=$($solana_wallet "${entrypoint[@]}" balance | tee >(cat - >&42))
|
||||||
exit 1
|
if [[ "$output" =~ $expected_output ]]; then
|
||||||
fi
|
break
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
(( attempts=attempts-1 ))
|
||||||
|
if [[ $attempts -eq 0 ]]; then
|
||||||
|
echo "Balance is incorrect. Expected: $expected_output"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
pay_and_confirm() {
|
pay_and_confirm() {
|
||||||
|
|
Loading…
Reference in New Issue