Skip to content

Commit b32d221

Browse files
committed
clean up use statements
1 parent 9694de8 commit b32d221

File tree

16 files changed

+24
-40
lines changed

16 files changed

+24
-40
lines changed

adapter/src/dummy.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ use primitives::{
55
Adapter, AdapterErrorKind, AdapterResult, Deposit, DummyAdapterOptions,
66
Error as AdapterError, Session,
77
},
8-
channel::Channel,
98
config::Config,
10-
Address, ChannelId, ToETHChecksum, ValidatorId,
9+
Address, Channel, ChannelId, ToETHChecksum, ValidatorId,
1110
};
1211
use std::{collections::HashMap, fmt, sync::Arc};
1312

adapter/src/ethereum.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ use ethstore::{
99
use lazy_static::lazy_static;
1010
use primitives::{
1111
adapter::{Adapter, AdapterResult, Deposit, Error as AdapterError, KeystoreOptions, Session},
12-
channel::Channel,
1312
config::Config,
14-
Address, BigNum, ToETHChecksum, ValidatorId,
13+
Address, BigNum, Channel, ToETHChecksum, ValidatorId,
1514
};
1615
use reqwest::Client;
1716
use serde::{Deserialize, Serialize};

primitives/src/campaign.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{
2-
channel::Channel, targeting::Rules, AdUnit, Address, EventSubmission, UnifiedNum, Validator,
2+
targeting::Rules, AdUnit, Address, Channel, EventSubmission, UnifiedNum, Validator,
33
ValidatorDesc, ValidatorId,
44
};
55

@@ -358,7 +358,7 @@ pub mod validators {
358358

359359
#[cfg(feature = "postgres")]
360360
mod postgres {
361-
use crate::channel::Channel;
361+
use crate::Channel;
362362

363363
use super::{Active, Campaign, CampaignId, PricingBounds, Validators};
364364
use bytes::BytesMut;

primitives/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ pub use self::{
1111
balances_map::{BalancesMap, UnifiedMap},
1212
big_num::BigNum,
1313
campaign::{Campaign, CampaignId},
14-
channel::Channel,
15-
channel::ChannelId,
14+
channel::{Channel, ChannelId},
1615
config::Config,
1716
deposit::Deposit,
1817
event_submission::EventSubmission,

primitives/src/sentry.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl fmt::Display for ChannelReport {
300300
}
301301

302302
pub mod channel_list {
303-
use crate::{channel::Channel, ValidatorId};
303+
use crate::{Channel, ValidatorId};
304304
use serde::{Deserialize, Serialize};
305305

306306
use super::Pagination;
@@ -360,9 +360,8 @@ pub mod campaign_create {
360360

361361
use crate::{
362362
campaign::{prefix_active, Active, PricingBounds, Validators},
363-
channel::Channel,
364363
targeting::Rules,
365-
AdUnit, Address, Campaign, CampaignId, EventSubmission, UnifiedNum,
364+
AdUnit, Address, Campaign, CampaignId, Channel, EventSubmission, UnifiedNum,
366365
};
367366

368367
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]

primitives/src/spender.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{channel::Channel, Address, Deposit, UnifiedNum};
1+
use crate::{Address, Channel, Deposit, UnifiedNum};
22
use serde::{Deserialize, Serialize};
33

44
#[derive(Serialize, Deserialize, Debug, Clone)]

primitives/src/util/tests/prep_db.rs

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ lazy_static! {
5353

5454
// Dummy adapter auth tokens
5555
// authorization tokens
56-
///
5756
pub static ref AUTH: HashMap<String, String> = {
5857
let mut auth = HashMap::new();
5958

sentry/src/db/channel.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ pub async fn insert_validator_messages(
9595

9696
mod list_channels {
9797
use primitives::{
98-
channel::Channel,
9998
sentry::{channel_list::ChannelListResponse, Pagination},
100-
ValidatorId,
99+
Channel, ValidatorId,
101100
};
102101
use std::str::FromStr;
103102
use tokio_postgres::types::{accepts, FromSql, Type};

sentry/src/db/event_aggregate.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ use chrono::{DateTime, Utc};
22
use futures::pin_mut;
33
use primitives::{
44
balances::UncheckedState,
5-
channel::Channel as ChannelV5,
65
sentry::{EventAggregate, MessageResponse},
76
validator::{ApproveState, Heartbeat, NewState},
8-
Address, BigNum, ChannelId, ValidatorId,
7+
Address, BigNum, Channel, ChannelId, ValidatorId,
98
};
109
use std::{convert::TryFrom, ops::Add};
1110
use tokio_postgres::{
@@ -17,7 +16,7 @@ use super::{DbPool, PoolError};
1716

1817
pub async fn latest_approve_state_v5(
1918
pool: &DbPool,
20-
channel: &ChannelV5,
19+
channel: &Channel,
2120
) -> Result<Option<MessageResponse<ApproveState>>, PoolError> {
2221
let client = pool.get().await?;
2322

@@ -34,7 +33,7 @@ pub async fn latest_approve_state_v5(
3433

3534
pub async fn latest_new_state_v5(
3635
pool: &DbPool,
37-
channel: &ChannelV5,
36+
channel: &Channel,
3837
state_root: &str,
3938
) -> Result<Option<MessageResponse<NewState<UncheckedState>>>, PoolError> {
4039
let client = pool.get().await?;

sentry/src/routes/campaign.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ use hyper::{Body, Request, Response};
1313
use primitives::{
1414
adapter::{Adapter, AdapterErrorKind, Error as AdapterError},
1515
campaign_validator::Validator,
16-
channel::Channel,
1716
config::TokenInfo,
1817
sentry::campaign_create::{CreateCampaign, ModifyCampaign},
1918
spender::Spendable,
20-
Address, Campaign, Deposit, UnifiedNum,
19+
Address, Campaign, Channel, Deposit, UnifiedNum,
2120
};
2221
use slog::error;
2322
use std::cmp::{max, Ordering};

sentry/src/routes/event_aggregate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use chrono::{serde::ts_milliseconds_option, DateTime, Utc};
22
use hyper::{Body, Request, Response};
33
use serde::Deserialize;
44

5-
use primitives::{adapter::Adapter, channel::Channel, sentry::EventAggregateResponse};
5+
use primitives::{adapter::Adapter, sentry::EventAggregateResponse, Channel};
66

77
use crate::{success_response, Application, Auth, ResponseError};
88

validator_worker/src/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
sentry_interface::{campaigns::all_campaigns, Validator, Validators},
55
SentryApi,
66
};
7-
use primitives::{adapter::Adapter, channel::Channel, config::Config, util::ApiUrl, ChannelId};
7+
use primitives::{adapter::Adapter, config::Config, util::ApiUrl, Channel, ChannelId};
88
use slog::Logger;
99
use std::collections::{hash_map::Entry, HashSet};
1010

validator_worker/src/follower.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ use primitives::{
44
adapter::{Adapter, AdapterErrorKind, Error as AdapterError},
55
balances,
66
balances::{Balances, CheckedState, UncheckedState},
7-
channel::Channel,
87
config::TokenInfo,
98
spender::Spender,
109
validator::{ApproveState, MessageTypes, NewState, RejectState},
11-
Address, ChannelId, UnifiedNum,
10+
Address, Channel, ChannelId, UnifiedNum,
1211
};
1312

1413
use crate::core::follower_rules::{get_health, is_valid_transition};

validator_worker/src/leader.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ use thiserror::Error;
44
use primitives::{
55
adapter::{Adapter, AdapterErrorKind, Error as AdapterError},
66
balances::CheckedState,
7-
channel::Channel,
87
config::TokenInfo,
98
validator::{MessageError, MessageTypes, NewState},
10-
Balances, ChannelId,
9+
Balances, Channel, ChannelId,
1110
};
1211

1312
use crate::{

validator_worker/src/main.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ use std::{convert::TryFrom, error::Error, time::Duration};
55

66
use clap::{crate_version, App, Arg};
77
use futures::future::{join, join_all};
8-
use tokio::{
9-
runtime::Runtime,
10-
// time::{sleep, timeout},
11-
time::sleep,
12-
};
8+
use tokio::{runtime::Runtime, time::sleep};
139

1410
use adapter::{AdapterTypes, DummyAdapter, EthereumAdapter};
1511
use primitives::{
1612
adapter::{Adapter, DummyAdapterOptions, KeystoreOptions},
17-
// channel::Channel as ChannelV5,
1813
config::{configuration, Config},
19-
util::tests::prep_db::{AUTH, IDS},
20-
util::ApiUrl,
14+
util::{
15+
tests::prep_db::{AUTH, IDS},
16+
ApiUrl,
17+
},
2118
ValidatorId,
22-
// Campaign, ChannelId, SpecValidator,
2319
};
2420
use slog::{error, info, Logger};
2521
use std::fmt::Debug;

validator_worker/src/sentry_interface.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ use slog::Logger;
88
use primitives::{
99
adapter::Adapter,
1010
balances::{CheckedState, UncheckedState},
11-
channel::Channel,
1211
sentry::{
1312
AccountingResponse, EventAggregateResponse, LastApprovedResponse, SuccessResponse,
1413
ValidatorMessageResponse,
1514
},
1615
spender::Spender,
1716
util::ApiUrl,
1817
validator::MessageTypes,
19-
Address, Campaign, {ChannelId, Config, ValidatorId},
18+
Address, Campaign, Channel, {ChannelId, Config, ValidatorId},
2019
};
2120
use thiserror::Error;
2221

@@ -281,10 +280,9 @@ async fn propagate_to<A: Adapter>(
281280
mod channels {
282281
use futures::{future::try_join_all, TryFutureExt};
283282
use primitives::{
284-
channel::Channel,
285283
sentry::channel_list::{ChannelListQuery, ChannelListResponse},
286284
util::ApiUrl,
287-
ValidatorId,
285+
Channel, ValidatorId,
288286
};
289287
use reqwest::{Client, Response};
290288

0 commit comments

Comments
 (0)