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

feat: eth_callMany #2664

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

feat: eth_callMany #2664

wants to merge 5 commits into from

Conversation

hjawhar
Copy link

@hjawhar hjawhar commented Nov 5, 2023

Motivation

Missing feature, I had written it initially for my own project using (ledgerwatch/erigon#4471) as reference and thought I would implement it here

Solution

Add eth_callMany function to support simulating a set of bundles

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

ethers-core/src/types/trace/erigon.rs Outdated Show resolved Hide resolved
ethers-core/src/types/trace/erigon.rs Outdated Show resolved Hide resolved

#[derive(Serialize, Debug, Clone)]
pub struct EthCallManyBalanceDiff {
pub balance: U256,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to have this as Option, in case we need more fields

ethers-core/src/types/trace/erigon.rs Outdated Show resolved Hide resolved
ethers-providers/src/middleware.rs Outdated Show resolved Hide resolved
ethers-core/src/types/trace/erigon.rs Outdated Show resolved Hide resolved
ethers-core/src/types/trace/erigon.rs Outdated Show resolved Hide resolved
@hjawhar
Copy link
Author

hjawhar commented Nov 6, 2023

Going to update as per code review comments

@hjawhar
Copy link
Author

hjawhar commented Nov 6, 2023

Updated PR as per code review comments - added 2 basic examples

@hjawhar hjawhar requested a review from mattsse November 6, 2023 19:47
Comment on lines +32 to +33
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct EthCallManyOutputEmpty {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

redundant type?

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct EthCallManyOutput {
pub value: Option<Bytes>,
pub error: Option<EthCallManyOutputEmpty>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be a string

@mattsse
Copy link
Collaborator

mattsse commented Nov 7, 2023

can we get a sample response for a test?

@mattsse
Copy link
Collaborator

mattsse commented Nov 7, 2023

overrides object lacks some fields I believe:

ledgerwatch/erigon#4471

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.

None yet

2 participants