@@ -46,7 +46,7 @@ use sp_core::{
4646} ;
4747use sp_io:: { crypto:: secp256k1_ecdsa_recover_compressed, hashing:: blake2_256} ;
4848use sp_runtime:: {
49- traits:: { Convert , Dispatchable , Hash , Zero } ,
49+ traits:: { Convert , Dispatchable , Zero } ,
5050 DispatchError ,
5151} ;
5252use sp_std:: { fmt:: Debug , marker:: PhantomData , mem, prelude:: * , vec:: Vec } ;
@@ -983,16 +983,16 @@ where
983983 let caller = self . caller ( ) . account_id ( ) ?. clone ( ) ;
984984
985985 // Deposit an instantiation event.
986- Contracts :: < T > :: deposit_event (
987- vec ! [ T :: Hashing :: hash_of ( & caller ) , T :: Hashing :: hash_of ( account_id ) ] ,
988- Event :: Instantiated { deployer : caller , contract : account_id. clone ( ) } ,
989- ) ;
986+ Contracts :: < T > :: deposit_event ( Event :: Instantiated {
987+ deployer : caller ,
988+ contract : account_id. clone ( ) ,
989+ } ) ;
990990 } ,
991991 ( ExportedFunction :: Call , Some ( code_hash) ) => {
992- Contracts :: < T > :: deposit_event (
993- vec ! [ T :: Hashing :: hash_of ( account_id ) , T :: Hashing :: hash_of ( & code_hash ) ] ,
994- Event :: DelegateCalled { contract : account_id . clone ( ) , code_hash } ,
995- ) ;
992+ Contracts :: < T > :: deposit_event ( Event :: DelegateCalled {
993+ contract : account_id . clone ( ) ,
994+ code_hash,
995+ } ) ;
996996 } ,
997997 ( ExportedFunction :: Call , None ) => {
998998 // If a special limit was set for the sub-call, we enforce it here.
@@ -1002,10 +1002,10 @@ where
10021002 frame. nested_storage . enforce_subcall_limit ( contract) ?;
10031003
10041004 let caller = self . caller ( ) ;
1005- Contracts :: < T > :: deposit_event (
1006- vec ! [ T :: Hashing :: hash_of ( & caller) , T :: Hashing :: hash_of ( & account_id ) ] ,
1007- Event :: Called { caller : caller . clone ( ) , contract : account_id. clone ( ) } ,
1008- ) ;
1005+ Contracts :: < T > :: deposit_event ( Event :: Called {
1006+ caller : caller . clone ( ) ,
1007+ contract : account_id. clone ( ) ,
1008+ } ) ;
10091009 } ,
10101010 }
10111011
@@ -1324,13 +1324,10 @@ where
13241324 . charge_deposit ( frame. account_id . clone ( ) , StorageDeposit :: Refund ( * deposit) ) ;
13251325 }
13261326
1327- Contracts :: < T > :: deposit_event (
1328- vec ! [ T :: Hashing :: hash_of( & frame. account_id) , T :: Hashing :: hash_of( & beneficiary) ] ,
1329- Event :: Terminated {
1330- contract : frame. account_id . clone ( ) ,
1331- beneficiary : beneficiary. clone ( ) ,
1332- } ,
1333- ) ;
1327+ Contracts :: < T > :: deposit_event ( Event :: Terminated {
1328+ contract : frame. account_id . clone ( ) ,
1329+ beneficiary : beneficiary. clone ( ) ,
1330+ } ) ;
13341331 Ok ( ( ) )
13351332 }
13361333
@@ -1422,7 +1419,7 @@ where
14221419 }
14231420
14241421 fn deposit_event ( & mut self , topics : Vec < T :: Hash > , data : Vec < u8 > ) {
1425- Contracts :: < Self :: T > :: deposit_event (
1422+ Contracts :: < Self :: T > :: deposit_indexed_event (
14261423 topics,
14271424 Event :: ContractEmitted { contract : self . top_frame ( ) . account_id . clone ( ) , data } ,
14281425 ) ;
@@ -1527,14 +1524,11 @@ where
15271524
15281525 Self :: increment_refcount ( hash) ?;
15291526 Self :: decrement_refcount ( prev_hash) ;
1530- Contracts :: < Self :: T > :: deposit_event (
1531- vec ! [ T :: Hashing :: hash_of( & frame. account_id) , hash, prev_hash] ,
1532- Event :: ContractCodeUpdated {
1533- contract : frame. account_id . clone ( ) ,
1534- new_code_hash : hash,
1535- old_code_hash : prev_hash,
1536- } ,
1537- ) ;
1527+ Contracts :: < Self :: T > :: deposit_event ( Event :: ContractCodeUpdated {
1528+ contract : frame. account_id . clone ( ) ,
1529+ new_code_hash : hash,
1530+ old_code_hash : prev_hash,
1531+ } ) ;
15381532 Ok ( ( ) )
15391533 }
15401534
@@ -1639,7 +1633,7 @@ mod tests {
16391633 exec:: ExportedFunction :: * ,
16401634 gas:: GasMeter ,
16411635 tests:: {
1642- test_utils:: { get_balance, hash , place_contract, set_balance} ,
1636+ test_utils:: { get_balance, place_contract, set_balance} ,
16431637 ExtBuilder , RuntimeCall , RuntimeEvent as MetaEvent , Test , TestFilter , ALICE , BOB ,
16441638 CHARLIE , GAS_LIMIT ,
16451639 } ,
@@ -3164,7 +3158,7 @@ mod tests {
31643158 caller: Origin :: from_account_id( ALICE ) ,
31653159 contract: BOB ,
31663160 } ) ,
3167- topics: vec![ hash ( & Origin :: < Test > :: from_account_id ( ALICE ) ) , hash ( & BOB ) ] ,
3161+ topics: vec![ ] ,
31683162 } ,
31693163 ]
31703164 ) ;
@@ -3264,7 +3258,7 @@ mod tests {
32643258 caller: Origin :: from_account_id( ALICE ) ,
32653259 contract: BOB ,
32663260 } ) ,
3267- topics: vec![ hash ( & Origin :: < Test > :: from_account_id ( ALICE ) ) , hash ( & BOB ) ] ,
3261+ topics: vec![ ] ,
32683262 } ,
32693263 ]
32703264 ) ;
0 commit comments