我正在尝试从合同中返回样本对象,但数据始终为空。我正在使用BlockApps WebApi来完成工作(http://blockapps.net/documentation)。它总是返回一个逗号分隔的字符串,该字符串为空。有什么帮助吗?
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;
}
}发布于 2016-12-23 00:05:09
我可能错了,但我认为现在还不可能返回结构数组:http://solidity.readthedocs.io/en/develop/frequently-asked-questions.html和https://github.com/ethereum/cpp-ethereum/issues/1788
https://stackoverflow.com/questions/40832282
复制相似问题