Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add future type for getBlock requests #2030

Open
mattsse opened this issue Feb 8, 2025 · 5 comments
Open

[Feature] Add future type for getBlock requests #2030

mattsse opened this issue Feb 8, 2025 · 5 comments
Assignees
Labels
c-provider enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@mattsse
Copy link
Member

mattsse commented Feb 8, 2025

Component

rpc

Describe the feature you would like

getBlockBy supports an additional setting for full/hashes:

/// Gets a block by its [BlockHash], with full transactions or only hashes.
async fn get_block_by_hash(
&self,
hash: BlockHash,
kind: BlockTransactionsKind,
) -> TransportResult<Option<N::BlockResponse>> {

it be nice if we could set this on the return type of get_block_by_hash

let resp = provider. get_block_by_hash(hash).full().await
// or
let resp = provider. get_block_by_hash(hash).await

similar to

fn call<'req>(&self, tx: &'req N::TransactionRequest) -> EthCall<'req, N, Bytes> {

TODO

  • add helper future type for this

Additional context

No response

@mattsse mattsse added the enhancement New feature or request label Feb 8, 2025
@mattsse mattsse added this to Alloy Feb 8, 2025
@github-project-automation github-project-automation bot moved this to Todo in Alloy Feb 8, 2025
@mattsse mattsse added the good first issue Good for newcomers label Feb 8, 2025
@yohkaz
Copy link
Contributor

yohkaz commented Feb 9, 2025

Hey, can I work on this one?

@nadtech-hub
Copy link
Contributor

@yohkaz
Copy link
Contributor

yohkaz commented Feb 10, 2025

@mattsse naive question: how can the provider crate be tested locally?
when running cargo test, I get such errors:

---- provider::wallet::test::bubbles_through_fillers stdout ----
thread 'provider::wallet::test::bubbles_through_fillers' panicked at crates/provider/src/layers/anvil.rs:22:66:
called `Result::unwrap()` on an `Err` value: SpawnError(Os { code: 2, kind: NotFound, message: "No such file or directory" })

@PanGan21
Copy link
Contributor

@mattsse naive question: how can the provider crate be tested locally? when running cargo test, I get such errors:

---- provider::wallet::test::bubbles_through_fillers stdout ----
thread 'provider::wallet::test::bubbles_through_fillers' panicked at crates/provider/src/layers/anvil.rs:22:66:
called `Result::unwrap()` on an `Err` value: SpawnError(Os { code: 2, kind: NotFound, message: "No such file or directory" })

Do you have Geth and Anvil installed locally as the contribution docs state?
https://github.com/alloy-rs/alloy/blob/main/CONTRIBUTING.md#cargo-commands

@yohkaz
Copy link
Contributor

yohkaz commented Feb 10, 2025

Missed this line, thank you : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-provider enhancement New feature or request good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

5 participants