Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
al3mart committed Mar 2, 2024
1 parent 67e11f0 commit c842b90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
17 changes: 8 additions & 9 deletions runtime/src/extensions/ext_impl/read_state.rs
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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.")),
}
}
}
5 changes: 3 additions & 2 deletions runtime/src/extensions/pop_api_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ mod tests {
ext
}

pub fn load_wasm_module<T>(path: &str) -> std::io::Result<(Vec<u8>, <T::Hashing as Hash>::Output)>
pub fn load_wasm_module<T>(
path: &str,
) -> std::io::Result<(Vec<u8>, <T::Hashing as Hash>::Output)>
where
T: frame_system::Config,
{
Expand Down Expand Up @@ -184,5 +186,4 @@ mod tests {
assert_eq!(bob_balance_before + value_to_send, bob_balance_after);
});
}

}

0 comments on commit c842b90

Please sign in to comment.