Skip to content

Gas estimation failures because of chainId mismatch #350

@viswanathkgp12

Description

@viswanathkgp12

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions