Skip to content

Commit

Permalink
rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Sep 22, 2023
1 parent b227954 commit 6b53297
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
13 changes: 4 additions & 9 deletions crates/katana/core/src/messaging/ethereum_messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,17 @@ impl EthereumMessenger {

let mut logs: HashMap<u64, Vec<Log>> = HashMap::new();

let log_msg_to_l2_topic = H256::from_str(
"0xdb80dd488acf86d17c747445b0eabb5d57c541d3bd7b6b87af987858e5066b2b")
.unwrap();
let log_msg_to_l2_topic =
H256::from_str("0xdb80dd488acf86d17c747445b0eabb5d57c541d3bd7b6b87af987858e5066b2b")
.unwrap();

let filters = Filter {
block_option: FilterBlockOption::Range {
from_block: Some(BlockNumber::Number(from_block.into())),
to_block: Some(BlockNumber::Number(to_block.into())),
},
address: Some(ValueOrArray::Value(self.messaging_contract_address)),
topics: [
Some(ValueOrArray::Value(Some(log_msg_to_l2_topic))),
None,
None,
None,
]
topics: [Some(ValueOrArray::Value(Some(log_msg_to_l2_topic))), None, None, None],
};

self.provider
Expand Down
38 changes: 19 additions & 19 deletions crates/katana/core/src/messaging/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,18 @@ fn trace_msg_to_l1_sent(messages: &Vec<MsgToL1>, hashes: &Vec<String>) {
let payload_str = &payload_str[2..];

info!(target: MSGING_TARGET,
r"Message executed on settlement layer:
r"Message executed on settlement layer:
| from_address | {:#x}
| to_address | {}
| selector | {}
| payload | [{}]
",
m.from_address,
to_address,
selector,
payload_str.join(", ")
);
m.from_address,
to_address,
selector,
payload_str.join(", ")
);
} else {
// We check for magic value 'MSG' used only when we are doing L3-L2 messaging.
let (to_address, payload_str) = if format!("{:#x}", m.to_address) == "0x4d5347" {
Expand All @@ -288,18 +288,18 @@ fn trace_msg_to_l1_sent(messages: &Vec<MsgToL1>, hashes: &Vec<String>) {
};

info!(target: MSGING_TARGET,
r"Message sent to settlement layer:
r"Message sent to settlement layer:
| hash | {}
| from_address | {:#x}
| to_address | {}
| payload | [{}]
",
hash.as_str(),
m.from_address,
to_address,
payload_str.join(", ")
);
hash.as_str(),
m.from_address,
to_address,
payload_str.join(", ")
);
}
}
}
Expand All @@ -309,17 +309,17 @@ fn trace_l1_handler_tx_exec(tx: &L1HandlerTransaction) {
tx.inner.calldata.0.iter().map(|f| format!("{:#x}", FieldElement::from(*f))).collect();

info!(
target: MSGING_TARGET,
r"L1Handler transaction added to the pool:
target: MSGING_TARGET,
r"L1Handler transaction added to the pool:
| tx_hash | {:#x}
| contract_address | {:#x}
| selector | {:#x}
| calldata | [{}]
",
FieldElement::from(tx.inner.transaction_hash.0),
FieldElement::from(*tx.inner.contract_address.0.key()),
FieldElement::from(tx.inner.entry_point_selector.0),
calldata_str.join(", ")
);
FieldElement::from(tx.inner.transaction_hash.0),
FieldElement::from(*tx.inner.contract_address.0.key()),
FieldElement::from(tx.inner.entry_point_selector.0),
calldata_str.join(", ")
);
}

0 comments on commit 6b53297

Please sign in to comment.