I'm consulting truffle's docs on how to test contracts directly in solidity.
http://truffleframework.com/docs/getting_started/solidity-tests
I'd like to figure out a way to refer to existing testrpc accounts in my tests. Something like:
pragma solidity ^0.4.11;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/BAToken.sol";
contract TestBAToken {
function testNewBATokenNotFinalized() {
address companyFundAddress = addresses[1]; // <-- I'd like this to be a predefined testrpc account
address userFundAddress = addresses[2];
uint256 startBlock = block.number - 100;
uint256 endBlock = block.number + 100;
BAToken ba = new BAToken(companyFundAddress, userFundAddress, startBlock, endBlock);
Assert.equal(ba.isFinalized, false, "Token sale shouldn't be finalized upon initialization.");
}
}
Is this possible? If not, anyone have any good recommendations for how to refer to existing accounts during testing?