-
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.
feat(gas_price_service): include trait declaration for block committe…
…r data (#2155) > [!WARNING] > 🏗️ This PR is 1/2 of including block committer "da"ta in v1 of the gas price algo. We have a dependency on the api of the block committer, which can be included in a follow up PR when we have more details 🚧 ## Linked Issues/PRs <!-- List of related issues/PRs --> - #2139 ## Description <!-- List of detailed changes --> This PR includes the following changes - - new trait `DaCommitSource` which specifies `get_da_commit_details` that returns the latest da commit details from the block committer - removed usages of std lib and replaced with `core::*` - refactored to make functions shorter and readable ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [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 - [x] 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?
- Loading branch information
Showing
5 changed files
with
193 additions
and
70 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
crates/services/gas_price_service/src/fuel_gas_price_updater/fuel_da_source_adapter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::fuel_gas_price_updater::{ | ||
DaCommitDetails, | ||
DaCommitSource, | ||
Result as GasPriceUpdaterResult, | ||
}; | ||
|
||
#[derive(Default, Clone)] | ||
pub struct FuelDaSource; | ||
|
||
impl DaCommitSource for FuelDaSource { | ||
fn get_da_commit_details( | ||
&mut self, | ||
) -> GasPriceUpdaterResult<Option<DaCommitDetails>> { | ||
todo!() // TODO(#2139): pending research on how to get the data from the block committer | ||
} | ||
} |
Oops, something went wrong.