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
@@ -44,7 +44,7 @@ pub mod test_utils;
use std::{marker::PhantomData, sync::Arc};
use futures::StreamExt;
use log::{debug, error, trace, warn};
use log::{error, trace, warn};
use sc_client_api::{Backend, BlockchainEvents, FinalityNotifications};
use sc_offchain::OffchainDb;
@@ -110,13 +110,16 @@ where
}
},
_ => {
trace!(target: LOG_TARGET, "Finality notification: {:?}", notification);
debug!(target: LOG_TARGET, "Waiting for MMR pallet to become available ...");
trace!(
target: LOG_TARGET,
"Waiting for MMR pallet to become available... (best finalized {:?})",
notification.header.number()
);
},
}
}
warn!(
error!(
target: LOG_TARGET,
"Finality notifications stream closed unexpectedly. \
Couldn't build the canonicalization engine",
@@ -66,7 +66,7 @@ where
match self.client.header_metadata(hash) {
Ok(header) => Some(header),
_ => {
error!(
debug!(
target: LOG_TARGET,
"Block {} not found. Couldn't {} associated branch.", hash, action
);
@@ -168,7 +168,7 @@ where
canon_key
);
} else {
error!(
debug!(
target: LOG_TARGET,
"Couldn't canonicalize elem at pos {} using temp key {:?}", pos, temp_key
);