Closed ArinCantCode closed 3 years ago
Hello Arin
Is the error coming from the executor code? it is not clear from your question of there is one error or many and what part of the system is generating the error.
As per your text, I am assuming that the estimageGas function is not working. This may be due to your web3 provider. If your environment does not allow estimating gas, then you will need to modify the code and set the gas manually.
The best test will be to run this in a public network and use (for instance) infura as your web3 provider.
Hope this helps
Thanks for response,
Is the error coming from the executor code? it is not clear from your question of there is one error or many and what part of the system is generating the error.
There is one error that i specified in the post, it happens when calling the ScheduleCall
. I have tried to call this function in different ways, one was directly through my tests as noted above:
await aion.ScheduleCall(1622637898, "0x9D97Acc768B9c485D425a92c34977B63A26cC5C8", 0, 200000,1e9, "0x", true)
As this doesn't work i also tried to do it like in the example from the README you guys provide, and that is the await scheduler.scheduleMyfucntion()
where scheduler is my contract that uses Aion contract to call ScheduleCall
.
Both ways give me the same error, when calling ScheduleCall
.
As per your text, I am assuming that the estimageGas function is not working
I'm not an expert with blockchain in general, what makes you think this is the case? When i googled this part of the error:
UNPREDICTABLE_GAS_LIMIT
people mention it's more likely due to contract issues as the error also states this:
VM Exception while processing transaction: revert
EDIT:
I think i have found the boogeyman, this line in the Aion contract is causing the issue:
require(msg.value == value.add(gaslimit.mul(gasprice)).add(serviceFee));
Issue solved i didn't realize i need to send ether to my contract in order to send it later to the aion contract...
Thanks for your time 👍
Hi i'm trying to run aion locally for testing my contract.
I'm deploying the Aion contract to network i run with ganache-cli, which ends up being a success. Then i run mongodb and executor in separate terminal after setting all the environment variables.
I'm trying to now test whether everything works as expected but when i try to make a
ScheduleCall
call i get:I can call
serviceFee
successfully which returns me:500000000000000
I have tried both calling the
ScheduleCall
from within my test contract that looks like this:and simply using ethers js in my test:
here is my test: