@@ -179,16 +179,16 @@ pub mod pallet {
179
179
#[ pallet:: event]
180
180
#[ pallet:: generate_deposit( pub ( super ) fn deposit_event) ]
181
181
pub enum Event < T : Config > {
182
- /// A new tip suggestion has been opened. \[tip_hash\]
183
- NewTip ( T :: Hash ) ,
184
- /// A tip suggestion has reached threshold and is closing. \[tip_hash\]
185
- TipClosing ( T :: Hash ) ,
186
- /// A tip suggestion has been closed. \[tip_hash, who, payout\]
187
- TipClosed ( T :: Hash , T :: AccountId , BalanceOf < T > ) ,
188
- /// A tip suggestion has been retracted. \[tip_hash\]
189
- TipRetracted ( T :: Hash ) ,
190
- /// A tip suggestion has been slashed. \[tip_hash, finder, deposit\]
191
- TipSlashed ( T :: Hash , T :: AccountId , BalanceOf < T > ) ,
182
+ /// A new tip suggestion has been opened.
183
+ NewTip { tip_hash : T :: Hash } ,
184
+ /// A tip suggestion has reached threshold and is closing.
185
+ TipClosing { tip_hash : T :: Hash } ,
186
+ /// A tip suggestion has been closed.
187
+ TipClosed { tip_hash : T :: Hash , who : T :: AccountId , payout : BalanceOf < T > } ,
188
+ /// A tip suggestion has been retracted.
189
+ TipRetracted { tip_hash : T :: Hash } ,
190
+ /// A tip suggestion has been slashed.
191
+ TipSlashed { tip_hash : T :: Hash , finder : T :: AccountId , deposit : BalanceOf < T > } ,
192
192
}
193
193
194
194
/// Old name generated by `decl_event`.
@@ -265,7 +265,7 @@ pub mod pallet {
265
265
finders_fee : true ,
266
266
} ;
267
267
Tips :: < T > :: insert ( & hash, tip) ;
268
- Self :: deposit_event ( Event :: NewTip ( hash) ) ;
268
+ Self :: deposit_event ( Event :: NewTip { tip_hash : hash } ) ;
269
269
Ok ( ( ) )
270
270
}
271
271
@@ -300,7 +300,7 @@ pub mod pallet {
300
300
let err_amount = T :: Currency :: unreserve ( & who, tip. deposit ) ;
301
301
debug_assert ! ( err_amount. is_zero( ) ) ;
302
302
}
303
- Self :: deposit_event ( Event :: TipRetracted ( hash) ) ;
303
+ Self :: deposit_event ( Event :: TipRetracted { tip_hash : hash } ) ;
304
304
Ok ( ( ) )
305
305
}
306
306
@@ -340,7 +340,7 @@ pub mod pallet {
340
340
let hash = T :: Hashing :: hash_of ( & ( & reason_hash, & who) ) ;
341
341
342
342
Reasons :: < T > :: insert ( & reason_hash, & reason) ;
343
- Self :: deposit_event ( Event :: NewTip ( hash. clone ( ) ) ) ;
343
+ Self :: deposit_event ( Event :: NewTip { tip_hash : hash. clone ( ) } ) ;
344
344
let tips = vec ! [ ( tipper. clone( ) , tip_value) ] ;
345
345
let tip = OpenTip {
346
346
reason : reason_hash,
@@ -390,7 +390,7 @@ pub mod pallet {
390
390
391
391
let mut tip = Tips :: < T > :: get ( hash) . ok_or ( Error :: < T > :: UnknownTip ) ?;
392
392
if Self :: insert_tip_and_check_closing ( & mut tip, tipper, tip_value) {
393
- Self :: deposit_event ( Event :: TipClosing ( hash. clone ( ) ) ) ;
393
+ Self :: deposit_event ( Event :: TipClosing { tip_hash : hash. clone ( ) } ) ;
394
394
}
395
395
Tips :: < T > :: insert ( & hash, tip) ;
396
396
Ok ( ( ) )
@@ -449,7 +449,11 @@ pub mod pallet {
449
449
T :: OnSlash :: on_unbalanced ( imbalance) ;
450
450
}
451
451
Reasons :: < T > :: remove ( & tip. reason ) ;
452
- Self :: deposit_event ( Event :: TipSlashed ( hash, tip. finder , tip. deposit ) ) ;
452
+ Self :: deposit_event ( Event :: TipSlashed {
453
+ tip_hash : hash,
454
+ finder : tip. finder ,
455
+ deposit : tip. deposit ,
456
+ } ) ;
453
457
Ok ( ( ) )
454
458
}
455
459
}
@@ -544,7 +548,7 @@ impl<T: Config> Pallet<T> {
544
548
// same as above: best-effort only.
545
549
let res = T :: Currency :: transfer ( & treasury, & tip. who , payout, KeepAlive ) ;
546
550
debug_assert ! ( res. is_ok( ) ) ;
547
- Self :: deposit_event ( Event :: TipClosed ( hash, tip. who , payout) ) ;
551
+ Self :: deposit_event ( Event :: TipClosed { tip_hash : hash, who : tip. who , payout } ) ;
548
552
}
549
553
550
554
pub fn migrate_retract_tip_for_tip_new ( module : & [ u8 ] , item : & [ u8 ] ) {
0 commit comments