mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 05:51:02 +00:00
Use LOG_TARGET in consensus related crates (#12875)
* Use shared LOG_TARGET in consensus related crates * Rename target from "afg" to "grandpa"
This commit is contained in:
@@ -41,7 +41,7 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use crate::{PowAlgorithm, PowIntermediate, Seal, INTERMEDIATE_KEY, POW_ENGINE_ID};
|
||||
use crate::{PowAlgorithm, PowIntermediate, Seal, INTERMEDIATE_KEY, LOG_TARGET, POW_ENGINE_ID};
|
||||
|
||||
/// Mining metadata. This is the information needed to start an actual mining loop.
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
@@ -159,26 +159,16 @@ where
|
||||
) {
|
||||
Ok(true) => (),
|
||||
Ok(false) => {
|
||||
warn!(
|
||||
target: "pow",
|
||||
"Unable to import mined block: seal is invalid",
|
||||
);
|
||||
warn!(target: LOG_TARGET, "Unable to import mined block: seal is invalid",);
|
||||
return false
|
||||
},
|
||||
Err(err) => {
|
||||
warn!(
|
||||
target: "pow",
|
||||
"Unable to import mined block: {}",
|
||||
err,
|
||||
);
|
||||
warn!(target: LOG_TARGET, "Unable to import mined block: {}", err,);
|
||||
return false
|
||||
},
|
||||
}
|
||||
} else {
|
||||
warn!(
|
||||
target: "pow",
|
||||
"Unable to import mined block: metadata does not exist",
|
||||
);
|
||||
warn!(target: LOG_TARGET, "Unable to import mined block: metadata does not exist",);
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -192,10 +182,7 @@ where
|
||||
} {
|
||||
build
|
||||
} else {
|
||||
warn!(
|
||||
target: "pow",
|
||||
"Unable to import mined block: build does not exist",
|
||||
);
|
||||
warn!(target: LOG_TARGET, "Unable to import mined block: build does not exist",);
|
||||
return false
|
||||
};
|
||||
|
||||
@@ -225,18 +212,13 @@ where
|
||||
);
|
||||
|
||||
info!(
|
||||
target: "pow",
|
||||
"✅ Successfully mined block on top of: {}",
|
||||
build.metadata.best_hash
|
||||
target: LOG_TARGET,
|
||||
"✅ Successfully mined block on top of: {}", build.metadata.best_hash
|
||||
);
|
||||
true
|
||||
},
|
||||
Err(err) => {
|
||||
warn!(
|
||||
target: "pow",
|
||||
"Unable to import mined block: {}",
|
||||
err,
|
||||
);
|
||||
warn!(target: LOG_TARGET, "Unable to import mined block: {}", err,);
|
||||
false
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user