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: add map_pool fn #11890

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,21 @@ impl<Pool, Client, Attributes, Payload> BuildArguments<Pool, Client, Attributes,
best_payload: self.best_payload,
}
}

/// Maps the transaction pool to a new type using a closure with the current pool type as input.
pub fn map_pool<F, P>(self, f: F) -> BuildArguments<P, Client, Attributes, Payload>
where
F: FnOnce(Pool) -> P,
{
BuildArguments {
client: self.client,
pool: f(self.pool),
cached_reads: self.cached_reads,
config: self.config,
cancel: self.cancel,
best_payload: self.best_payload,
}
}
}

/// A trait for building payloads that encapsulate Ethereum transactions.
Expand Down
Loading