txpool: LOG_TARGET const added (#13180)

* txpool: LOG_TARGET const added

part of: #12873

* LOG_TARGET added to tests mod

* txpool::api for api

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

* ".git/.scripts/commands/fmt/fmt.sh"

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>
This commit is contained in:
Michal Kucharczyk
2023-01-19 23:21:41 +01:00
committed by GitHub
parent cce6d406bf
commit 57b1de3f47
11 changed files with 135 additions and 81 deletions
@@ -30,6 +30,8 @@ use sp_runtime::{
};
use std::{collections::HashMap, hash::Hash, pin::Pin, sync::Arc};
const LOG_TARGET: &str = "txpool::api";
pub use sp_runtime::transaction_validity::{
TransactionLongevity, TransactionPriority, TransactionSource, TransactionTag,
};
@@ -353,7 +355,7 @@ impl<TPool: LocalTransactionPool> OffchainSubmitTransaction<TPool::Block> for TP
extrinsic: <TPool::Block as BlockT>::Extrinsic,
) -> Result<(), ()> {
log::debug!(
target: "txpool",
target: LOG_TARGET,
"(offchain call) Submitting a transaction to the pool: {:?}",
extrinsic
);
@@ -362,7 +364,7 @@ impl<TPool: LocalTransactionPool> OffchainSubmitTransaction<TPool::Block> for TP
result.map(|_| ()).map_err(|e| {
log::warn!(
target: "txpool",
target: LOG_TARGET,
"(offchain call) Error submitting a transaction to the pool: {}",
e
)