mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 09:37:55 +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:
@@ -59,6 +59,7 @@ pallet-im-online = { version = "2.0.0", default-features = false, path = "../../
|
||||
pallet-indices = { version = "2.0.0", default-features = false, path = "../../../frame/indices" }
|
||||
pallet-identity = { version = "2.0.0", default-features = false, path = "../../../frame/identity" }
|
||||
pallet-membership = { version = "2.0.0", default-features = false, path = "../../../frame/membership" }
|
||||
pallet-mmr = { version = "2.0.0", default-features = false, path = "../../../frame/merkle-mountain-range" }
|
||||
pallet-multisig = { version = "2.0.0", default-features = false, path = "../../../frame/multisig" }
|
||||
pallet-offences = { version = "2.0.0", default-features = false, path = "../../../frame/offences" }
|
||||
pallet-offences-benchmarking = { version = "2.0.0", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
|
||||
@@ -110,6 +111,7 @@ std = [
|
||||
"pallet-indices/std",
|
||||
"sp-inherents/std",
|
||||
"pallet-membership/std",
|
||||
"pallet-mmr/std",
|
||||
"pallet-multisig/std",
|
||||
"pallet-identity/std",
|
||||
"pallet-scheduler/std",
|
||||
@@ -160,6 +162,7 @@ runtime-benchmarks = [
|
||||
"pallet-identity/runtime-benchmarks",
|
||||
"pallet-im-online/runtime-benchmarks",
|
||||
"pallet-indices/runtime-benchmarks",
|
||||
"pallet-mmr/runtime-benchmarks",
|
||||
"pallet-multisig/runtime-benchmarks",
|
||||
"pallet-proxy/runtime-benchmarks",
|
||||
"pallet-scheduler/runtime-benchmarks",
|
||||
|
||||
@@ -915,6 +915,15 @@ impl pallet_vesting::Config for Runtime {
|
||||
type WeightInfo = pallet_vesting::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_mmr::Config for Runtime {
|
||||
const INDEXING_PREFIX: &'static [u8] = b"mmr";
|
||||
type Hashing = <Runtime as frame_system::Config>::Hashing;
|
||||
type Hash = <Runtime as frame_system::Config>::Hash;
|
||||
type LeafData = frame_system::Module<Self>;
|
||||
type OnNewRoot = ();
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const AssetDepositBase: Balance = 100 * DOLLARS;
|
||||
pub const AssetDepositPerZombie: Balance = 1 * DOLLARS;
|
||||
@@ -969,6 +978,7 @@ construct_runtime!(
|
||||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>},
|
||||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>},
|
||||
Assets: pallet_assets::{Module, Call, Storage, Event<T>},
|
||||
Mmr: pallet_mmr::{Module, Storage},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1246,6 +1256,7 @@ impl_runtime_apis! {
|
||||
add_benchmark!(params, batches, pallet_identity, Identity);
|
||||
add_benchmark!(params, batches, pallet_im_online, ImOnline);
|
||||
add_benchmark!(params, batches, pallet_indices, Indices);
|
||||
add_benchmark!(params, batches, pallet_mmr, Mmr);
|
||||
add_benchmark!(params, batches, pallet_multisig, Multisig);
|
||||
add_benchmark!(params, batches, pallet_offences, OffencesBench::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_proxy, Proxy);
|
||||
|
||||
Reference in New Issue
Block a user