Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas estimation failures because of chainId mismatch #350

Open
viswanathkgp12 opened this issue Jan 14, 2021 · 0 comments
Open

Gas estimation failures because of chainId mismatch #350

viswanathkgp12 opened this issue Jan 14, 2021 · 0 comments
Assignees

Comments

@viswanathkgp12
Copy link

viswanathkgp12 commented Jan 14, 2021

I am trying to use conseiljs for gas estimations of a contract invocation transaction. More specifically, the contract involved has some kind of chain_id related check and gas estimation always fails with ConseilJS testContractInvocation.

When I inspected the problem, I found that conseiljs always tries to set the fake_chain_id during runOperation RPC call. Whereas, the contract expects the chain_id to be that of the corr. network it is deployed on (delphinet or mainnet). This is probably why I am always getting a scipt_rejected_error, when it should not have been the case.

Override with fake_chain_id is supposedly here:

const response = await performPostRequest(server, `chains/${chainid}/blocks/head/helpers/scripts/run_operation`, { chain_id: fake_chainid, operation: { branch: fake_branch, contents: operations, signature: fake_signature } });

If needed, I can share more details on the smartpy, JS code here.

@viswanathkgp12 viswanathkgp12 changed the title Gas estimation failures Gas estimation failures because of chainId mismatch Jan 14, 2021
@anonymoussprocket anonymoussprocket self-assigned this Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants