Add initial basic tests for serai-client-serai

This commit is contained in:
Luke Parker
2025-11-06 20:12:37 -05:00
parent 1866bb7ae3
commit ce08fad931
7 changed files with 147 additions and 26 deletions

View File

@@ -3,6 +3,7 @@
#![deny(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]
use core::fmt;
extern crate alloc;
use zeroize::Zeroize;
@@ -82,6 +83,15 @@ impl From<sp_core::H256> for BlockHash {
}
}
impl fmt::Display for BlockHash {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for byte in self.0 {
write!(f, "{byte:02x}")?;
}
Ok(())
}
}
// These share encodings as 32-byte arrays
#[cfg(feature = "non_canonical_scale_derivations")]
impl scale::EncodeLike<sp_core::H256> for BlockHash {}