This commit is contained in:
Hardhat Chad
2024-02-15 19:50:39 +00:00
parent 8d743d4f63
commit e5e39364dc
3 changed files with 26 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
use std::mem::transmute;
use std::{fmt, mem::transmute};
use bytemuck::{Pod, Zeroable};
use solana_program::keccak::{Hash as KeccakHash, HASH_BYTES};
@@ -23,4 +23,10 @@ impl From<Hash> for KeccakHash {
}
}
impl fmt::Display for Hash {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", bs58::encode(self.0).into_string())
}
}
impl_to_bytes!(Hash);