Created
November 12, 2017 07:03
-
-
Save dpaluy/4ecfb1d639ffe54d9de1c3317499e487 to your computer and use it in GitHub Desktop.
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 increaseCounter() { | |
var account = web3.eth.accounts[0]; | |
var currentNumber = contract_instance.getMyNumber().toNumber(); | |
currentNumber++; | |
// User dialog goes here | |
web3.personal.unlockAccount(account, 'secretpasswrod'); | |
contract_instance.setMyNumber(currentNumber, {from: account, gas: 200000}, function(error, result) { | |
if (error) { | |
console.error(error); | |
} else { | |
var txHash = result; | |
console.log(txHash); | |
callWhenMined(txHash, getCounter()); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment