-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(suite): allow lower gas prices for eth networks #16066
Merged
+252
−93
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9e244ae
fix(connect): ethereum decimal places
adderpositive 7cc0685
chore(connect): ethereum definitions
adderpositive 6dfc0f1
chore(suite): update feeInfo
adderpositive 43594f7
feat(connect): allow different fees per EVM chain
adderpositive dcc62ac
feat(suite): use min fee for bump evm chain fee
tomasklim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
90 changes: 90 additions & 0 deletions
90
packages/connect/src/data/__tests__/defaultFeeLevels.test.ts
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,90 @@ | ||
import { getEthereumFeeLevels } from '../defaultFeeLevels'; | ||
|
||
describe('getEthereumFeeLevels', () => { | ||
const fixtures = { | ||
eth: { | ||
defaultGas: 15, | ||
minFee: 1, | ||
maxFee: 10000, | ||
expected: { | ||
blockTime: -1, | ||
defaultFees: [ | ||
{ | ||
label: 'normal', | ||
feePerUnit: '15000000000', // 15 Gwei * 1e9 = 15000000000 Wei | ||
feeLimit: '21000', | ||
blocks: -1, | ||
}, | ||
], | ||
minFee: 1, | ||
maxFee: 10000, | ||
dustLimit: -1, | ||
}, | ||
}, | ||
pol: { | ||
defaultGas: 200, | ||
minFee: 1, | ||
maxFee: 10000000, | ||
expected: { | ||
blockTime: -1, | ||
defaultFees: [ | ||
{ | ||
label: 'normal', | ||
feePerUnit: '200000000000', // 200 Gwei * 1e9 = 200000000000 Wei | ||
feeLimit: '21000', | ||
blocks: -1, | ||
}, | ||
], | ||
minFee: 1, | ||
maxFee: 10000000, | ||
dustLimit: -1, | ||
}, | ||
}, | ||
base: { | ||
defaultGas: 0.01, | ||
minFee: 0.000000001, | ||
maxFee: 100, | ||
expected: { | ||
blockTime: -1, | ||
defaultFees: [ | ||
{ | ||
label: 'normal', | ||
feePerUnit: '10000000', // 0.01 Gwei * 1e9 = 10000000 Wei | ||
feeLimit: '21000', | ||
blocks: -1, | ||
}, | ||
], | ||
minFee: 0.0000001, | ||
maxFee: 1000, | ||
dustLimit: -1, | ||
}, | ||
}, | ||
unknown: { | ||
defaultGas: 5, | ||
minFee: 0.000000001, | ||
maxFee: 10000, | ||
expected: { | ||
blockTime: -1, | ||
defaultFees: [ | ||
{ | ||
label: 'normal', | ||
feePerUnit: '5000000000', // 5 Gwei * 1e9 = 5000000000 Wei | ||
feeLimit: '21000', | ||
blocks: -1, | ||
}, | ||
], | ||
minFee: 0.000000001, | ||
maxFee: 10000, | ||
dustLimit: -1, | ||
}, | ||
}, | ||
}; | ||
|
||
Object.entries(fixtures).forEach(([chain, { expected }]) => { | ||
it(`should return correct fee levels for ${chain}`, () => { | ||
const result = getEthereumFeeLevels(chain); | ||
|
||
expect(result).toEqual(expected); | ||
}); | ||
}); | ||
}); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on line 139, comment does not match anymore. nitpick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I don't like the
EthereumNetworkInfoDefinition
type name. This utility is calledethereumNetworkInfoFromDefinition
(as it would expectEthereumNetworkInfoDefinition
as argument but it actually returns itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to
EthereumNetworkInfoDefinitionValues
.