Created
April 11, 2018 21:36
-
-
Save aalavandhan/5fd05bfd1c1094863ef24d60d82d5348 to your computer and use it in GitHub Desktop.
Ethereum Web3 helper functions
This file contains hidden or 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
function $waitForOneBlock(){ | |
const id = Date.now(); | |
return new Promise((resolve, reject) => { | |
web3Instance.currentProvider.send({ | |
jsonrpc: "2.0", | |
method: "evm_mine", | |
params: [], "id": id, | |
}, function(e,r){ | |
if(e) reject(e); | |
resolve(r); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment