Fix: celo-specific transaction (CIP64) regressions #1434
Merged
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 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
isCIP42
andisCIP64
functions informatters.ts
formattersCelo
object informatters.ts
to useisCIP42
andisCIP64
functionsCeloTransactionSerializableBase
type intypes.ts
isCIP42