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

Remove usage of batch calls #401

Merged
merged 9 commits into from
Apr 25, 2024
Merged

Remove usage of batch calls #401

merged 9 commits into from
Apr 25, 2024

Conversation

fvictorio
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Apr 23, 2024

🦋 Changeset detected

Latest commit: d3cee7e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/edr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Wodann Wodann linked an issue Apr 24, 2024 that may be closed by this pull request
@fvictorio fvictorio requested a review from Wodann April 24, 2024 14:23
.github/workflows/edr-benchmark.yml Show resolved Hide resolved
.into_iter()
.map(|transaction_hash| RequestMethod::GetTransactionReceipt(*transaction_hash))
.collect();
.map(|transaction_hash| self.get_transaction_receipt(transaction_hash));
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't clippy complain about this?

Can't it be map(RpcClient::get_transaction_receipt)?

Copy link
Member Author

Choose a reason for hiding this comment

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

My understanding is: get_transaction_receipt is a method, so it can't be called as RpcClient::get_transaction_receipt. And apparently Rust doesn't support methods in those scenarios, so you can't do .map(self.get_transaction_receipt).

Copy link
Member

@Wodann Wodann Apr 25, 2024

Choose a reason for hiding this comment

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

I see now. The problem is that it receives two arguments: self and B256.

If it were just the one argument, the pattern would be like in this example: https://github.com/NomicFoundation/edr/blob/main/crates/edr_eth/src/remote/client.rs#L986

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I updated my response. I overlooked the two arguments and noticed that when I tried it locally

crates/edr_eth/src/remote/request_methods.rs Show resolved Hide resolved
@fvictorio fvictorio requested a review from Wodann April 25, 2024 19:32
@fvictorio fvictorio merged commit e82246c into main Apr 25, 2024
28 checks passed
@fvictorio fvictorio deleted the dont-use-batch-calls branch April 25, 2024 19:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using batch calls
2 participants