alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
763 stars 135 forks source link

feat(primitives): add additional common aliases #654

Closed zerosnacks closed 3 months ago

zerosnacks commented 3 months ago

Motivation

Closes: https://github.com/alloy-rs/core/issues/653

For context + related PR in alloy: https://github.com/alloy-rs/alloy/pull/859

Solution

Add generic aliases unrelated to specific EIPs

PR Checklist

zerosnacks commented 3 months ago

hmm, I'm sceptical that these aliases are useful

Added some additional context here: https://github.com/alloy-rs/alloy/pull/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.