2

From what I can tell this should be possible now:

function test2 () public view returns (Post[]) {
        Post memory post;
        post.sender = msg.sender;
        post.link = "test";
        post.category = "test";
        post.comment = "test";
        post.timestamp = now;

        Post[] storage postsOnPage;
        postsOnPage.push(post);

        return postsOnPage;
    }

Unfortunately I get this error:

Unhandled rejection Error: Invalid solidity type: tuple[]

I'm using web3 version 1. If its not supported any ideas for a workaround?

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.