Skip to content

Commit 0ad2191

Browse files
committed
chore: rename files
1 parent 8cc6695 commit 0ad2191

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pub mod algorithm;
2-
pub mod da_source_adapter;
2+
pub mod da_source_service;

crates/services/gas_price_service/src/v1/da_source_adapter.rs renamed to crates/services/gas_price_service/src/v1/da_source_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::v1::da_source_adapter::service::DaBlockCostsSource;
1+
use crate::v1::da_source_service::service::DaBlockCostsSource;
22
use std::time::Duration;
33

44
pub mod block_committer_costs;
@@ -16,7 +16,7 @@ pub struct DaBlockCosts {
1616
#[cfg(test)]
1717
mod tests {
1818
use super::*;
19-
use crate::v1::da_source_adapter::{
19+
use crate::v1::da_source_service::{
2020
dummy_costs::DummyDaBlockCosts,
2121
service::new_service,
2222
};

crates/services/gas_price_service/src/v1/da_source_adapter/block_committer_costs.rs renamed to crates/services/gas_price_service/src/v1/da_source_service/block_committer_costs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(clippy::arithmetic_side_effects)]
22

3-
use crate::v1::da_source_adapter::{
3+
use crate::v1::da_source_service::{
44
service::{
55
DaBlockCostsSource,
66
Result as DaBlockCostsResult,

crates/services/gas_price_service/src/v1/da_source_adapter/dummy_costs.rs renamed to crates/services/gas_price_service/src/v1/da_source_service/dummy_costs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::v1::da_source_adapter::{
1+
use crate::v1::da_source_service::{
22
service::{
33
DaBlockCostsSource,
44
Result as DaBlockCostsResult,

crates/services/gas_price_service/src/v1/da_source_adapter/service.rs renamed to crates/services/gas_price_service/src/v1/da_source_service/service.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ use fuel_core_services::{
44
ServiceRunner,
55
StateWatcher,
66
};
7-
use std::{
8-
collections::HashSet,
9-
time::Duration,
10-
};
7+
use std::time::Duration;
118
use tokio::{
129
sync::broadcast::Sender,
1310
time::{
@@ -16,13 +13,13 @@ use tokio::{
1613
},
1714
};
1815

19-
use crate::v1::da_source_adapter::DaBlockCosts;
16+
use crate::v1::da_source_service::DaBlockCosts;
2017
pub use anyhow::Result;
2118

2219
#[derive(Clone)]
23-
pub struct DaBlockCostsSharedState(Sender<DaBlockCosts>);
20+
pub struct SharedState(Sender<DaBlockCosts>);
2421

25-
impl DaBlockCostsSharedState {
22+
impl SharedState {
2623
fn new(sender: Sender<DaBlockCosts>) -> Self {
2724
Self(sender)
2825
}
@@ -33,27 +30,27 @@ impl DaBlockCostsSharedState {
3330

3431
/// This struct houses the shared_state, polling interval
3532
/// and a source, which does the actual fetching of the data
36-
pub struct DaBlockCostsService<Source>
33+
pub struct DaSourceService<Source>
3734
where
3835
Source: DaBlockCostsSource,
3936
{
4037
poll_interval: Interval,
4138
source: Source,
42-
shared_state: DaBlockCostsSharedState,
39+
shared_state: SharedState,
4340
}
4441

4542
const DA_BLOCK_COSTS_CHANNEL_SIZE: usize = 10;
4643
const POLLING_INTERVAL_MS: u64 = 10_000;
4744

48-
impl<Source> DaBlockCostsService<Source>
45+
impl<Source> DaSourceService<Source>
4946
where
5047
Source: DaBlockCostsSource,
5148
{
5249
pub fn new(source: Source, poll_interval: Option<Duration>) -> Self {
5350
let (sender, _) = tokio::sync::broadcast::channel(DA_BLOCK_COSTS_CHANNEL_SIZE);
5451
#[allow(clippy::arithmetic_side_effects)]
5552
Self {
56-
shared_state: DaBlockCostsSharedState::new(sender),
53+
shared_state: SharedState::new(sender),
5754
poll_interval: interval(
5855
poll_interval.unwrap_or(Duration::from_millis(POLLING_INTERVAL_MS)),
5956
),
@@ -70,13 +67,13 @@ pub trait DaBlockCostsSource: Send + Sync {
7067
}
7168

7269
#[async_trait::async_trait]
73-
impl<Source> RunnableService for DaBlockCostsService<Source>
70+
impl<Source> RunnableService for DaSourceService<Source>
7471
where
7572
Source: DaBlockCostsSource,
7673
{
77-
const NAME: &'static str = "DaBlockCostsService";
74+
const NAME: &'static str = "DaSourceService";
7875

79-
type SharedData = DaBlockCostsSharedState;
76+
type SharedData = SharedState;
8077

8178
type Task = Self;
8279

@@ -97,7 +94,7 @@ where
9794
}
9895

9996
#[async_trait::async_trait]
100-
impl<Source> RunnableTask for DaBlockCostsService<Source>
97+
impl<Source> RunnableTask for DaSourceService<Source>
10198
where
10299
Source: DaBlockCostsSource,
103100
{
@@ -130,6 +127,6 @@ where
130127
pub fn new_service<S: DaBlockCostsSource>(
131128
da_source: S,
132129
poll_interval: Option<Duration>,
133-
) -> ServiceRunner<DaBlockCostsService<S>> {
134-
ServiceRunner::new(DaBlockCostsService::new(da_source, poll_interval))
130+
) -> ServiceRunner<DaSourceService<S>> {
131+
ServiceRunner::new(DaSourceService::new(da_source, poll_interval))
135132
}

0 commit comments

Comments
 (0)