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

Fix: celo-specific transaction (CIP64) regressions #1434

Merged
merged 6 commits into from
Nov 5, 2023
Merged

Conversation

nicolasbrugneaux
Copy link
Contributor

@nicolasbrugneaux nicolasbrugneaux commented Nov 2, 2023

This PR aims to fix the issues reported by @0xarthurxyz in celo-org/txtypes#1

This refactors the different checks for CIP42 and CIP64 by using more robust mechanism than truthy/falsy values.
It also removes the tests that added type: 'cipxyz' unnecessarily and by doing so forcing the tx to be correct even though the transaction-type inference not detect it as such. (eg: a cip42 without gatewayFee).

It also refactors some of the tests that checked for a hardcoded raw serialized string (keeps it in a couple place for sanity) but uses the parser to self-check itself.

[Regressions Introduced via #1379]

[Closes celo-org/txtypes/issues/1]

[Original PR celo-org/pull/6]


PR-Codex overview

This PR focuses on fixing an issue where Celo CIP64 transactions were being recognized as EIP1559 transactions.

Detailed summary

  • Fix issue with Celo CIP64 transactions being recognized as EIP1559 transactions
  • Import isCIP42 and isCIP64 functions in formatters.ts
  • Update formattersCelo object in formatters.ts to use isCIP42 and isCIP64 functions
  • Update CeloTransactionSerializableBase type in types.ts
  • Import isCIP42

The following files were skipped due to too many changes: src/chains/celo/serializers.ts, src/chains/celo/utils.test.ts, src/chains/celo/serializers.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

* fix: refactor cip64 to be more robust

* fix: types

* fix: signTransaction tests

* refactor: PR feedback
Copy link

changeset-bot bot commented Nov 2, 2023

🦋 Changeset detected

Latest commit: cd13cde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 2, 2023

@nicolasbrugneaux is attempting to deploy a commit to the wagmi Team on Vercel.

A member of the Team first needs to authorize it.

@nicolasbrugneaux nicolasbrugneaux changed the title Fix: cip64 regressions (#6) Fix: celo-specific transaction (CIP64) regressions Nov 2, 2023
src/chains/celo/utils.ts Outdated Show resolved Hide resolved
src/chains/celo/utils.ts Show resolved Hide resolved
nicolasbrugneaux and others added 4 commits November 3, 2023 09:33
* CELO utils test coverage

* test: generate new address for each test

---------

Co-authored-by: Nicolas Brugneaux <[email protected]>
@jxom jxom merged commit c0da695 into wevm:main Nov 5, 2023
12 of 21 checks 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.

Fix bug that initiates an EIP-1559 tx instead of a CIP-64 tx since [email protected]
3 participants