mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 00:57:57 +00:00
Merkle Mountain Range pallet (#7312)
* Add MMR pallet. * WiP * Working on testing. * WiP - test * Tests passing. * Add proof generation. * Generate and verify proofs. * Allow verification of older proofs. * Move stuff to a module. * Split MMR stuff to it's own module. * Add docs. * Make parent hash optional. * LeafData failed approach. * Finally implement Compact stuff. * Compact encoding WiP * Implement remaining pieces. * Fix tests * Add docs to compact. * Implement for tuples. * Fix documentation. * Fix warnings and address review suggestion. * Update frame/merkle-mountain-range/src/primitives.rs Co-authored-by: cheme <emericchevalier.pro@gmail.com> * Address review grumbles. * Removing missing crate. * Fix test. * Add some docs and test. * Add multiple instances. * Cargo.toml sync. * Fix no_std compilation. * More no_std stuff. * Rename MMR struct. * Addressing other grumbles. * Fix test. * Remove format for no_std compat. * Add test for MMR pallet. * Fix std feature. * Update versions. * Add to node/runtime. * Add hook to insert digest. * Make primitives public. * Update lib.rs tech spec/typos etc * Use WeightInfo and benchmarks. * Fix test. * Fix benchmarks. * Trait -> Config. * Fix typo. * Fix tests. Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Addie Wagenknecht <addie@nortd.com>
This commit is contained in:
@@ -452,7 +452,7 @@ pub trait BlockNumberProvider {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sp_core::offchain::{testing, OffchainExt, OffchainStorage};
|
||||
use sp_core::offchain::{testing, OffchainExt};
|
||||
use sp_io::TestExternalities;
|
||||
|
||||
const VAL_1: u32 = 0u32;
|
||||
@@ -485,7 +485,7 @@ mod tests {
|
||||
}
|
||||
});
|
||||
// lock must have been cleared at this point
|
||||
assert_eq!(state.read().persistent_storage.get(b"", b"lock_1"), None);
|
||||
assert_eq!(state.read().persistent_storage.get(b"lock_1"), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -508,7 +508,7 @@ mod tests {
|
||||
guard.forget();
|
||||
});
|
||||
// lock must have been cleared at this point
|
||||
let opt = state.read().persistent_storage.get(b"", b"lock_2");
|
||||
let opt = state.read().persistent_storage.get(b"lock_2");
|
||||
assert!(opt.is_some());
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ mod tests {
|
||||
});
|
||||
|
||||
// lock must have been cleared at this point
|
||||
let opt = state.read().persistent_storage.get(b"", b"lock_3");
|
||||
let opt = state.read().persistent_storage.get(b"lock_3");
|
||||
assert!(opt.is_some());
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ mod tests {
|
||||
});
|
||||
|
||||
// lock must have been cleared at this point
|
||||
let opt = state.read().persistent_storage.get(b"", b"lock_4");
|
||||
let opt = state.read().persistent_storage.get(b"lock_4");
|
||||
assert_eq!(opt.unwrap(), vec![132_u8, 3u8, 0, 0, 0, 0, 0, 0]); // 132 + 256 * 3 = 900
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user