From dc782e930e52bf8362805663f41b0000481e9f5a Mon Sep 17 00:00:00 2001 From: emostov <32168567+emostov@users.noreply.github.com> Date: Mon, 14 Dec 2020 14:40:25 -0800 Subject: [PATCH] Trivial cleaning --- examples/kusama_balance_transfer.rs | 6 +----- examples/submit_and_watch.rs | 6 +----- src/lib.rs | 14 +++++++++----- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/examples/kusama_balance_transfer.rs b/examples/kusama_balance_transfer.rs index 87670da2cc..dba35b8771 100644 --- a/examples/kusama_balance_transfer.rs +++ b/examples/kusama_balance_transfer.rs @@ -30,11 +30,7 @@ async fn main() -> Result<(), Box> { let dest = AccountKeyring::Bob.to_account_id().into(); let client = ClientBuilder::::new().build().await?; - let hash = client.transfer( - &signer, - &dest, - 10_000 - ).await?; + let hash = client.transfer(&signer, &dest, 10_000).await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/submit_and_watch.rs b/examples/submit_and_watch.rs index d7371015be..c75137f994 100644 --- a/examples/submit_and_watch.rs +++ b/examples/submit_and_watch.rs @@ -33,11 +33,7 @@ async fn main() -> Result<(), Box> { let dest = AccountKeyring::Bob.to_account_id().into(); let client = ClientBuilder::::new().build().await?; - let result = client.transfer_and_watch( - &signer, - &dest, - 10_000 - ).await?; + let result = client.transfer_and_watch(&signer, &dest, 10_000).await?; if let Some(event) = result.transfer()? { println!("Balance transfer success: value: {:?}", event.amount); diff --git a/src/lib.rs b/src/lib.rs index 19a78e91a3..9502643ad1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,7 +89,7 @@ pub use crate::{ SignedExtra, Signer, UncheckedExtrinsic, - DEFAULT_MORTAL_PERIOD + DEFAULT_MORTAL_PERIOD, }, frame::*, metadata::{ @@ -186,7 +186,7 @@ impl ClientBuilder { page_size: self.page_size.unwrap_or(10), signed_options: ClientSignedOptions { mortal_period: Some(DEFAULT_MORTAL_PERIOD), - } + }, }) } } @@ -478,7 +478,7 @@ impl Client { pub async fn create_signed + Send + Sync>( &self, call: C, - signer: &(dyn Signer + Send + Sync) + signer: &(dyn Signer + Send + Sync), ) -> Result, Error> where <>::Extra as SignedExtension>::AdditionalSigned: @@ -495,10 +495,14 @@ impl Client { Some(signed_block) => signed_block.block, None => return Err("RPC chain_getBlock returned None when Some(signed_block) was expected".into()), }; - let current_number = (*current_block.header().number()).saturated_into::(); + let current_number = + (*current_block.header().number()).saturated_into::(); let current_hash = current_block.hash(); - (Era::mortal(mortal_period, current_number), Some(current_hash)) + ( + Era::mortal(mortal_period, current_number), + Some(current_hash), + ) } else { (Era::Immortal, None) };