Skip to content

Instantly share code, notes, and snippets.

@aalavandhan
Created April 11, 2018 21:36
Show Gist options
  • Save aalavandhan/5fd05bfd1c1094863ef24d60d82d5348 to your computer and use it in GitHub Desktop.
Save aalavandhan/5fd05bfd1c1094863ef24d60d82d5348 to your computer and use it in GitHub Desktop.
Ethereum Web3 helper functions
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