I am setting up unit tests with for my contracts using truffle. I am using also testrpc, but having accounts with 2.123...... *10^37
Wei is not very helpful to visualise and debug things.
I am trying to setup custom testRPC account balances using $ testrpc --account="<privatekey>,balance"
as seen here. However, what I get back is one account with again "infinite ether".
I have also tried to do :
var TestRPC = require("ethereumjs-testrpc");
var accountConfig = [
{balance: 20000000},
{balance: 20000000}
];
web3.setProvider(TestRPC.provider({accounts: accountConfig}));
as seen here and here , however truffle complains it cannot find the module "ethereumjs-testrpc"
.
In short the question then is : how to set up custom account balances for testRPC?
Best Answer
From the documentation, you can explicity specify a new account address and balance using the following syntax:
I'd suggest running
testrpc
without the--account
option to get the randomly generated list of addresses, making a note of them, and then using them in conjunction with whatever balances you want them to have (by passing them to--account
).