I have a question for you guys. I have 2 contracts:
contract House {
uint public idHouse;
...
}
contract ArrayHouse {
House[] public arrayHouse;
function getHouse(uint n) returns(House){
if (n >= arrayHouse.length)
throw;
return arrayHouse[n];
}
}
I compiled and migrated the contract ArrayHouse to the testrpc reseau. Then, I went to truffle console and tried the following javascript:
arrayHouse=ArrayHouse.new(...);
arrayHouse.then(function(inst1){meta=inst1;return meta.getHouse(0)}).then(function(inst2){return inst2.idHouse.call();})
I got the following error:
TypeError: Cannot read property 'call' of undefined
at evalmachine.<anonymous>:1:84
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
I wonder why I cannot access to the an attribute(public idHouse) of an element(House) of my array(arrayHouse). Anyone has an idea?