Skip to content

Conversation

emlautarom1
Copy link
Contributor

Changes

  • Properly map Transaction type instead of always using 0x7E ("deposit")

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Added unit tests to ensure that we're not changing TxType and we're including additional receipt information for "deposit" transactions only.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

I'm curious as to why we didn't get this reported earlier considering that the issue has been present since #7483.

{
OptimismTxReceipt? receipt = _receiptFinder
.Get(block)
.Cast<OptimismTxReceipt>()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all receipts always of type OptimismTxReceipt or is it possible to have a TxReceipt? If the later is correct then this cast will fail at runtime.

cc. @flcl42 @jmederosalvarado

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially you could make EthRpcModule bit more extensible and avoid some code duplication.

@emlautarom1
Copy link
Contributor Author

Potentially you could make EthRpcModule bit more extensible and avoid some code duplication.

I've removed the duplication in the eth_getTransactionByBlock[Hash|Number]AndIndex by merging both into a single method, thus requiring a single override rather than two.

@emlautarom1 emlautarom1 merged commit c740dab into master Feb 6, 2025
79 checks passed
@emlautarom1 emlautarom1 deleted the fix/optimism-eth-rpc-module-txtype branch February 6, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants