-
Notifications
You must be signed in to change notification settings - Fork 0
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: CIP-64 are sent as EIP-1559 transactions #9
Merged
Conversation
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
size-limit report 📦
|
Its probably more complex but i think what we really need is more of an integration style test that goes all the way from sending to to end (the code below isnt correct but i think you get the idea
|
jeanregisser
added a commit
to valora-inc/wallet
that referenced
this pull request
Nov 10, 2023
…1559 (#4458) ### Description This reverts commit 3df1888 (#4448). This is to fix CIP-64 TXs serialized as EIP-1559 when using the `prepareTransactionRequest` method from viem. Essentially preventing to pay for TXs using a `feeCurrency`. This was affecting only the "send with viem" flow as it's the only one using that method. We can upgrade again when celo-org/viem#9 lands. I updated our Renovate rules to ignore `viem` for now. ### Test plan - Manually tested an account with only cUSD can successfully send TXs. - Would be good to cover this with an e2e test, but for now I'm only addressing the immediate issue for the release. ### Related issues - See Slack [thread](https://valora-app.slack.com/archives/C04B61SJ6DS/p1699612457370369) ### Backwards compatibility Yes
…ent instead of EIP-1559
jeanregisser
added a commit
to valora-inc/wallet
that referenced
this pull request
Nov 10, 2023
…1559 (#4458) ### Description This reverts commit 3df1888 (#4448). This is to fix CIP-64 TXs serialized as EIP-1559 when using the `prepareTransactionRequest` method from viem. Essentially preventing to pay for TXs using a `feeCurrency`. This was affecting only the "send with viem" flow as it's the only one using that method. We can upgrade again when celo-org/viem#9 lands. I updated our Renovate rules to ignore `viem` for now. ### Test plan - Manually tested an account with only cUSD can successfully send TXs. - Would be good to cover this with an e2e test, but for now I'm only addressing the immediate issue for the release. ### Related issues - See Slack [thread](https://valora-app.slack.com/archives/C04B61SJ6DS/p1699612457370369) ### Backwards compatibility Yes
aaronmgdr
reviewed
Nov 10, 2023
aaronmgdr
reviewed
Nov 10, 2023
aaronmgdr
reviewed
Nov 10, 2023
aaronmgdr
reviewed
Nov 13, 2023
nicolasbrugneaux
requested changes
Nov 13, 2023
nicolasbrugneaux
approved these changes
Nov 15, 2023
arthurgousset
pushed a commit
that referenced
this pull request
Dec 19, 2023
* fix: CIP-64 are sent as EIP-1559 transactions (#9) * fix: CIP-64 are sent as EIP-1559 transactions * fix: EIP-1159 -> EIP-1559 typo * chore: add test case for CIP-64 recognition when eip1559 type is provided * chore: introduce a sendTransaction Celo test to verify CIP-64 being sent instead of EIP-1559 * chore: refactor and simplify sendTransaction test * chore: DRY * chore: add a comment for CIP-64 check * chore: add changeset
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes bug where CIP-64 transactions are sent as EIP-1559 transactions.
It reverts code changes to
src/chains/celo/utils.ts
from this commit and repurposes a test that started failing because of the change.Context
When
prepareTransactionRequest
is called and type is not explicitly provided then it will be determined bygetTransactionType
and because for CIP-64 all EIP-1559 fields are provided it will be set toeip1559
as per:Previously the logic of "forcing" the type in
src/chains/celo/utils.ts
allowed it only if the type was explicitly set tocip64
and otherwise it would try to determine if it's a CIP-64 transaction based on the provided fields:After the aforementioned commit it won't ever get to determine the type based on the fields as it will always go into
if (transaction.type)
branch as theeip1559
type is injected hence resulting in sending wrong transaction type to the blockchain.