Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(dojo): change usage of trace! to avoid path prefix #2830

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/dojo/utils/src/tx/declarer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
BlockId, BlockTag, DeclareTransactionResult, Felt, FlattenedSierraClass, StarknetError,
};
use starknet::providers::{Provider, ProviderError};
use tracing::trace;

use crate::{
FeeConfig, TransactionError, TransactionExt, TransactionResult, TransactionWaiter, TxnConfig,
Expand Down Expand Up @@ -92,7 +93,7 @@
match account.provider().get_class(BlockId::Tag(BlockTag::Pending), class_hash).await {
Err(ProviderError::StarknetError(StarknetError::ClassHashNotFound)) => {}
Ok(_) => {
tracing::trace!(
trace!(

Check warning on line 96 in crates/dojo/utils/src/tx/declarer.rs

View check run for this annotation

Codecov / codecov/patch

crates/dojo/utils/src/tx/declarer.rs#L96

Added line #L96 was not covered by tests
label = labeled_class.label,
class_hash = format!("{:#066x}", class_hash),
"Class already declared."
Expand All @@ -104,7 +105,7 @@

let casm_class_hash = labeled_class.casm_class_hash;

tracing::trace!(
trace!(
label = labeled_class.label,
class_hash = format!("{:#066x}", class_hash),
casm_class_hash = format!("{:#066x}", casm_class_hash),
Expand All @@ -127,7 +128,7 @@
}
};

tracing::trace!(
trace!(
label = labeled_class.label,
transaction_hash = format!("{:#066x}", transaction_hash),
class_hash = format!("{:#066x}", class_hash),
Expand Down
2 changes: 1 addition & 1 deletion crates/dojo/utils/src/tx/deployer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
match provider.get_class_hash_at(BlockId::Tag(BlockTag::Pending), contract_address).await {
Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => Ok(false),
Ok(_) => {
tracing::trace!(
trace!(

Check warning on line 101 in crates/dojo/utils/src/tx/deployer.rs

View check run for this annotation

Codecov / codecov/patch

crates/dojo/utils/src/tx/deployer.rs#L101

Added line #L101 was not covered by tests
contract_address = format!("{:#066x}", contract_address),
"Contract already deployed."
);
Expand Down
3 changes: 2 additions & 1 deletion crates/dojo/world/src/diff/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use starknet::core::types::contract::SierraClass;
use starknet::core::types::{BlockId, BlockTag, StarknetError};
use starknet::providers::{Provider, ProviderError};
use starknet_crypto::Felt;
use tracing::trace;

use super::local::{ResourceLocal, WorldLocal};
use super::remote::{ResourceRemote, WorldRemote};
Expand Down Expand Up @@ -171,7 +172,7 @@ impl WorldDiff {
{
Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => Ok(false),
Ok(_) => {
tracing::trace!(
trace!(
contract_address = format!("{:#066x}", world_address),
"World already deployed."
);
Expand Down
6 changes: 3 additions & 3 deletions crates/dojo/world/src/remote/events_to_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// The world contract exists, we can continue and fetch the events.
}
Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => {
tracing::trace!(%world_address, "No remote world contract found.");
trace!(%world_address, "No remote world contract found.");

Check warning on line 39 in crates/dojo/world/src/remote/events_to_remote.rs

View check run for this annotation

Codecov / codecov/patch

crates/dojo/world/src/remote/events_to_remote.rs#L39

Added line #L39 was not covered by tests
return Ok(world);
}
Err(e) => return Err(e.into()),
Expand Down Expand Up @@ -70,7 +70,7 @@

let chunk_size = 500;

tracing::trace!(
trace!(
world_address = format!("{:#066x}", world_address),
chunk_size,
?filter,
Expand Down Expand Up @@ -106,7 +106,7 @@
for event in &events {
match world::Event::try_from(event) {
Ok(ev) => {
tracing::trace!(?ev, "Processing world event.");
trace!(?ev, "Processing world event.");
world.match_event(ev)?;
}
Err(e) => {
Expand Down
Loading