MMR: move RPC code from frame/ to client/ (#12805)

* mmr: move MMR RPC from frame/ to client/

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* client/mmr: adjust logging levels to avoid spam

* cargo fmt

* remove unused imports

Signed-off-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
Adrian Catangiu
2022-11-30 10:37:29 +02:00
committed by GitHub
parent 04e883d310
commit 6a5bac18d2
10 changed files with 39 additions and 41 deletions
@@ -57,10 +57,17 @@
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::{log, weights::Weight};
use sp_mmr_primitives::utils;
use sp_runtime::{
traits::{self, One, Saturating},
SaturatedConversion,
};
use sp_std::prelude::*;
pub use pallet::*;
pub use sp_mmr_primitives::{
self as primitives, utils::NodesUtils, Error, LeafDataProvider, LeafIndex, NodeIndex,
};
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
@@ -71,13 +78,6 @@ mod mock;
#[cfg(test)]
mod tests;
pub use pallet::*;
use sp_mmr_primitives::utils;
pub use sp_mmr_primitives::{
self as primitives, utils::NodesUtils, Error, LeafDataProvider, LeafIndex, NodeIndex,
};
use sp_std::prelude::*;
/// The most common use case for MMRs is to store historical block hashes,
/// so that any point in time in the future we can receive a proof about some past
/// blocks without using excessive on-chain storage.
@@ -29,7 +29,6 @@ use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup, Keccak256},
};
use sp_std::prelude::*;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;