0

I am writing truffle tests for a smartcontract.

I have create a truffle project with this command:

truffle unbox react

I have kept SimpleStorage.sol sample smartcontract. I have add some tests in tests/simplestorage.js file.

What i want to do is to test the set's Simplestorage smartcontract function with a gas limit. I want to test what happens if gas limit is to low for this function.

Here is what i've tried:

await simpleStorageInstance.set(89, { from: accounts[0], gasLimit: 100 });
await simpleStorageInstance.set(89, { from: accounts[0], gas_limit: 100 });
await simpleStorageInstance.set(89, { from: accounts[0], limit_gas: 100 });

But it has no effect.

Any idea ?

Thanks

1
  • 1
    Did you try gas? Start with a higher number like 5M gas, 100 is just too small. – Ismael Jan 31 at 20:04

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.