chore(async_trait): reduce usage of async_trait for small types again #2634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked Issues/PRs
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:
crates/fuel-core/src/graphql_api/ports.rs
: Removed theasync_trait
attribute from theGasPriceEstimate
trait and changedworst_case_gas_price
to a synchronous method.crates/fuel-core/src/service/adapters.rs
: Updated theGasPriceEstimate
implementations forUniversalGasPriceProvider
andStaticGasPrice
to synchronous methods. [1] [2]crates/services/gas_price_service/src/common/gas_price_algorithm.rs
: Changed theupdate
andworst_case_gas_price
methods to synchronous. [1] [2]Updates to Test Functions:
crates/fuel-core/src/service/adapters.rs
: Adjusted test functions to remove asynchronous calls and runtime blocks. [1] [2] [3]crates/services/sync/src/import/tests.rs
: Updated mock expectations to return pinned async blocks for various test functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Removal of
async_trait
:crates/fuel-core/src/service/adapters/sync.rs
: Removedasync_trait
fromBlockImporterPort
andConsensusPort
implementations. [1] [2]crates/services/sync/src/import/test_helpers/pressure_block_importer.rs
: Removedasync_trait
fromBlockImporterPort
implementation.crates/services/sync/src/import/test_helpers/pressure_consensus.rs
: Removedasync_trait
fromConsensusPort
implementation.These changes collectively simplify the codebase by removing unnecessary asynchronous complexity, making the code more straightforward and potentially improving performance.
Checklist