hopr_bindings/codegen/
hopr_announcements_events.rs

1pub use hopr_announcements_events::*;
2/// This module was auto-generated with ethers-rs Abigen.
3/// More information at: <https://github.com/gakonst/ethers-rs>
4#[allow(
5    clippy::enum_variant_names,
6    clippy::too_many_arguments,
7    clippy::upper_case_acronyms,
8    clippy::type_complexity,
9    dead_code,
10    non_camel_case_types,
11)]
12pub mod hopr_announcements_events {
13    #[allow(deprecated)]
14    fn __abi() -> ::ethers::core::abi::Abi {
15        ::ethers::core::abi::ethabi::Contract {
16            constructor: ::core::option::Option::None,
17            functions: ::std::collections::BTreeMap::new(),
18            events: ::core::convert::From::from([
19                (
20                    ::std::borrow::ToOwned::to_owned("AddressAnnouncement"),
21                    ::std::vec![
22                        ::ethers::core::abi::ethabi::Event {
23                            name: ::std::borrow::ToOwned::to_owned(
24                                "AddressAnnouncement",
25                            ),
26                            inputs: ::std::vec![
27                                ::ethers::core::abi::ethabi::EventParam {
28                                    name: ::std::borrow::ToOwned::to_owned("node"),
29                                    kind: ::ethers::core::abi::ethabi::ParamType::Address,
30                                    indexed: false,
31                                },
32                                ::ethers::core::abi::ethabi::EventParam {
33                                    name: ::std::borrow::ToOwned::to_owned("baseMultiaddr"),
34                                    kind: ::ethers::core::abi::ethabi::ParamType::String,
35                                    indexed: false,
36                                },
37                            ],
38                            anonymous: false,
39                        },
40                    ],
41                ),
42                (
43                    ::std::borrow::ToOwned::to_owned("KeyBinding"),
44                    ::std::vec![
45                        ::ethers::core::abi::ethabi::Event {
46                            name: ::std::borrow::ToOwned::to_owned("KeyBinding"),
47                            inputs: ::std::vec![
48                                ::ethers::core::abi::ethabi::EventParam {
49                                    name: ::std::borrow::ToOwned::to_owned("ed25519_sig_0"),
50                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
51                                        32usize,
52                                    ),
53                                    indexed: false,
54                                },
55                                ::ethers::core::abi::ethabi::EventParam {
56                                    name: ::std::borrow::ToOwned::to_owned("ed25519_sig_1"),
57                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
58                                        32usize,
59                                    ),
60                                    indexed: false,
61                                },
62                                ::ethers::core::abi::ethabi::EventParam {
63                                    name: ::std::borrow::ToOwned::to_owned("ed25519_pub_key"),
64                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
65                                        32usize,
66                                    ),
67                                    indexed: false,
68                                },
69                                ::ethers::core::abi::ethabi::EventParam {
70                                    name: ::std::borrow::ToOwned::to_owned("chain_key"),
71                                    kind: ::ethers::core::abi::ethabi::ParamType::Address,
72                                    indexed: false,
73                                },
74                            ],
75                            anonymous: false,
76                        },
77                    ],
78                ),
79                (
80                    ::std::borrow::ToOwned::to_owned("RevokeAnnouncement"),
81                    ::std::vec![
82                        ::ethers::core::abi::ethabi::Event {
83                            name: ::std::borrow::ToOwned::to_owned("RevokeAnnouncement"),
84                            inputs: ::std::vec![
85                                ::ethers::core::abi::ethabi::EventParam {
86                                    name: ::std::borrow::ToOwned::to_owned("node"),
87                                    kind: ::ethers::core::abi::ethabi::ParamType::Address,
88                                    indexed: false,
89                                },
90                            ],
91                            anonymous: false,
92                        },
93                    ],
94                ),
95            ]),
96            errors: ::std::collections::BTreeMap::new(),
97            receive: false,
98            fallback: false,
99        }
100    }
101    ///The parsed JSON ABI of the contract.
102    pub static HOPRANNOUNCEMENTSEVENTS_ABI: ::ethers::contract::Lazy<
103        ::ethers::core::abi::Abi,
104    > = ::ethers::contract::Lazy::new(__abi);
105    pub struct HoprAnnouncementsEvents<M>(::ethers::contract::Contract<M>);
106    impl<M> ::core::clone::Clone for HoprAnnouncementsEvents<M> {
107        fn clone(&self) -> Self {
108            Self(::core::clone::Clone::clone(&self.0))
109        }
110    }
111    impl<M> ::core::ops::Deref for HoprAnnouncementsEvents<M> {
112        type Target = ::ethers::contract::Contract<M>;
113        fn deref(&self) -> &Self::Target {
114            &self.0
115        }
116    }
117    impl<M> ::core::ops::DerefMut for HoprAnnouncementsEvents<M> {
118        fn deref_mut(&mut self) -> &mut Self::Target {
119            &mut self.0
120        }
121    }
122    impl<M> ::core::fmt::Debug for HoprAnnouncementsEvents<M> {
123        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
124            f.debug_tuple(::core::stringify!(HoprAnnouncementsEvents))
125                .field(&self.address())
126                .finish()
127        }
128    }
129    impl<M: ::ethers::providers::Middleware> HoprAnnouncementsEvents<M> {
130        /// Creates a new contract instance with the specified `ethers` client at
131        /// `address`. The contract derefs to a `ethers::Contract` object.
132        pub fn new<T: Into<::ethers::core::types::Address>>(
133            address: T,
134            client: ::std::sync::Arc<M>,
135        ) -> Self {
136            Self(
137                ::ethers::contract::Contract::new(
138                    address.into(),
139                    HOPRANNOUNCEMENTSEVENTS_ABI.clone(),
140                    client,
141                ),
142            )
143        }
144        ///Gets the contract's `AddressAnnouncement` event
145        pub fn address_announcement_filter(
146            &self,
147        ) -> ::ethers::contract::builders::Event<
148            ::std::sync::Arc<M>,
149            M,
150            AddressAnnouncementFilter,
151        > {
152            self.0.event()
153        }
154        ///Gets the contract's `KeyBinding` event
155        pub fn key_binding_filter(
156            &self,
157        ) -> ::ethers::contract::builders::Event<
158            ::std::sync::Arc<M>,
159            M,
160            KeyBindingFilter,
161        > {
162            self.0.event()
163        }
164        ///Gets the contract's `RevokeAnnouncement` event
165        pub fn revoke_announcement_filter(
166            &self,
167        ) -> ::ethers::contract::builders::Event<
168            ::std::sync::Arc<M>,
169            M,
170            RevokeAnnouncementFilter,
171        > {
172            self.0.event()
173        }
174        /// Returns an `Event` builder for all the events of this contract.
175        pub fn events(
176            &self,
177        ) -> ::ethers::contract::builders::Event<
178            ::std::sync::Arc<M>,
179            M,
180            HoprAnnouncementsEventsEvents,
181        > {
182            self.0.event_with_filter(::core::default::Default::default())
183        }
184    }
185    impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
186    for HoprAnnouncementsEvents<M> {
187        fn from(contract: ::ethers::contract::Contract<M>) -> Self {
188            Self::new(contract.address(), contract.client())
189        }
190    }
191    #[derive(
192        Clone,
193        ::ethers::contract::EthEvent,
194        ::ethers::contract::EthDisplay,
195        serde::Serialize,
196        serde::Deserialize,
197        Default,
198        Debug,
199        PartialEq,
200        Eq,
201        Hash
202    )]
203    #[ethevent(
204        name = "AddressAnnouncement",
205        abi = "AddressAnnouncement(address,string)"
206    )]
207    pub struct AddressAnnouncementFilter {
208        pub node: ::ethers::core::types::Address,
209        pub base_multiaddr: ::std::string::String,
210    }
211    #[derive(
212        Clone,
213        ::ethers::contract::EthEvent,
214        ::ethers::contract::EthDisplay,
215        serde::Serialize,
216        serde::Deserialize,
217        Default,
218        Debug,
219        PartialEq,
220        Eq,
221        Hash
222    )]
223    #[ethevent(name = "KeyBinding", abi = "KeyBinding(bytes32,bytes32,bytes32,address)")]
224    pub struct KeyBindingFilter {
225        pub ed_25519_sig_0: [u8; 32],
226        pub ed_25519_sig_1: [u8; 32],
227        pub ed_25519_pub_key: [u8; 32],
228        pub chain_key: ::ethers::core::types::Address,
229    }
230    #[derive(
231        Clone,
232        ::ethers::contract::EthEvent,
233        ::ethers::contract::EthDisplay,
234        serde::Serialize,
235        serde::Deserialize,
236        Default,
237        Debug,
238        PartialEq,
239        Eq,
240        Hash
241    )]
242    #[ethevent(name = "RevokeAnnouncement", abi = "RevokeAnnouncement(address)")]
243    pub struct RevokeAnnouncementFilter {
244        pub node: ::ethers::core::types::Address,
245    }
246    ///Container type for all of the contract's events
247    #[derive(
248        Clone,
249        ::ethers::contract::EthAbiType,
250        serde::Serialize,
251        serde::Deserialize,
252        Debug,
253        PartialEq,
254        Eq,
255        Hash
256    )]
257    pub enum HoprAnnouncementsEventsEvents {
258        AddressAnnouncementFilter(AddressAnnouncementFilter),
259        KeyBindingFilter(KeyBindingFilter),
260        RevokeAnnouncementFilter(RevokeAnnouncementFilter),
261    }
262    impl ::ethers::contract::EthLogDecode for HoprAnnouncementsEventsEvents {
263        fn decode_log(
264            log: &::ethers::core::abi::RawLog,
265        ) -> ::core::result::Result<Self, ::ethers::core::abi::Error> {
266            if let Ok(decoded) = AddressAnnouncementFilter::decode_log(log) {
267                return Ok(
268                    HoprAnnouncementsEventsEvents::AddressAnnouncementFilter(decoded),
269                );
270            }
271            if let Ok(decoded) = KeyBindingFilter::decode_log(log) {
272                return Ok(HoprAnnouncementsEventsEvents::KeyBindingFilter(decoded));
273            }
274            if let Ok(decoded) = RevokeAnnouncementFilter::decode_log(log) {
275                return Ok(
276                    HoprAnnouncementsEventsEvents::RevokeAnnouncementFilter(decoded),
277                );
278            }
279            Err(::ethers::core::abi::Error::InvalidData)
280        }
281    }
282    impl ::core::fmt::Display for HoprAnnouncementsEventsEvents {
283        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
284            match self {
285                Self::AddressAnnouncementFilter(element) => {
286                    ::core::fmt::Display::fmt(element, f)
287                }
288                Self::KeyBindingFilter(element) => ::core::fmt::Display::fmt(element, f),
289                Self::RevokeAnnouncementFilter(element) => {
290                    ::core::fmt::Display::fmt(element, f)
291                }
292            }
293        }
294    }
295    impl ::core::convert::From<AddressAnnouncementFilter>
296    for HoprAnnouncementsEventsEvents {
297        fn from(value: AddressAnnouncementFilter) -> Self {
298            Self::AddressAnnouncementFilter(value)
299        }
300    }
301    impl ::core::convert::From<KeyBindingFilter> for HoprAnnouncementsEventsEvents {
302        fn from(value: KeyBindingFilter) -> Self {
303            Self::KeyBindingFilter(value)
304        }
305    }
306    impl ::core::convert::From<RevokeAnnouncementFilter>
307    for HoprAnnouncementsEventsEvents {
308        fn from(value: RevokeAnnouncementFilter) -> Self {
309            Self::RevokeAnnouncementFilter(value)
310        }
311    }
312}