Closed wupeaking closed 5 years ago
You missed intrinsic gas, check the doc here, intrinsic gas should be calculated locally
漏掉了固有gas, 接口只返回了VM执行的gas
哦 那请问一下dataGas是什么呢?@libotony
dataGas 是指对交易中 data 字段所收取的gas也是固有gas的一部分,这个在thor-devkit中有相应的代码实现可供参考
https://github.com/vechain/thor-devkit.js/blob/master/src/transaction.ts#L127-L161
tks! 我明白了。
@wupeaking hi, 请问 gasUsed='13326' 这一部分gas 是怎么计算的出来的啊?
@zl03jsj 节点API的返回值
@zl03jsj 节点API的返回值
谢谢大神回复, 能告诉一下哪个API吗, 是web3.eth.estimategas这个吗?
POST /accounts/*
POST /accounts/*
我看看去, 谢谢大神. 果然有这个, 我太不细心了, thanks a lot. :to simulate contract deployment without sending transaction to block chain.
It's useful to estimate gas usage and contract deployment result of a clause.
TIPS: data in request body is the bytecodes of a contract data in response body is the runtime bytecodes assigned to account which the contract to be deployed
I use the api
/accounts/*
to calc the gas usage, it seems to be incorrect .it returns the
gasUsed
is 13326 .but ,The actual gas usage is 36518。 the link
Is it wrong with me?
我想用API
/accounts/*
来提前模拟实际的gas使用量, 但是不知道为什么这个返回的gasUsed好像和实际的用量差别比较大。