oasislabs / oasis.js

🕸A web client for the Oasis platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve consistency of deploy vs call opts

nhynes opened this issue · comments

e.g.

myService.deploy({ options: { gasLimit: <int> }})
myService.a_func({ gas: <hex string> })

Ideally these would be the same

They are the same. Have you tried passing gasLimit to both cases?

See

export type RpcOptions = {
.

If gas works for you, it's probably the case that either a) we're estimating gas and filling in the gasLimit field (

promises.push(this.estimateGas(tx));
) or b) the ethers.js wallet we use to construct the raw transaction accepts gas as a valid option.

Note that we indeed use gasLimit for rpc methods here: https://github.com/oasislabs/e2e-tests/blob/master/test/8_test_oasis_client.js#L76, so this works as expected.

Please re-open if you've tried gasLimit for rpc methods and it fails.

I think the issue is that it's inside of { options: ... } for deploy and I expected the same to be true. Do you think it's worthwhile to make the same to be true? It's surprising that the invocations are different.