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

feat(core): add support for receiving unsupported tx types #34

Merged
merged 2 commits into from
Jan 1, 2024

Conversation

ArtificialPB
Copy link
Member

@ArtificialPB ArtificialPB commented Dec 7, 2023

Description

This change allows the library to receive any tx type, regardless whether it's officially
supported. Supported transactions can be constructed, signed, and sent and are subclasses
of TransactionUnsigned.

It's now possible to receive optimism's system transactions: https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md#the-deposited-transaction-type

Tx example: https://optimistic.etherscan.io/tx/0x92a7dc8085945e32810b5fb4fb002f024b487861145457bd1cdb60a1fac0d59c

Solution

TxType has been converted to a sealed class to preserve exhaustive compiler checks in "when"
statements. Unsupported transaction types are wrapped into TxType.Unsupported.

This PR also changes TransactionReceipt.type field to have the same type as transactions.

This change allows the library to receive any tx type, regardless whether it's officially
supported. Supported transactions can be constructed, signed, and sent and are subclasses
of TransactionUnsigned.

TxType has been converted to a sealed class to preserve exhaustive compiler checks in "when"
statements. Unsupported transaction types are wrapped into TxType.Unsupported.

This PR also changes TransactionReceipt.type field to have the same type as transactions.
@ArtificialPB ArtificialPB merged commit e2c5936 into master Jan 1, 2024
1 check passed
@ArtificialPB ArtificialPB deleted the feat/unsupported-txs branch January 1, 2024 20:49
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.

1 participant