diff --git a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh index 0f634cfe451..be93b0b2952 100755 --- a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh +++ b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh @@ -107,9 +107,12 @@ currentBalance=$(getAddressBalance "$stakeAddr") echo "Funding stake addresses with ${AMOUNT_PER_DELEGATOR}" for NODE_ID in ${SP_NODES_ID}; do + sourceAddr="$(cat "${UTXO_DIR}/utxo${NODE_ID}.addr")" + currentBalance=$(getAddressBalance "$sourceAddr") + cardano-cli latest transaction build \ --testnet-magic $NETWORK_MAGIC \ - --tx-in "$(cardano-cli query utxo --address "$(cat "${UTXO_DIR}/utxo${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ + --tx-in "$(cardano-cli query utxo --address "$sourceAddr" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ --tx-out "$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)+${AMOUNT_PER_DELEGATOR}" \ --change-address "$(cat ${UTXO_DIR}/utxo${NODE_ID}.addr)" \ --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" @@ -122,13 +125,14 @@ for NODE_ID in ${SP_NODES_ID}; do cardano-cli latest transaction submit \ --testnet-magic $NETWORK_MAGIC \ --tx-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" -done -updatedBalance=$(getAddressBalance "$stakeAddr") + updatedBalance=$(getAddressBalance "$sourceAddr") -while [ "$currentBalance" -eq "$updatedBalance" ]; do - updatedBalance=$(getAddressBalance "$stakeAddr") - sleep 1 + while [ "$currentBalance" -eq "$updatedBalance" ]; do + echo "==== Waiting for funding ===" + updatedBalance=$(getAddressBalance "$sourceAddr") + sleep 1 + done done sleep 10