I would like to add the keys and unlock some additional addresses at runtime for my truffle tests.
Why? I have the need to create address from a seed generated elsewhere in my test so the private keys don't exist until part of the test has run.
I'm hoping to do something like this:
EthereumBip44 = require('ethereum-bip44')
# create the hd wallet
wallet = EthereumBip44.fromPrivateSeed(tree.keccak);
confirms = [
wallet.getAddress(0)
wallet.getAddress(1)
wallet.getAddress(2)
wallet.getAddress(3)
wallet.getAddress(4)
]
And then later I'll need to send some transactions from these accounts. How can I add them so that I can call one of my truffle functions from them?
contractCompiledWithTruffle.myFunction('dosomething', from: confirms[1])
ganache-cli
documentation. It has parameter--account
to create an account with a predefined private key and the parameter--unlock
to unlock an account. – Ismael Jan 25 '18 at 16:55