I have a Contract Factory and a sub contract, and now i want to test the newly created sub contract. This one should be pretty simple, I hope.
it("test CoinNewCoin - Test Created Coin ", function (){
var fromOwner = accounts[0];
var coinFactory;
var coinNewCoin;
return CoinFactory.deployed().then((instance) => {
coinFactory = instance;
}).then(() => {
return coinFactory.getCoinAddress(fromOwner, {from: fromOwner});
}).then((result) => {
console.log(result);
return CoinNewCoin.at(result).then((instance) => {
}).then((instance) => {
console.log(instance); // this is the undefined.
coinNewCoin = instance;
return coinNewCoin.getAuthorizationKey();
})
}).then((result) => {
console.log(result);
});
});
edit: scripting updated.
coinFactory.address
on web3 v0.x, andcoinFactory._address
on web3 v1.x.NewCoin.deployed()
toNewCoin.at(result)
.