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

Option<B256> for DepositTransaction::source_hash #2213

Open
Wodann opened this issue Mar 14, 2025 · 1 comment
Open

Option<B256> for DepositTransaction::source_hash #2213

Wodann opened this issue Mar 14, 2025 · 1 comment

Comments

@Wodann
Copy link
Contributor

Wodann commented Mar 14, 2025

The DepositTransaction trait contains a fn source_hash(&self) -> B256; to retrieve the source hash of an OP deposit transaction.

This trait is implemented for the overall OpTransaction, which means that I can also call transaction.source_hash() if transaction is an OpTransaction for e.g. a blob transaction.

This made me wonder whether it wouldn't be better for the API to be:

fn source_hash(&self) -> Option<&B256>

since that would signal whether the transaction has a source hash (only true for deposit transaction).

WDYT, @rakita? If you agree, I can implement this change.

@rakita
Copy link
Member

rakita commented Mar 17, 2025

This makes sense, as Transaction for mainnet is flatten, users would expect same thing to happen for Op.

I would completely remove DepositTransaction and add fields to the OpTxTr

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

No branches or pull requests

2 participants