Skip to content
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

Merged
merged 17 commits into from
Jun 12, 2024
Merged

Add support for cip 66 transactions #23

merged 17 commits into from
Jun 12, 2024

Conversation

aaronmgdr
Copy link
Collaborator

@aaronmgdr aaronmgdr commented May 21, 2024

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 testcommand. this added nothing and prevented adhoc filters being applied to which tests were ran like yarn test CeloWallet

@aaronmgdr aaronmgdr marked this pull request as ready for review May 22, 2024 12:50
@aaronmgdr aaronmgdr mentioned this pull request May 22, 2024
@@ -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"
Copy link
Collaborator Author

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

Copy link
Owner

@jmrossy jmrossy left a 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

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> {
Copy link
Owner

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?

Copy link
Collaborator Author

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.

src/lib/CoreContract.ts Outdated Show resolved Hide resolved
src/lib/CoreContract.ts Outdated Show resolved Hide resolved
tests/CeloWallet.test.ts Outdated Show resolved Hide resolved
Comment on lines 31 to 32


Copy link
Owner

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?

Copy link
Collaborator Author

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.

src/lib/transactions.ts Outdated Show resolved Hide resolved
@aaronmgdr aaronmgdr merged commit 272e4cc into master Jun 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants