Two questions, related:
- Is the
getGasUsed()
on the TransactionReceipt truly the actual gas used, not thegasLimit
or the gas estimate? Looks like it but... - Is the actual gas used obtainable ("readable") outside of the TransactionReceipt? Can you use the tx hash or other material to after-the-fact determine the actual gas used?
EDIT: Just came across this in the test drivers for web3j:
EthGetTransactionReceipt etxr = web3j.ethGetTransactionReceipt(txhash).send();
assertTrue(ethGetTransactionReceipt.getTransactionReceipt().isPresent());
TransactionReceipt TXr = etxr.getTransactionReceipt().get();
I tried it and it works. After the fact (like in a Filter or Flowable), when I get the TXhash, I can get the TXreceipt and thus the actual gas used.
Why isn't this more easily discoverable?