I have a rather computationally expensive view
function on my smart contract, which works with no problem on rinkeby
(calling it from etherscan).
However, deploying the contract into a local chain (on ganache) and calling the function from a truffle test file, I get an out of gas
error. Namely:
Error: Returned error: VM Exception while processing transaction: out of gas
Here is the code I'm using for the test:
const { assert } = require("chai")
require("chai").use(require("chai-as-promised")).should()
const MyContract = artifacts.require("./MyContract.sol");
contract("MyContract", function () {
let contract
before(async () => { contract = await MyContract.deployed() })
describe('main stuffs', () => {
it('returns SVG', async () => {
const svg = await contract.getTOKEN(1654673700);
})
})
})
Is there a way to solve this issue?
I really would like to have a setup where I can test my smart contracts (even computationally expensive ones) without having to deploy to rinkeby
and manually call the functions.