请教下, GAS 中的 Gas Used By Txn 怎么获取?

2018-04-18 19:47:55 +08:00
 d284476422

通过 ethGetTransactionByHash 方法查询出订单,获取到了 Gas Limit 和 gasPrice,但是 Gas Used By Txn 怎么获取,需要 Gas Used By Txn * gasPrice。 下面是返回的数据,删除了 hash。

{ "gasRaw": "0x927c0", "blockHash": "0x7a344994dbc25f6d17d6974522b650937e6f4c2d0eae1785f5e93a67565e611e", "transactionIndexRaw": "0x3", "valueRaw": "0x2c68af0bb140000", "raw": "0xf86b08830186a0830927c0942a23e12acef43b964857b66cde6de2d674601e7b8802c68af0bb140000801ba00c7cae6b2f6848a78ff6da9e295873b4891e04345e0b67fe4c48e4a41e1992d5a035a64c7e6c776d3f0aaf986eac73e50b5f310b7a3e7c8d799add877064a03d32", "transactionIndex": 3, "publicKey": "0xdee62c1c569dc6eec06a59e3b34c7e1f03712d83c42717a717e6d7bd39ac06e07234b89cb973387311eeb0666a60d35cba957932bbd4d17644e9212effa5ff09", "nonce": 8, "gasPriceRaw": "0x186a0", "input": "0x", "r": "0xc7cae6b2f6848a78ff6da9e295873b4891e04345e0b67fe4c48e4a41e1992d5", "blockNumberRaw": "0x696f5f", "s": "0x35a64c7e6c776d3f0aaf986eac73e50b5f310b7a3e7c8d799add877064a03d32", "nonceRaw": "0x8", "v": 27, "blockNumber": 6909791, "gas": 600000, "from": "0xad8bd961e9792fa7deeef7dd623db5f54b24efdd", "to": "0x2a23e12acef43b964857b66cde6de2d674601e7b", "value": 200000000000000000, "gasPrice": 100000 }

2186 次点击
所在节点    程序员
2 条回复
d284476422
2018-04-18 19:48:40 +08:00
有木有大神,来回答下
aptx4689
2018-04-19 10:04:27 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/447929

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX