I am using embark to deploy my contracts.What I need is to call a contract function from a different account rather than account[0] generated by testrpc. i.e. msg.sender should contain the address of account[1] or account[2] or account[n] where n is less than the number of accounts generated. There should be a way to do so for manual testing purposes in embark console right?
1 Answer
This should work:
MyContract.MyMethod({ from: accounts[1] });
Assuming you already have your accounts array:
var accounts = web3.eth.accounts;
MyContract.MyMethod.call({from: accounts[1]});
? Assuming you already have youraccounts
array.