Closed zackisaacs closed 1 year ago
Thanks for reporting, this is a bit unclean. There is really no point in setting the gas limit per client because each transaction will be different. I'll take a look at the code/documentation.
Meanwhile, just use the gas_limit
argument for each transact
call.
I'm using this gem in my project to create tokens, sign transactions, etc. It's been super helpful -- thank you!
I was struggling to understand why the
:gas_limit
attr_accessor I set after creating a new Eth::Client wasn't being respected, i.e.I would submit transactions, they'd fail, I'd view them on polygonscan, and then see that the gas limit used for the transaction was 51000, which was much lower than the gas_limit attr_accessor I'd just set. I realize now this is because
transact_and_wait
and the underlyingtransact
methods look for a gas_limit kwarg and fall back toTx.estimate_intrinsic_gas(contract.bin) + Tx::CREATE_GAS
instead of using the gas_limit attr_accessor.Assuming this is the interface you want to keep, as opposed to making transactions respect the attr_accessor, I might suggest noting this behavior in the method docs and wiki. If you agree this would be useful, I'd be happy to submit a PR to this end.