alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
664 stars 239 forks source link

fix(alloy-provider): `get_block_by_number` arg #1582

Closed steph-rs closed 3 weeks ago

steph-rs commented 3 weeks ago

Motivation

Different args in alloy-provider crate:

    /// Gets a block by its [BlockHash], with full transactions or only hashes.
    async fn get_block_by_hash(
        &self,
        hash: BlockHash,
        kind: BlockTransactionsKind,    <--
    )
    ...
    /// Get a block by its number.
    // TODO: Network associate
    async fn get_block_by_number(
        &self,
        number: BlockNumberOrTag,
        hydrate: bool,                  <--
    )

Solution

Changing hydrate argument to kind to make methods symmetrical.

PR Checklist