1

I'm trying to test a contract getter method that returns a large array. I am using Remix and deploying using JavaScript VM. My contract deploys alright, but trying to call the getArray() method causes Remix to freeze and show a timeout page.

pragma solidity ^0.4.24;    
contract myContract{
        bytes32[7500] public array;
        function getArray() public view returns(bytes32[7500]){
            return array;
        }
}

I also have a similar problem when testing the web3 library in Mocha with ganache-cli provider.

However, When I deploy using Injected Web3 to Rinkeby, Remix returns the large array just fine. Is this timeout some sort of limitation of the JS VM? 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.