Skip to content

Commit 612a320

Browse files
committed
remove logs from state file
1 parent 324642b commit 612a320

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

‎core/src/common/state.rs‎

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use sp_runtime::{
3535
DeserializeOwned,
3636
};
3737
use sp_state_machine::{OverlayedChanges, StateMachine, TestExternalities, TrieBackendBuilder};
38-
use substrate_rpc_client::{ws_client, ChainApi, SystemApi};
38+
use substrate_rpc_client::{ws_client, ChainApi};
3939

4040
use crate::{
4141
common::{
@@ -111,33 +111,19 @@ impl LiveState {
111111
{
112112
// We want to execute the block `at`, therefore need the state of the block *before* it.
113113
let at = self.at::<Block>()?;
114-
log::debug!(target: LOG_TARGET, "Fetching previous block state relative to block {:?}", at);
115114

116115
// Get the block number requested by the user, or the current block number if they
117116
// didn't specify one.
118117
let rpc = ws_client(&self.uri[0]).await?;
119118

120-
let chain = SystemApi::<(), ()>::system_chain(&rpc)
121-
.await
122-
.map_err(rpc_err_handler)?;
123-
let name = SystemApi::<(), ()>::system_name(&rpc)
124-
.await
125-
.map_err(rpc_err_handler)?;
126-
let version = SystemApi::<(), ()>::system_version(&rpc)
127-
.await
128-
.map_err(rpc_err_handler)?;
129-
log::info!(target: LOG_TARGET, "Connected to '{chain}' (node: {name} v{version}) at {}", &self.uri[0]);
130-
131119
let previous_hash = ChainApi::<(), Block::Hash, Block::Header, ()>::header(&rpc, at)
132120
.await
133121
.map_err(rpc_err_handler)
134122
.and_then(|maybe_header| {
135-
maybe_header.ok_or("header_not_found").map(|h| {
136-
log::debug!(target: LOG_TARGET, "Header at block {:?}: {:?}", at, h);
137-
*h.parent_hash()
138-
})
123+
maybe_header
124+
.ok_or("header_not_found")
125+
.map(|h| *h.parent_hash())
139126
})?;
140-
log::debug!(target: LOG_TARGET, "Resolved previous block hash: {:?}", previous_hash);
141127

142128
Ok(LiveState {
143129
at: Some(hex::encode(previous_hash)),

0 commit comments

Comments
 (0)