Skip to content

Commit e50c489

Browse files
committed
fmt + clippy
1 parent f53a546 commit e50c489

File tree

5 files changed

+41
-40
lines changed

5 files changed

+41
-40
lines changed

sentry/src/db/accounting.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,14 @@ pub async fn spend_amount(
185185

186186
#[cfg(test)]
187187
mod test {
188-
use primitives::{test_util::{
189-
ADVERTISER, ADVERTISER_2, CREATOR, DUMMY_CAMPAIGN, PUBLISHER, PUBLISHER_2,
190-
}, config::GANACHE_CONFIG};
191-
192-
use crate::{
193-
db::{
194-
insert_channel,
195-
tests_postgres::{setup_test_migrations, DATABASE_POOL},
196-
},
188+
use primitives::{
189+
config::GANACHE_CONFIG,
190+
test_util::{ADVERTISER, ADVERTISER_2, CREATOR, DUMMY_CAMPAIGN, PUBLISHER, PUBLISHER_2},
191+
};
192+
193+
use crate::db::{
194+
insert_channel,
195+
tests_postgres::{setup_test_migrations, DATABASE_POOL},
197196
};
198197

199198
use super::*;

sentry/src/db/campaign.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,9 @@ mod campaign_remaining {
571571

572572
#[cfg(test)]
573573
mod test {
574-
use crate::{
575-
db::{
576-
insert_channel,
577-
tests_postgres::{setup_test_migrations, DATABASE_POOL},
578-
},
574+
use crate::db::{
575+
insert_channel,
576+
tests_postgres::{setup_test_migrations, DATABASE_POOL},
579577
};
580578
use chrono::TimeZone;
581579
use primitives::{

sentry/src/db/channel.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ pub async fn insert_channel(
6464

6565
mod list_channels {
6666
use primitives::{
67-
sentry::{
68-
channel_list::ChannelListResponse,
69-
Pagination,
70-
},
71-
Channel, ChainId, ValidatorId,
67+
sentry::{channel_list::ChannelListResponse, Pagination},
68+
ChainId, Channel, ValidatorId,
7269
};
7370

7471
use crate::db::{DbPool, PoolError, TotalCount};
@@ -88,7 +85,7 @@ mod list_channels {
8885
if !chains.is_empty() {
8986
where_clauses.push(format!(
9087
"chain_id IN ({})",
91-
chains
88+
chains
9289
.iter()
9390
.map(|id| id.to_u32().to_string())
9491
.collect::<Vec<String>>()
@@ -193,13 +190,11 @@ mod list_channels {
193190

194191
#[cfg(test)]
195192
mod test {
196-
use primitives::{test_util::DUMMY_CAMPAIGN, config::GANACHE_CONFIG};
193+
use primitives::{config::GANACHE_CONFIG, test_util::DUMMY_CAMPAIGN};
197194

198-
use crate::{
199-
db::{
200-
insert_channel,
201-
tests_postgres::{setup_test_migrations, DATABASE_POOL},
202-
},
195+
use crate::db::{
196+
insert_channel,
197+
tests_postgres::{setup_test_migrations, DATABASE_POOL},
203198
};
204199

205200
use super::list_channels::list_channels;
@@ -231,9 +226,15 @@ mod test {
231226
only_select
232227
};
233228

234-
let response = list_channels(&database.pool, 0, 10, None, &[channel_context.chain.chain_id])
235-
.await
236-
.expect("Should list Channels");
229+
let response = list_channels(
230+
&database.pool,
231+
0,
232+
10,
233+
None,
234+
&[channel_context.chain.chain_id],
235+
)
236+
.await
237+
.expect("Should list Channels");
237238

238239
assert_eq!(1, response.channels.len());
239240
assert_eq!(DUMMY_CAMPAIGN.channel, actual_channel);

sentry/src/db/spendable.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,16 @@ mod test {
117117
use std::collections::HashMap;
118118

119119
use primitives::{
120-
spender::Spendable,
121120
config::GANACHE_CONFIG,
121+
spender::Spendable,
122122
test_util::DUMMY_CAMPAIGN,
123123
test_util::{ADVERTISER, CREATOR, FOLLOWER, GUARDIAN, GUARDIAN_2, PUBLISHER},
124124
Deposit, UnifiedNum,
125125
};
126126

127-
use crate::{
128-
db::{
129-
insert_channel,
130-
tests_postgres::{setup_test_migrations, DATABASE_POOL},
131-
}
127+
use crate::db::{
128+
insert_channel,
129+
tests_postgres::{setup_test_migrations, DATABASE_POOL},
132130
};
133131
use tokio::time::{sleep, Duration};
134132

sentry/src/routes/channel.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use primitives::{
3131
use slog::{error, Logger};
3232
use std::{collections::HashMap, str::FromStr};
3333

34-
3534
/// `GET /v5/channel/list` request
3635
///
3736
/// Query: [`ChannelListQuery`]
@@ -47,8 +46,14 @@ pub async fn channel_list<C: Locked + 'static>(
4746
.checked_mul(app.config.channels_find_limit.into())
4847
.ok_or_else(|| ResponseError::BadRequest("Page and/or limit is too large".into()))?;
4948

50-
let list_response =
51-
list_channels(&app.pool, skip, app.config.channels_find_limit, query.validator, &query.chains).await?;
49+
let list_response = list_channels(
50+
&app.pool,
51+
skip,
52+
app.config.channels_find_limit,
53+
query.validator,
54+
&query.chains,
55+
)
56+
.await?;
5257

5358
Ok(success_response(serde_json::to_string(&list_response)?))
5459
}
@@ -702,7 +707,7 @@ mod test {
702707
ADVERTISER, CREATOR, DUMMY_CAMPAIGN, FOLLOWER, GUARDIAN, IDS, LEADER, LEADER_2,
703708
PUBLISHER, PUBLISHER_2,
704709
},
705-
BigNum, Deposit, UnifiedMap, ValidatorId, ChainId
710+
BigNum, ChainId, Deposit, UnifiedMap, ValidatorId,
706711
};
707712

708713
#[tokio::test]
@@ -1245,7 +1250,7 @@ mod test {
12451250
"Response returns the correct channel"
12461251
);
12471252
}
1248-
}
1253+
}
12491254

12501255
#[tokio::test]
12511256
async fn payouts_for_earners_test() {

0 commit comments

Comments
 (0)