Skip to content

Commit 0442ec6

Browse files
committed
cargo fmt + info logging when seeding
1 parent 606d1fc commit 0442ec6

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

sentry/src/application.rs

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,17 +316,22 @@ pub mod seed {
316316
use axum::{Extension, Json};
317317

318318
use adapter::{
319-
ethereum::{test_util::{Erc20Token, Outpace}, ChainTransport},
319+
ethereum::{
320+
test_util::{Erc20Token, Outpace},
321+
ChainTransport,
322+
},
320323
Dummy, Ethereum,
321324
};
322325
use primitives::{
323326
sentry::campaign_create::CreateCampaign,
324327
spender::Spendable,
325-
test_util::{ADVERTISER, ADVERTISER_2, CAMPAIGNS, LEADER, FOLLOWER},
328+
test_util::{ADVERTISER, ADVERTISER_2, CAMPAIGNS, LEADER},
326329
unified_num::FromWhole,
327330
BigNum, Campaign, ChainOf, Deposit, UnifiedNum, ValidatorId,
328331
};
329332

333+
use slog::info;
334+
330335
use crate::{
331336
db::{insert_channel, spendable::insert_spendable},
332337
routes::{
@@ -337,6 +342,8 @@ pub mod seed {
337342
};
338343

339344
pub async fn seed_dummy(app: Application<Dummy>) -> Result<(), Box<dyn std::error::Error>> {
345+
info!(&app.logger, "Seeding sentry with Dummy adapter");
346+
340347
// create campaign
341348
// Chain 1337
342349
let campaign_1 = CAMPAIGNS[0].clone();
@@ -408,6 +415,7 @@ pub mod seed {
408415
pub async fn seed_ethereum(
409416
app: Application<Ethereum>,
410417
) -> Result<(), Box<dyn std::error::Error>> {
418+
info!(&app.logger, "Seeding sentry with Ethereum adapter");
411419
// Chain 1337
412420
let campaign_1 = CAMPAIGNS[0].clone();
413421
// Chain 1337
@@ -423,25 +431,45 @@ pub mod seed {
423431
let outpace_1 = Outpace::new(&web3_chain_1, campaign_3.chain.outpace);
424432

425433
token_1337
426-
.set_balance(LEADER.to_bytes(), ADVERTISER.to_bytes(), &BigNum::with_precision(3_000_000, token_1337.info.precision.into()))
434+
.set_balance(
435+
LEADER.to_bytes(),
436+
ADVERTISER.to_bytes(),
437+
&BigNum::with_precision(3_000_000, token_1337.info.precision.into()),
438+
)
427439
.await
428440
.expect("Failed to set balance");
429441
outpace_1337
430-
.deposit(&campaign_1.context.channel, ADVERTISER.to_bytes(), &BigNum::with_precision(1_000_000, token_1337.info.precision.into()))
442+
.deposit(
443+
&campaign_1.context.channel,
444+
ADVERTISER.to_bytes(),
445+
&BigNum::with_precision(1_000_000, token_1337.info.precision.into()),
446+
)
431447
.await
432448
.expect("Should deposit funds");
433449
outpace_1337
434-
.deposit(&campaign_2.context.channel, ADVERTISER.to_bytes(), &BigNum::with_precision(1_000_000, token_1337.info.precision.into()))
450+
.deposit(
451+
&campaign_2.context.channel,
452+
ADVERTISER.to_bytes(),
453+
&BigNum::with_precision(1_000_000, token_1337.info.precision.into()),
454+
)
435455
.await
436456
.expect("Should deposit funds");
437457

438458
token_1
439-
.set_balance(LEADER.to_bytes(), ADVERTISER_2.to_bytes(), &BigNum::with_precision(2_000_000, token_1.info.precision.into()))
459+
.set_balance(
460+
LEADER.to_bytes(),
461+
ADVERTISER_2.to_bytes(),
462+
&BigNum::with_precision(2_000_000, token_1.info.precision.into()),
463+
)
440464
.await
441465
.expect("Failed to set balance");
442466

443467
outpace_1
444-
.deposit(&campaign_3.context.channel, ADVERTISER_2.to_bytes(), &BigNum::with_precision(1_000_000, token_1.info.precision.into()))
468+
.deposit(
469+
&campaign_3.context.channel,
470+
ADVERTISER_2.to_bytes(),
471+
&BigNum::with_precision(1_000_000, token_1.info.precision.into()),
472+
)
445473
.await
446474
.expect("Should deposit funds");
447475

0 commit comments

Comments
 (0)