1use crate::H256;
16use pallet_revive::evm::H160;
17#[cfg(feature = "std")]
18use std::fmt::Debug;
19use subxt::{
20 events::StaticEvent,
21 ext::{
22 scale_decode,
23 scale_encode,
24 },
25};
26
27#[derive(
29 Debug,
30 scale::Decode,
31 scale::Encode,
32 scale_decode::DecodeAsType,
33 scale_encode::EncodeAsType,
34)]
35#[decode_as_type(trait_bounds = "", crate_path = "subxt::ext::scale_decode")]
36#[encode_as_type(crate_path = "subxt::ext::scale_encode")]
37pub struct ContractInstantiatedEvent {
38 pub deployer: H160,
40 pub contract: H160,
42}
43
44impl StaticEvent for ContractInstantiatedEvent {
45 const PALLET: &'static str = "Revive";
46 const EVENT: &'static str = "Instantiated";
47}
48
49#[derive(
51 Debug,
52 scale::Decode,
53 scale::Encode,
54 scale_decode::DecodeAsType,
55 scale_encode::EncodeAsType,
56)]
57#[decode_as_type(trait_bounds = "", crate_path = "subxt::ext::scale_decode")]
58#[encode_as_type(crate_path = "subxt::ext::scale_encode")]
59pub struct CodeStoredEvent {
60 pub code_hash: H256,
62}
63
64impl StaticEvent for CodeStoredEvent {
65 const PALLET: &'static str = "Revive";
66 const EVENT: &'static str = "CodeStored";
67}
68
69#[derive(
70 scale::Decode,
71 scale::Encode,
72 scale_decode::DecodeAsType,
73 scale_encode::EncodeAsType,
74 Debug,
75)]
76#[decode_as_type(trait_bounds = "", crate_path = "subxt::ext::scale_decode")]
77#[encode_as_type(crate_path = "subxt::ext::scale_encode")]
78pub struct ContractEmitted {
80 pub contract: H160,
81 pub data: Vec<u8>,
82 pub topics: Vec<H256>,
83}
84
85impl StaticEvent for ContractEmitted {
86 const PALLET: &'static str = "Revive";
87 const EVENT: &'static str = "ContractEmitted";
88}
89
90pub struct EventWithTopics<T> {
92 pub topics: Vec<H256>,
93 pub event: T,
94}