@@ -1167,7 +1167,7 @@ impl<T: Config> Pallet<T> {
11671167 data : Vec < u8 > ,
11681168 debug : bool ,
11691169 determinism : Determinism ,
1170- ) -> ContractExecResult < BalanceOf < T > > {
1170+ ) -> ContractExecResult < BalanceOf < T > , < T as frame_system :: Config > :: RuntimeEvent > {
11711171 let mut debug_message = if debug { Some ( DebugBufferVec :: < T > :: default ( ) ) } else { None } ;
11721172 let common = CommonInput {
11731173 origin,
@@ -1181,8 +1181,7 @@ impl<T: Config> Pallet<T> {
11811181 // We are good to call System::events() from the runtime API (i.e offchain).
11821182 // Even though it says it should only be used in tests, it is actually not allowed to be
11831183 // read on-chain cause it will put all the Events emitted in the block so far into the PoV.
1184- let events: Vec < Vec < u8 > > =
1185- System :: < T > :: events ( ) . iter ( ) . map ( |e| e. clone ( ) . event . encode ( ) ) . collect ( ) ; // todo: should determinism::Relaxed be checked here?
1184+ let events = System :: < T > :: events ( ) . iter ( ) . map ( |e| e. clone ( ) . event ) . collect :: < Vec < _ > > ( ) ; // todo: should determinism::Relaxed be checked here?
11861185 ContractExecResult {
11871186 result : output. result . map_err ( |r| r. error ) ,
11881187 gas_consumed : output. gas_meter . gas_consumed ( ) ,
@@ -1342,11 +1341,12 @@ impl<T: Config> Pallet<T> {
13421341sp_api:: decl_runtime_apis! {
13431342 /// The API used to dry-run contract interactions.
13441343 #[ api_version( 2 ) ]
1345- pub trait ContractsApi <AccountId , Balance , BlockNumber , Hash > where
1344+ pub trait ContractsApi <AccountId , Balance , BlockNumber , Hash , Event > where
13461345 AccountId : Codec ,
13471346 Balance : Codec ,
13481347 BlockNumber : Codec ,
13491348 Hash : Codec ,
1349+ Event : Codec ,
13501350 {
13511351 /// Perform a call from a specified account to a given contract.
13521352 ///
@@ -1358,7 +1358,7 @@ sp_api::decl_runtime_apis! {
13581358 gas_limit: Option <Weight >,
13591359 storage_deposit_limit: Option <Balance >,
13601360 input_data: Vec <u8 >,
1361- ) -> ContractExecResult <Balance >;
1361+ ) -> ContractExecResult <Balance , Event >;
13621362
13631363 /// Instantiate a new contract.
13641364 ///
0 commit comments