Reputation: 33
Im trying to return an sample object from a contract but the data is always blank. Im using the BlockApps WebApi to do the work (http://blockapps.net/documentation). It always just returns a comma seperated string thats blank. Any help?
contract TrackingManager {
Hit[] hits;
function createHit(string _url, string _referrer) {
hits.push(new Hit(_url, _referrer));
}
function getHits() returns (Hit[]) {
return hits;
}
}
contract Hit {
string public url;
string public referrer;
function Hit(string _url, string _referrer) {
url = _url;
referrer = _referrer;
}
}
Upvotes: 1
Views: 4575
Reputation: 859
I may be wrong, but I think it's not possible to return struct arrays yet: http://solidity.readthedocs.io/en/develop/frequently-asked-questions.html and https://github.com/ethereum/cpp-ethereum/issues/1788
Upvotes: 3