terra/tools: restore broadcast waiting fix

This commit is contained in:
Evan Gray 2022-11-30 13:44:45 -05:00 committed by Evan Gray
parent bca681cddb
commit b0c65265aa
1 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,13 @@ function sleep(ms) {
}
async function broadcastAndWait(terra, tx) {
return await terra.tx.broadcast(tx);
const response = await terra.tx.broadcast(tx);
let currentHeight = (await terra.tendermint.blockInfo()).block.header.height;
while (currentHeight <= response.height) {
await sleep(100);
currentHeight = (await terra.tendermint.blockInfo()).block.header.height;
}
return response;
}
/*