@@ -425,16 +425,18 @@ pub enum StakerStatus<AccountId> {
425425
426426/// A destination account for payment.
427427#[ derive( PartialEq , Eq , Copy , Clone , Encode , Decode , RuntimeDebug ) ]
428- pub enum RewardDestination {
428+ pub enum RewardDestination < AccountId > {
429429 /// Pay into the stash account, increasing the amount at stake accordingly.
430430 Staked ,
431431 /// Pay into the stash account, not increasing the amount at stake.
432432 Stash ,
433433 /// Pay into the controller account.
434434 Controller ,
435+ /// Pay into a specified account.
436+ Account ( AccountId ) ,
435437}
436438
437- impl Default for RewardDestination {
439+ impl < AccountId > Default for RewardDestination < AccountId > {
438440 fn default ( ) -> Self {
439441 RewardDestination :: Staked
440442 }
@@ -1049,7 +1051,7 @@ decl_storage! {
10491051 => Option <StakingLedger <T :: AccountId , BalanceOf <T >>>;
10501052
10511053 /// Where the reward payment should be made. Keyed by stash.
1052- pub Payee get( fn payee) : map hasher( twox_64_concat) T :: AccountId => RewardDestination ;
1054+ pub Payee get( fn payee) : map hasher( twox_64_concat) T :: AccountId => RewardDestination < T :: AccountId > ;
10531055
10541056 /// The map from (wannabe) validator stash key to the preferences of that validator.
10551057 pub Validators get( fn validators) :
@@ -1496,7 +1498,7 @@ decl_module! {
14961498 pub fn bond( origin,
14971499 controller: <T :: Lookup as StaticLookup >:: Source ,
14981500 #[ compact] value: BalanceOf <T >,
1499- payee: RewardDestination ,
1501+ payee: RewardDestination < T :: AccountId > ,
15001502 ) {
15011503 let stash = ensure_signed( origin) ?;
15021504
@@ -1830,7 +1832,7 @@ decl_module! {
18301832 /// - Write: Payee
18311833 /// # </weight>
18321834 #[ weight = 11 * WEIGHT_PER_MICROS + T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ]
1833- fn set_payee( origin, payee: RewardDestination ) {
1835+ fn set_payee( origin, payee: RewardDestination < T :: AccountId > ) {
18341836 let controller = ensure_signed( origin) ?;
18351837 let ledger = Self :: ledger( & controller) . ok_or( Error :: <T >:: NotController ) ?;
18361838 let stash = & ledger. stash;
@@ -2489,6 +2491,9 @@ impl<T: Trait> Module<T> {
24892491 Self :: update_ledger ( & controller, & l) ;
24902492 r
24912493 } ) ,
2494+ RewardDestination :: Account ( dest_account) => {
2495+ Some ( T :: Currency :: deposit_creating ( & dest_account, amount) )
2496+ }
24922497 }
24932498 }
24942499
0 commit comments