1

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;
    }
}

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.