0

I am having a mapping like

 struct Invoice {
    uint256 unitPrice;
    uint256 totalCost;
    uint256 discount;
    uint256 CostAfterDiscount;
    bool isConfirmedByBuyer;
}
mapping(bytes32 => Invoice) public invoices;

I am calling it like

await instance.methods.invoices(orderId).call()

where orderId = bytes32.

It works on Remix but it doesn't work on geth. When I call the function it says

Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. at ABICoder.decodeParameters (node_modules/web3-eth-abi/src/index.js:239:15) at Contract._decodeMethodReturn (node_modules/web3-eth-contract/src/index.js:557:22) at Method.outputFormatter (node_modules/web3-eth-contract/src/index.js:910:46) at Method.formatOutput (node_modules/web3-core-method/src/index.js:167:54) at sendTxCallback (node_modules/web3-core-method/src/index.js:596:33) at /Users/asifbhat/Accepire-BT/contracts.accepireBT/node_modules/web3-core-requestmanager/src/index.js:147:9 at XMLHttpRequest.request.onreadystatechange (node_modules/web3-providers-http/src/index.js:110:13) at XMLHttpRequestEventTarget.dispatchEvent (node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13) at XMLHttpRequest._setReadyState (node_modules/xhr2-cookies/xml-http-request.ts:219:8) at XMLHttpRequest._onHttpResponseEnd (node_modules/xhr2-cookies/xml-http-request.ts:345:8) at IncomingMessage. (node_modules/xhr2-cookies/xml-http-request.ts:311:39) at endReadableNT (_stream_readable.js:1187:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

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.