@@ -359,34 +359,42 @@ parameter_types! {
359359type Block = frame_system:: mocking:: MockBlock < Runtime > ;
360360
361361thread_local ! {
362- static DEPOSIT_CALLS : RefCell <Vec <( AccountId , Asset <AssetId >, Balance , Option <LockMultiplier >) >> = RefCell :: new( Vec :: new( ) ) ;
363- static WITHDRAWAL_CALLS : RefCell <Vec <( AccountId , Asset <AssetId >, Balance ) >> = RefCell :: new( Vec :: new( ) ) ;
362+ static DELEGATE_CALLS : RefCell <Vec <( AccountId , AccountId , Asset <AssetId >, Balance , Option <LockMultiplier >) >> = RefCell :: new( Vec :: new( ) ) ;
363+ static UNDELEGATE_CALLS : RefCell <Vec <( AccountId , AccountId , Asset <AssetId >, Balance ) >> = RefCell :: new( Vec :: new( ) ) ;
364364}
365365
366366pub struct MockRewardsManager ;
367367
368368impl RewardsManager < AccountId , AssetId , Balance , BlockNumber > for MockRewardsManager {
369369 type Error = DispatchError ;
370370
371- fn record_deposit (
371+ fn record_delegate (
372372 account_id : & AccountId ,
373+ operator : & AccountId ,
373374 asset : Asset < AssetId > ,
374375 amount : Balance ,
375376 lock_multiplier : Option < LockMultiplier > ,
376377 ) -> Result < ( ) , Self :: Error > {
377- DEPOSIT_CALLS . with ( |calls| {
378- calls. borrow_mut ( ) . push ( ( account_id. clone ( ) , asset, amount, lock_multiplier) ) ;
378+ DELEGATE_CALLS . with ( |calls| {
379+ calls. borrow_mut ( ) . push ( (
380+ account_id. clone ( ) ,
381+ operator. clone ( ) ,
382+ asset,
383+ amount,
384+ lock_multiplier,
385+ ) ) ;
379386 } ) ;
380387 Ok ( ( ) )
381388 }
382389
383- fn record_withdrawal (
390+ fn record_undelegate (
384391 account_id : & AccountId ,
392+ operator : & AccountId ,
385393 asset : Asset < AssetId > ,
386394 amount : Balance ,
387395 ) -> Result < ( ) , Self :: Error > {
388- WITHDRAWAL_CALLS . with ( |calls| {
389- calls. borrow_mut ( ) . push ( ( account_id. clone ( ) , asset, amount) ) ;
396+ UNDELEGATE_CALLS . with ( |calls| {
397+ calls. borrow_mut ( ) . push ( ( account_id. clone ( ) , operator . clone ( ) , asset, amount) ) ;
390398 } ) ;
391399 Ok ( ( ) )
392400 }
@@ -409,18 +417,18 @@ impl RewardsManager<AccountId, AssetId, Balance, BlockNumber> for MockRewardsMan
409417}
410418
411419impl MockRewardsManager {
412- pub fn record_deposit_calls (
413- ) -> Vec < ( AccountId , Asset < AssetId > , Balance , Option < LockMultiplier > ) > {
414- DEPOSIT_CALLS . with ( |calls| calls. borrow ( ) . clone ( ) )
420+ pub fn record_delegate_calls (
421+ ) -> Vec < ( AccountId , AccountId , Asset < AssetId > , Balance , Option < LockMultiplier > ) > {
422+ DELEGATE_CALLS . with ( |calls| calls. borrow ( ) . clone ( ) )
415423 }
416424
417- pub fn record_withdrawal_calls ( ) -> Vec < ( AccountId , Asset < AssetId > , Balance ) > {
418- WITHDRAWAL_CALLS . with ( |calls| calls. borrow ( ) . clone ( ) )
425+ pub fn record_undelegate_calls ( ) -> Vec < ( AccountId , AccountId , Asset < AssetId > , Balance ) > {
426+ UNDELEGATE_CALLS . with ( |calls| calls. borrow ( ) . clone ( ) )
419427 }
420428
421429 pub fn clear_all ( ) {
422- DEPOSIT_CALLS . with ( |calls| calls. borrow_mut ( ) . clear ( ) ) ;
423- WITHDRAWAL_CALLS . with ( |calls| calls. borrow_mut ( ) . clear ( ) ) ;
430+ DELEGATE_CALLS . with ( |calls| calls. borrow_mut ( ) . clear ( ) ) ;
431+ UNDELEGATE_CALLS . with ( |calls| calls. borrow_mut ( ) . clear ( ) ) ;
424432 }
425433}
426434
0 commit comments