From 627ea8cff8b99f671b5bca1a6137aaa6832f2896 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 1 Aug 2023 14:13:11 +0100 Subject: [PATCH] fmt --- cli/src/oracle/commands/listen_to_exchange.rs | 2 +- cli/src/oracle/commands/listen_to_oracle.rs | 12 +++++++++--- service/src/main.rs | 8 ++++---- sidechain/state/src/impls.rs | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cli/src/oracle/commands/listen_to_exchange.rs b/cli/src/oracle/commands/listen_to_exchange.rs index db26b5b0ec..95bab3ab38 100644 --- a/cli/src/oracle/commands/listen_to_exchange.rs +++ b/cli/src/oracle/commands/listen_to_exchange.rs @@ -67,7 +67,7 @@ pub fn count_exchange_rate_update_events(api: &ParentchainApi, duration: Duratio "ExchangeRateUpdated: TRADING_PAIR : {}, SRC : {}, VALUE :{:?}", trading_pair, data_source, exchange_rate ); - } + }, _ => trace!("ignoring teeracle event: {:?}", event), } } diff --git a/cli/src/oracle/commands/listen_to_oracle.rs b/cli/src/oracle/commands/listen_to_oracle.rs index 687b57ba75..d367bc020c 100644 --- a/cli/src/oracle/commands/listen_to_oracle.rs +++ b/cli/src/oracle/commands/listen_to_oracle.rs @@ -71,11 +71,17 @@ fn report_event_count(event_records: Vec) -> EventCount { info!("received event {:?}", event_record.event); if let RuntimeEvent::Teeracle(event) = &event_record.event { match &event { - my_node_runtime::pallet_teeracle::Event::OracleUpdated{oracle_data_name, data_source } => { + my_node_runtime::pallet_teeracle::Event::OracleUpdated { + oracle_data_name, + data_source, + } => { count += 1; debug!("Received OracleUpdated event"); - println!("OracleUpdated: ORACLE_NAME : {}, SRC : {}", oracle_data_name, data_source); - } + println!( + "OracleUpdated: ORACLE_NAME : {}, SRC : {}", + oracle_data_name, data_source + ); + }, // Can just remove this and ignore handling this case _ => debug!("ignoring teeracle event: {:?}", event), } diff --git a/service/src/main.rs b/service/src/main.rs index 3cfdd0c5c0..540572d8f5 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -704,7 +704,7 @@ fn print_events(events: Vec) { println!(" Data source: {}", data_source); println!(" trading pair: {}", trading_pair); println!(" Exchange rate: {:?}", exchange_rate); - } + }, my_node_runtime::pallet_teeracle::Event::ExchangeRateDeleted { data_source, trading_pair, @@ -712,7 +712,7 @@ fn print_events(events: Vec) { println!("[+] Received ExchangeRateDeleted event"); println!(" Data source: {}", data_source); println!(" trading pair: {}", trading_pair); - } + }, my_node_runtime::pallet_teeracle::Event::AddedToWhitelist { data_source, enclave_fingerprint, @@ -720,7 +720,7 @@ fn print_events(events: Vec) { println!("[+] Received AddedToWhitelist event"); println!(" Data source: {}", data_source); println!(" fingerprint: {:?}", enclave_fingerprint); - } + }, my_node_runtime::pallet_teeracle::Event::RemovedFromWhitelist { data_source, enclave_fingerprint, @@ -728,7 +728,7 @@ fn print_events(events: Vec) { println!("[+] Received RemovedFromWhitelist event"); println!(" Data source: {}", data_source); println!(" fingerprint: {:?}", enclave_fingerprint); - } + }, _ => { trace!("Ignoring unsupported pallet_teeracle event"); }, diff --git a/sidechain/state/src/impls.rs b/sidechain/state/src/impls.rs index 0aab09c5e8..669d4d3b2a 100644 --- a/sidechain/state/src/impls.rs +++ b/sidechain/state/src/impls.rs @@ -17,9 +17,9 @@ //! Implement the sidechain state traits. -use core::fmt::Debug; use crate::{Error, SidechainState, StateUpdate}; use codec::{Decode, Encode}; +use core::fmt::Debug; use frame_support::ensure; use itp_sgx_externalities::{SgxExternalitiesTrait, StateHash}; use itp_storage::keys::storage_value_key;