cfx_types/
address_with_space.rs

1use crate::space::Space;
2use ethereum_types::Address;
3
4#[derive(Default, Eq, PartialEq, Hash, Copy, Clone, Debug, Ord, PartialOrd)]
5pub struct AddressWithSpace {
6    pub address: Address,
7    pub space: Space,
8}
9
10impl AddressWithSpace {
11    #[inline]
12    pub fn assert_native(&self) { assert_eq!(self.space, Space::Native) }
13
14    #[inline]
15    pub fn assert_ethereum(&self) { assert_eq!(self.space, Space::Ethereum) }
16}