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

chore(async_trait): reduce usage of async_trait for small types again #2634

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

rymnc
Copy link
Member

@rymnc rymnc commented Jan 26, 2025

Linked Issues/PRs

  • none

Description

this pr description is AI generated, pls take with a grain of salt

This pull request includes several changes to remove asynchronous traits and methods, converting them to synchronous ones across various files. The most important changes include modifying the GasPriceEstimate trait and its implementations, updating test functions, and adjusting mock expectations.

Conversion to Synchronous Methods:

Updates to Test Functions:

Removal of async_trait:

These changes collectively simplify the codebase by removing unnecessary asynchronous complexity, making the code more straightforward and potentially improving performance.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

@rymnc rymnc added the no changelog Skip the CI check of the changelog modification label Jan 26, 2025
@rymnc rymnc self-assigned this Jan 26, 2025
@rymnc rymnc force-pushed the chore/remove-some-usage-of-async-trait branch 3 times, most recently from a9d4adc to 3834ce9 Compare January 26, 2025 08:17
@rymnc rymnc force-pushed the chore/remove-some-usage-of-async-trait branch from 3834ce9 to 0647db1 Compare January 26, 2025 08:27
@rymnc rymnc marked this pull request as ready for review January 26, 2025 10:56
@@ -33,7 +33,8 @@ impl BlockImporterPort for PressureBlockImporter {
impl PressureBlockImporter {
pub fn new(counts: SharedCounts, delays: Duration) -> Self {
let mut mock = MockBlockImporterPort::default();
mock.expect_execute_and_commit().returning(move |_| Ok(()));
mock.expect_execute_and_commit()
.returning(move |_| Box::pin(async move { Ok(()) }));
Copy link
Member Author

Choose a reason for hiding this comment

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

automock is annoying

@rymnc rymnc enabled auto-merge (squash) January 27, 2025 12:33
@rymnc rymnc merged commit 02f11ed into master Jan 27, 2025
29 of 30 checks passed
@rymnc rymnc deleted the chore/remove-some-usage-of-async-trait branch January 27, 2025 13:20
@rymnc rymnc restored the chore/remove-some-usage-of-async-trait branch January 27, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants