-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes max fee per gas calculation (#350)
### Description we were missing the fact that base fee or gas price should be multipled by some buffer and that priority fee should be added to these when setting max fee per gas. ### Other changes setup tests with realistic values obtained by making rpc call with cast ### Tested see the tests ### Related issues - Fixes #227 ### Backwards compatibility yes ### Documentation n/a <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on fixing the calculation of `maxFeePerGas` in the `Connection` class, ensuring it includes a buffer based on the `baseFeePerGas`. It also updates tests to reflect the new logic. ### Detailed summary - Updated `maxFeePerGas` calculation to include a buffer. - Introduced `addBufferToBaseFee` function to apply the buffer. - Modified logic to determine `baseFee` based on `feeCurrency`. - Adjusted tests for `setFeeMarketGas` to validate new calculations. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
4 changed files
with
49 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@celo/connect': patch | ||
--- | ||
|
||
Fix calculation of maxFeePerGas. Multiple base Fee by constant for buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters