123456789101112131415161718192021222324 |
- use std::fmt::Display;
- use serde::Serialize;
- #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize)]
- pub struct AccountId(pub [u8; 32]);
- impl AccountId {
- pub fn new() -> Self {
- Self([0; 32])
- }
- }
- impl Display for AccountId {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- write!(f, "{}", hex::encode(self.0))
- }
- }
- impl AsRef<[u8]> for AccountId {
- fn as_ref(&self) -> &[u8] {
- &self.0
- }
- }
|