Skip to content

Conversation

@zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Jun 10, 2024

Motivation

Closes: #653

For context + related PR in alloy: alloy-rs/alloy#859

Solution

Add generic aliases unrelated to specific EIPs

  • TxNonce (with doc alias)
  • BlockTimestamp

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Contributor

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm otherwise, no strong feeling either way, just dont want us to end up not using the new alias:)

pub type BlockNumber = u64;

/// A block timestamp.
pub type BlockTimestamp = u64;
Copy link
Contributor

Choose a reason for hiding this comment

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

unsure if we should add this w/o also using it, so maybe a separate pr?

Copy link
Member Author

@zerosnacks zerosnacks Jun 10, 2024

Choose a reason for hiding this comment

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

I would update alloy-rs/alloy#859 to include it so it would be used there

Same for TxNonce

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

hmm, I'm sceptical that these aliases are useful

@zerosnacks
Copy link
Member Author

zerosnacks commented Jun 10, 2024

hmm, I'm sceptical that these aliases are useful

Added some additional context here: alloy-rs/alloy#859

Reduces magic values, reduces chance of error and makes it easier for end-users to see what value they are getting e.g. TxHash instead of FixedBytes<32> when watch()-ing a transaction. Main goal is to limit showing internal types and help with consistency / standardize fields / encourage native types (u64 vs U64) and sizes.

@DaniPopes DaniPopes merged commit 4a258dc into main Jun 10, 2024
@DaniPopes DaniPopes deleted the zerosnacks/additional-aliases branch June 10, 2024 13:12
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.

[Feature] Add additional aliases

5 participants