beefy: Add LOG_TARGET constant (#13222)

* LOG_TARGET const
* fmt
This commit is contained in:
Alejandro Martinez Andres
2023-01-24 15:55:42 +01:00
committed by GitHub
parent 14a4eed2aa
commit b9854171c0
10 changed files with 153 additions and 102 deletions
+3 -3
View File
@@ -18,7 +18,7 @@
//! Schema for BEEFY state persisted in the aux-db.
use crate::worker::PersistedState;
use crate::{worker::PersistedState, LOG_TARGET};
use codec::{Decode, Encode};
use log::{info, trace};
use sc_client_api::{backend::AuxStore, Backend};
@@ -31,7 +31,7 @@ const WORKER_STATE: &[u8] = b"beefy_voter_state";
const CURRENT_VERSION: u32 = 1;
pub(crate) fn write_current_version<B: AuxStore>(backend: &B) -> ClientResult<()> {
info!(target: "beefy", "🥩 write aux schema version {:?}", CURRENT_VERSION);
info!(target: LOG_TARGET, "🥩 write aux schema version {:?}", CURRENT_VERSION);
AuxStore::insert_aux(backend, &[(VERSION_KEY, CURRENT_VERSION.encode().as_slice())], &[])
}
@@ -40,7 +40,7 @@ pub(crate) fn write_voter_state<Block: BlockT, B: AuxStore>(
backend: &B,
state: &PersistedState<Block>,
) -> ClientResult<()> {
trace!(target: "beefy", "🥩 persisting {:?}", state);
trace!(target: LOG_TARGET, "🥩 persisting {:?}", state);
backend.insert_aux(&[(WORKER_STATE, state.encode().as_slice())], &[])
}