From c842b905d4074cf5a4535c59e58ca402a2550727 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:09:44 +0100 Subject: [PATCH] fmt --- runtime/src/extensions/ext_impl/read_state.rs | 17 ++++++++--------- runtime/src/extensions/pop_api_extension.rs | 5 +++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/runtime/src/extensions/ext_impl/read_state.rs b/runtime/src/extensions/ext_impl/read_state.rs index d4d649a9..6a9750fb 100644 --- a/runtime/src/extensions/ext_impl/read_state.rs +++ b/runtime/src/extensions/ext_impl/read_state.rs @@ -1,11 +1,9 @@ +use codec::Decode; use cumulus_primitives_core::relay_chain::BlockNumber; use frame_support::pallet_prelude::*; -use pallet_contracts::chain_extension::{ - Environment, Ext, InitState -}; -use pop_api_primitives::storage_keys::ParachainSystemKeys; use log; -use codec::Decode; +use pallet_contracts::chain_extension::{Environment, Ext, InitState}; +use pop_api_primitives::storage_keys::ParachainSystemKeys; const LOG_TARGET: &str = "popapi::extension::read_state"; @@ -19,17 +17,18 @@ where // Move StringLimit to pop_api_primitives first. let len: u32 = env.in_len(); let key: ParachainSystemKeys = env.read_as_unbounded(len)?; - + match key { LastRelayChainBlockNumber => { - let relay_block_num: BlockNumber = cumulus_pallet_parachain_system::LastRelayChainBlockNumber::get(); + let relay_block_num: BlockNumber = + cumulus_pallet_parachain_system::LastRelayChainBlockNumber::get(); log::debug!( target:LOG_TARGET, "Last Relay Chain Block Number is: {:?}.", relay_block_num ); //Ok(relay_block_num) Ok(()) - }, + } _ => Err(DispatchError::Other("Unable to read provided key.")), } -} \ No newline at end of file +} diff --git a/runtime/src/extensions/pop_api_extension.rs b/runtime/src/extensions/pop_api_extension.rs index 62cb6923..33568d76 100644 --- a/runtime/src/extensions/pop_api_extension.rs +++ b/runtime/src/extensions/pop_api_extension.rs @@ -105,7 +105,9 @@ mod tests { ext } - pub fn load_wasm_module(path: &str) -> std::io::Result<(Vec, ::Output)> + pub fn load_wasm_module( + path: &str, + ) -> std::io::Result<(Vec, ::Output)> where T: frame_system::Config, { @@ -184,5 +186,4 @@ mod tests { assert_eq!(bob_balance_before + value_to_send, bob_balance_after); }); } - }