stratus/eth/storage/permanent/rocks/types/
address.rs1use std::fmt::Debug;
2
3use crate::eth::primitives::Address;
4use crate::eth::storage::permanent::rocks::SerializeDeserializeWithContext;
5
6#[derive(
7 Debug, Clone, Copy, Default, PartialEq, Eq, Hash, bincode::Encode, bincode::Decode, fake::Dummy, serde::Serialize, serde::Deserialize, PartialOrd, Ord,
8)]
9pub struct AddressRocksdb(#[serde(with = "const_hex")] pub [u8; 20]);
10
11impl From<Address> for AddressRocksdb {
12 fn from(item: Address) -> Self {
13 AddressRocksdb(item.0.into())
14 }
15}
16
17impl From<AddressRocksdb> for Address {
18 fn from(item: AddressRocksdb) -> Self {
19 item.0.into()
20 }
21}
22
23impl SerializeDeserializeWithContext for AddressRocksdb {}