@@ -320,8 +320,11 @@ pub mod seed {
320
320
Dummy , Ethereum ,
321
321
} ;
322
322
use primitives:: {
323
- sentry:: campaign_create:: CreateCampaign , spender:: Spendable , test_util:: CAMPAIGNS ,
324
- unified_num:: FromWhole , Campaign , ChainOf , Deposit , UnifiedNum , ValidatorId ,
323
+ sentry:: campaign_create:: CreateCampaign ,
324
+ spender:: Spendable ,
325
+ test_util:: { ADVERTISER , ADVERTISER_2 , CAMPAIGNS , LEADER } ,
326
+ unified_num:: FromWhole ,
327
+ BigNum , Campaign , ChainOf , Deposit , UnifiedNum , ValidatorId ,
325
328
} ;
326
329
327
330
use crate :: {
@@ -417,19 +420,37 @@ pub mod seed {
417
420
let web3_chain_1 = campaign_3. chain . init_web3 ( ) ?;
418
421
let token_1 = Erc20Token :: new ( & web3_chain_1, campaign_3. token . clone ( ) ) ;
419
422
420
- // TODO: Call set_balance() and set balance for ADVERTISER & ADVERTISER_2
421
- // large enough for the campaigns + extra on top
423
+ let amount = BigNum :: from ( 100 ) ;
424
+ token_1337
425
+ . set_balance ( LEADER . to_bytes ( ) , ADVERTISER . to_bytes ( ) , & amount)
426
+ . await
427
+ . expect ( "Failed to set balance" ) ;
422
428
423
- // token_1337.set_balance(from, address, amount)
424
- // token_1.set_balance(from, address, amount)
429
+ token_1
430
+ . set_balance ( LEADER . to_bytes ( ) , ADVERTISER_2 . to_bytes ( ) , & amount)
431
+ . await
432
+ . expect ( "Failed to set balance" ) ;
425
433
426
434
async fn create_seed_campaign (
427
435
app : Application < Ethereum > ,
428
436
campaign : & ChainOf < Campaign > ,
429
437
) -> Result < ( ) , Box < dyn std:: error:: Error > > {
430
438
let channel_context = ChainOf :: of_channel ( campaign) ;
439
+ let campaign_to_create = CreateCampaign :: from_campaign ( campaign. context . clone ( ) ) ;
440
+
441
+ let auth = Auth {
442
+ era : 0 ,
443
+ uid : ValidatorId :: from ( campaign. context . creator ) ,
444
+ chain : campaign. chain . clone ( ) ,
445
+ } ;
431
446
432
- // TODO: call create_campaign()
447
+ create_campaign (
448
+ Json ( campaign_to_create) ,
449
+ Extension ( auth) ,
450
+ Extension ( Arc :: new ( app. clone ( ) ) ) ,
451
+ )
452
+ . await
453
+ . expect ( "should create campaign" ) ;
433
454
434
455
let spendable = Spendable {
435
456
spender : campaign. context . creator ,
0 commit comments