gasPrice miscalulation when using celo feeCurrency #914
Replies: 2 comments 5 replies
-
Yep! We are planning to add |
Beta Was this translation helpful? Give feedback.
-
@jxom , Im finally working on special case for celo of getting the feePerGas when fee is paid in celo feecurrency. Ideally id like to only use a custom estimateFeePerGas when its needed and otherwise just use the default estimateFeePerGas however since that will call the chain.fees.estimateFeePerGas if it exists ive ran into infinite loop. My thought right now is to add an additional param to skip the chain fee estimator |
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Package Version
all
Current Behavior
currently when sending tx that sets feeCurrency the price of gas is set using the chains native token (CELO) based on block headers.
this kinda works if CELO is worth less than the feeCurrency (as is the case now) but if fee 1 unit of fee currency is worth more than 1 unit of CELO it will fail)
Expected Behavior
when the
tx
hasfeeCurrency
set then need to settx.maxFeePerGas
toclient.request({method: 'eth_gasPrice', params [tx.feeCurrency]}
inprepareRequest
Steps To Reproduce
send a tx on a celo chain with
feeCurrency
set.Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
This is on me for not considering this sooner.
my current implementation thought is to have a chain specific preparer that gets called towards the top of
prepareRequest
something like
new function in chains/celo
Beta Was this translation helpful? Give feedback.
All reactions