Skip to content

Add bidirectional conversion between scalar::BigInt and pb::eth::v2::BigInt#27

Draft
codegen-sh[bot] wants to merge 1 commit intodevelopfrom
blo-318-add-bigint-conversion
Draft

Add bidirectional conversion between scalar::BigInt and pb::eth::v2::BigInt#27
codegen-sh[bot] wants to merge 1 commit intodevelopfrom
blo-318-add-bigint-conversion

Conversation

@codegen-sh
Copy link

@codegen-sh codegen-sh bot commented Aug 13, 2025

This PR adds bidirectional conversion between scalar::BigInt and substreams_ethereum::pb::eth::v2::BigInt via the From trait.

Changes

  • Added a new conversions.rs module with implementations of the From trait for both BigInt types
  • Added tests for the conversions
  • Added a new optional ethereum feature to enable Ethereum-specific functionality
  • Updated the CHANGELOG.md to document the changes

Implementation Details

  • The conversion from scalar::BigInt to pb::eth::v2::BigInt uses the to_signed_bytes_be method
  • The conversion from pb::eth::v2::BigInt to scalar::BigInt uses the from_signed_bytes_be method
  • The conversions are only available when the ethereum feature is enabled

Fixes BLO-318


💻 View my work • 👤 Initiated by Matthieu VachonAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks

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.

0 participants