-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gas_price_service): define port for L2 data (#2224)
> [!NOTE] > This is PR 1/n in cleaning up the gas price service. This PR is first of few that moves the `algorithm_updater` from the `sub_services` module of `fuel-core` to `fuel-core-gas-price-service`. > > To do so, we have to cut dependencies on `fuel-core`, which means we have to remove the direct dependency on `Database`, `ConsensusParametersProvider` etc. ## Linked Issues/PRs <!-- List of related issues/PRs --> ## Description <!-- List of detailed changes --> We define a new port in the `fuel-core-gas-price-service` crate that is meant to cut the dependency of `algorithm_updater` from `fuel-core`. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests (existing tests already work) - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
- Loading branch information
Showing
5 changed files
with
117 additions
and
58 deletions.
There are no files selected for viewing
43 changes: 35 additions & 8 deletions
43
crates/fuel-core/src/service/adapters/gas_price_adapters.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use fuel_core_storage::Result as StorageResult; | ||
use fuel_core_types::{ | ||
blockchain::block::Block, | ||
fuel_tx::Transaction, | ||
fuel_types::BlockHeight, | ||
}; | ||
|
||
pub trait L2Data: Send + Sync { | ||
fn latest_height(&self) -> StorageResult<BlockHeight>; | ||
fn get_block( | ||
&self, | ||
height: &BlockHeight, | ||
) -> StorageResult<Option<Block<Transaction>>>; | ||
} |