I have a test that exercises a contract function across different accounts. How do I unlock these accounts in the context of the test?
contract('MyContract', function (accounts) {
it("should perform differently for different accounts", function (done) {
var thisContract = MyContract.deployed();
thisContract.addAccounts([accounts[1], accounts[2]], {from: accounts[0]} ).then(
function (tx_id) {
/* this works because I manual unlock acc 0 on geth */
return thisContract.doSomething({from: accounts[0]});
}).then(
function (tx_id) {
/* is there something here I can do to unlock acc 1? */
return thisContract.doSomething({from: accounts[1]});
}).then(
function (tx_id) {
/* then here... */
return thisContract.doSomething({from: accounts[2]};
done();
}
).catch(done);
});
});