Add a non-canonical SCALE derivations feature

Enables representing IUMT within `StorageValues`. Applied to a variety of
values.

Fixes a bug where `Some([0; 32])` would be considered a valid block anchor.
This commit is contained in:
Luke Parker
2025-03-06 03:19:29 -05:00
parent 35db2924b4
commit b08ae8e6a7
6 changed files with 40 additions and 41 deletions

View File

@@ -67,7 +67,8 @@ impl UnbalancedMerkleTree {
}
/// An unbalanced Merkle tree which is incrementally created.
#[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
#[derive(Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "non_canonical_scale_derivations", derive(scale::Encode, scale::Decode))]
pub struct IncrementalUnbalancedMerkleTree {
/// (number of children under branch, branch hash)
branches: Vec<(u64, [u8; 32])>,