Skip to content

Instantly share code, notes, and snippets.

@LefterisJP
Created March 24, 2016 15:06
Show Gist options
  • Save LefterisJP/ad7b0769b7078c7e60df to your computer and use it in GitHub Desktop.
Save LefterisJP/ad7b0769b7078c7e60df to your computer and use it in GitHub Desktop.
Once funding fails, ask for a refund
// since funding failed let's get a refund
var eth_balance_before_refund = [];
for (i = 0; i < eth.accounts.length; i++) {
eth_balance_before_refund.push(web3.fromWei(eth.getBalance(eth.accounts[i])));
}
addToTest('eth_balance_before_refund', eth_balance_before_refund);
for (i = 0; i < eth.accounts.length; i++) {
dao.refund.sendTransaction({
from:eth.accounts[i],
gas:200000
});
}
checkWork();
// try to ask for a refund again and see if we get more (we shouldn't)
for (i = 0; i < eth.accounts.length; i++) {
dao.refund.sendTransaction({
from:eth.accounts[i],
gas:200000
});
}
checkWork();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment