-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for cip 66 transactions #23
Conversation
TODO fetch converstion rates
…ND in token 120599798721937636601n. (cut off the zeros thats 11 and 12 -- a ratio that makes sense) remove .tests from jest command. now you can added in the file name after yarn test to only run specific test.
@@ -17,7 +17,7 @@ | |||
"build": "yarn build:main && yarn build:module", | |||
"build:main": "tsc -p tsconfig.json", | |||
"build:module": "tsc -p tsconfig.module.json", | |||
"test": "jest ./tests" | |||
"test": "jest" |
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.
not needed and means that calling yarn test does not work
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.
Nice work here, good test coverage. Just a few small comments
src/lib/CeloProvider.ts
Outdated
async getFeeData(feeCurrency?: string): Promise<FeeData> { | ||
if (!feeCurrency) { | ||
// for eip1559 and cip66 transactions are denominated in CELO, cip64 fees must be looked up in the fee token | ||
async getFeeData(feeCurrency?: string, denominateInCelo?: boolean): Promise<FeeData> { |
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.
What purpose does this new param serve? When would denominate be true but fee currency would be truthy?
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.
because with this new transaction type feeCurrency exists but intead of maxFeePerGas and maxPriorityFeePerGas needing be looked up in that in the price for that token they are instead priced in CELO.
tests/CeloWallet.test.ts
Outdated
|
||
|
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 know I'm nitpicking but can we run prettier and/or set it up in this repo?
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.
ran prettier on the changed files.
what
Adding support for the CIP66 Transaction Type This upcoming transaction type will be supported on CEL2.
Defaults to using cip 66 if sending feeCurrency Transaction on a chain that supports it.CIP-66 support #22
add support for automatically calculating fee fields needed for cip66
add isCel2 helper which can be used by anyone to determine if chain is an OP based Layer 2 or still old Layer 1
bump type
minor; adds new features
other
separate transaction tests that dont use the network / need constant results into new unit tests file.
remove ./tests from the
test
command. this added nothing and prevented adhoc filters being applied to which tests were ran likeyarn test CeloWallet