Created
April 10, 2018 08:47
-
-
Save gasolin/d2626c552e0cd02f04bd38aee978d0b4 to your computer and use it in GitHub Desktop.
script to Wait till got the transaction result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://medium.com/metamask/calling-a-smart-contract-with-a-button-d278b1e76705 | |
async function waitForTxToBeMined (txHash) { | |
let txReceipt | |
while (!txReceipt) { | |
try { | |
txReceipt = await eth.getTransactionReceipt(txHash) | |
} catch (err) { | |
return indicateFailure(err) | |
} | |
} | |
indicateSuccess() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment