diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 6ac19618c..000000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,10 +0,0 @@ -fn_single_line = true -match_arm_blocks = true -match_block_trailing_comma = true -imports_granularity = "Crate" -overflow_delimited_expr = true -reorder_impl_items = true -group_imports = "StdExternalCrate" -use_field_init_shorthand = true -edition = "2018" -hard_tabs = true \ No newline at end of file diff --git a/avail-subxt/.rustfmt.toml b/avail-subxt/.rustfmt.toml deleted file mode 100644 index 6ac19618c..000000000 --- a/avail-subxt/.rustfmt.toml +++ /dev/null @@ -1,10 +0,0 @@ -fn_single_line = true -match_arm_blocks = true -match_block_trailing_comma = true -imports_granularity = "Crate" -overflow_delimited_expr = true -reorder_impl_items = true -group_imports = "StdExternalCrate" -use_field_init_shorthand = true -edition = "2018" -hard_tabs = true \ No newline at end of file diff --git a/avail-subxt/examples/create_app_key.rs b/avail-subxt/examples/create_app_key.rs index 736c5c393..3d68b49c9 100644 --- a/avail-subxt/examples/create_app_key.rs +++ b/avail-subxt/examples/create_app_key.rs @@ -22,9 +22,8 @@ async fn main() -> Result<()> { let signer_a = PairSigner::::new(pair_a.0); let app_id = b"my_app_name".to_vec(); - let create_application_key = api::tx() - .data_availability() - .create_application_key(BoundedVec(app_id)); + let create_application_key = + api::tx().data_availability().create_application_key(BoundedVec(app_id)); let params = AvailExtrinsicParams::default(); diff --git a/avail-subxt/examples/da_bridge_actor.rs b/avail-subxt/examples/da_bridge_actor.rs index d79a60bef..d63352532 100644 --- a/avail-subxt/examples/da_bridge_actor.rs +++ b/avail-subxt/examples/da_bridge_actor.rs @@ -74,11 +74,8 @@ async fn main() -> Result<()> { .block_hash(); // Get block - let submitted_block = client - .rpc() - .block(Some(block_hash)) - .await? - .expect("Block exists .qed"); + let submitted_block = + client.rpc().block(Some(block_hash)).await?.expect("Block exists .qed"); let xts = submitted_block.block.extrinsics; println!("Submitted block extrinsic: {xts:?}"); diff --git a/avail-subxt/examples/democracy_external.rs b/avail-subxt/examples/democracy_external.rs index 84e4b16c3..e64533101 100644 --- a/avail-subxt/examples/democracy_external.rs +++ b/avail-subxt/examples/democracy_external.rs @@ -78,17 +78,12 @@ mod council { log::info!("Inner call pre-image hash {}", noted_event.hash); // 2. Push the coucil proposal: external propose on democracy. - let proposal = Bounded::Lookup { - hash: noted_event.hash, - len: inner_call_len, - }; + let proposal = Bounded::Lookup { hash: noted_event.hash, len: inner_call_len }; let democracy_external_prop = Call::Democracy(DemocracyCall::external_propose_majority { proposal }); let len_bound = democracy_external_prop.encode().len() as u32; let council_proposal = - api::tx() - .council() - .propose(THREASHOLD, democracy_external_prop, len_bound); + api::tx().council().propose(THREASHOLD, democracy_external_prop, len_bound); let event = tx_send!(client, &council_proposal, &signer) .find_first::()? @@ -107,9 +102,7 @@ mod council { signer: &PairSigner, proposal: &IndexedProposalContext, ) -> Result { - let vote = api::tx() - .council() - .vote(proposal.hash, proposal.index, true); + let vote = api::tx().council().vote(proposal.hash, proposal.index, true); tx_asend!(client, &vote, signer).map_err(Into::into) } @@ -119,10 +112,8 @@ mod council { ) -> Result<()> { log::trace!("Council will vote proposal using 3/4 of council ..."); - let super_majority = COUNCIL_SUPER_MAJORITY - .into_iter() - .map(signer_from_seed) - .collect::>(); + let super_majority = + COUNCIL_SUPER_MAJORITY.into_iter().map(signer_from_seed).collect::>(); let pending_txs = stream::iter(super_majority.iter()) .map(|signer| vote_yes(client, signer, proposal)) @@ -131,10 +122,7 @@ mod council { .await?; for tx in pending_txs { - log::trace!( - "Waiting for `Ayes` voting finalization of {}", - tx.extrinsic_hash() - ); + log::trace!("Waiting for `Ayes` voting finalization of {}", tx.extrinsic_hash()); let _ = tx.wait_for_in_block().await?; } Ok(()) @@ -143,24 +131,15 @@ mod council { pub async fn close(client: &Client, proposal: &IndexedProposalContext) -> Result<()> { log::trace!("Closing the council proposal ..."); - let close_weight = Weight { - ref_time: 1_000_000_000, - proof_size: 0, - }; + let close_weight = Weight { ref_time: 1_000_000_000, proof_size: 0 }; let close = api::tx() .council() .close(proposal.hash, proposal.index, close_weight, proposal.len); let events = tx_send!(client, &close, &PairSigner::new(Alice.pair())); - ensure!( - events.has::()?, - "Proposal was not closed" - ); - ensure!( - events.has::()?, - "Proposal was not approved" - ); + ensure!(events.has::()?, "Proposal was not closed"); + ensure!(events.has::()?, "Proposal was not approved"); let executed = events .find_first::()? @@ -192,19 +171,13 @@ mod techies { }); let fast_track_len = fast_track.encode().len() as u32; - let call = api::tx() - .technical_committee() - .propose(5, fast_track, fast_track_len); + let call = api::tx().technical_committee().propose(5, fast_track, fast_track_len); let event = tx_send!(client, &call, &signer) .find_first::()? .expect("Techies proposed event is emitted .qed"); - Ok(IndexedProposalContext::new( - event.proposal_index, - event.proposal_hash, - fast_track_len, - )) + Ok(IndexedProposalContext::new(event.proposal_index, event.proposal_hash, fast_track_len)) } async fn vote_yes( @@ -212,9 +185,7 @@ mod techies { signer: &PairSigner, proposal: &IndexedProposalContext, ) -> Result { - let vote = api::tx() - .technical_committee() - .vote(proposal.hash, proposal.index, true); + let vote = api::tx().technical_committee().vote(proposal.hash, proposal.index, true); tx_asend!(client, &vote, signer).map_err(Into::into) } @@ -237,10 +208,7 @@ mod techies { } pub async fn close(client: &Client, proposal: &IndexedProposalContext) -> Result { - let close_weight = Weight { - ref_time: 1_000_000_000, - proof_size: 0, - }; + let close_weight = Weight { ref_time: 1_000_000_000, proof_size: 0 }; log::info!("Proposal to close {:?}", proposal); let close = api::tx().technical_committee().close( proposal.hash, @@ -249,19 +217,10 @@ mod techies { proposal.len, ); let events = tx_send!(client, &close, &PairSigner::new(Alice.pair())); - ensure!( - events.has::()?, - "Fast-track proposal was not approved" - ); - ensure!( - events.has::()?, - "Fast-track proposal was not executed" - ); + ensure!(events.has::()?, "Fast-track proposal was not approved"); + ensure!(events.has::()?, "Fast-track proposal was not executed"); let block_events = events.all_events_in_block(); - ensure!( - block_events.has::()?, - "Referendum was not started" - ); + ensure!(block_events.has::()?, "Referendum was not started"); let referendum_started = block_events .find_first::()? .expect("Referendum was started .qed"); @@ -291,10 +250,7 @@ mod democracy { let vote_call = api::tx().democracy().vote(referendum, vote); let events = tx_send!(client, &vote_call, &signer); - ensure!( - events.has::()?, - "Referendum's Vote failed" - ); + ensure!(events.has::()?, "Referendum's Vote failed"); Ok(()) } diff --git a/avail-subxt/examples/download_digest_items.rs b/avail-subxt/examples/download_digest_items.rs index 1c1e0e394..02256486c 100644 --- a/avail-subxt/examples/download_digest_items.rs +++ b/avail-subxt/examples/download_digest_items.rs @@ -86,11 +86,7 @@ async fn main() -> Result<()> { let client = build_client(args.ws, args.validate_codegen).await?; // Get best block - let best_block = client - .rpc() - .block(None) - .await? - .expect("Best block always exists .qed"); + let best_block = client.rpc().block(None).await?.expect("Best block always exists .qed"); let best_block_num = best_block.block.header.number; @@ -114,11 +110,7 @@ async fn main() -> Result<()> { // Load all headers and decode each digest item. for block_num in 1..=best_block_num { - let block_hash = client - .rpc() - .block_hash(Some(block_num.into())) - .await? - .unwrap(); + let block_hash = client.rpc().block_hash(Some(block_num.into())).await?.unwrap(); let header = client.rpc().header(Some(block_hash)).await?.unwrap(); let digests = header diff --git a/avail-subxt/examples/headers.rs b/avail-subxt/examples/headers.rs index 64988f776..bbf2eafd5 100644 --- a/avail-subxt/examples/headers.rs +++ b/avail-subxt/examples/headers.rs @@ -13,41 +13,25 @@ async fn main() -> Result<()> { let args = Opts::from_args(); let client = build_client(args.ws, args.validate_codegen).await?; - let head_block = client - .rpc() - .block(None) - .await? - .expect("Best block always exists .qed"); + let head_block = client.rpc().block(None).await?.expect("Best block always exists .qed"); let block_num = head_block.block.header.number; println!("Current head: {block_num}"); - println!( - "Current head block extrinsic: {block:?}", - block = head_block.block.extrinsics - ); - println!( - "Current head block header: {header:?}", - header = head_block.block.header - ); + println!("Current head block extrinsic: {block:?}", block = head_block.block.extrinsics); + println!("Current head block header: {header:?}", header = head_block.block.header); let mut headers = vec![]; - for batch in (1u32..=block_num) - .collect::>() - .chunks(BATCH_NUM) - .map(|e| { - join_all( - e.iter() - .map(|n| { - let block_number = Some(BlockNumber::from(*n)); - client - .rpc() - .block_hash(block_number) - .and_then(|h| client.rpc().header(h)) - }) - .collect::>(), - ) - }) { + for batch in (1u32..=block_num).collect::>().chunks(BATCH_NUM).map(|e| { + join_all( + e.iter() + .map(|n| { + let block_number = Some(BlockNumber::from(*n)); + client.rpc().block_hash(block_number).and_then(|h| client.rpc().header(h)) + }) + .collect::>(), + ) + }) { headers.extend(batch.await); } println!("Headers: {num}", num = headers.len()); @@ -62,11 +46,7 @@ async fn main() -> Result<()> { .collect::>(); println!("Header hashes: {:?}", header_hashes); - assert_eq!( - headers.len(), - block_num as usize, - "Didn't get the same number of block headers." - ); + assert_eq!(headers.len(), block_num as usize, "Didn't get the same number of block headers."); Ok(()) } diff --git a/avail-subxt/examples/set_updater.rs b/avail-subxt/examples/set_updater.rs index ca4b975b6..75b24b6a9 100644 --- a/avail-subxt/examples/set_updater.rs +++ b/avail-subxt/examples/set_updater.rs @@ -15,9 +15,7 @@ async fn main() -> Result<()> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); // crate a new transaction with new updater - let set_updater = api::tx() - .nomad_home() - .set_updater(new_updater.parse().unwrap()); + let set_updater = api::tx().nomad_home().set_updater(new_updater.parse().unwrap()); println!("Updating updater..."); diff --git a/avail-subxt/examples/submit_block_length_proposal.rs b/avail-subxt/examples/submit_block_length_proposal.rs index d6fddd31e..4f12714eb 100644 --- a/avail-subxt/examples/submit_block_length_proposal.rs +++ b/avail-subxt/examples/submit_block_length_proposal.rs @@ -20,10 +20,8 @@ const BLOCK_DIM_VALUE: u32 = 32; /// Sets the block dimensions to default async fn reset(client: &Client, signer: &PairSigner) -> Result<()> { log::info!("Resetting block dimensions for further tests"); - let block_length_update = Call::DataAvailability(DaCall::submit_block_length_proposal { - rows: 256, - cols: 256, - }); + let block_length_update = + Call::DataAvailability(DaCall::submit_block_length_proposal { rows: 256, cols: 256 }); let sudo_call = api::tx().sudo().sudo(block_length_update); tx_send!(client, &sudo_call, signer); Ok(()) @@ -32,9 +30,7 @@ async fn reset(client: &Client, signer: &PairSigner) -> Result<()> { /// Make `n` data submission transaction async fn submit_data(client: &Client, signer: &PairSigner, n: u8) -> Result<()> { let example_data = b"X".repeat(1000).to_vec(); - let data_submission = api::tx() - .data_availability() - .submit_data(BoundedVec(example_data)); + let data_submission = api::tx().data_availability().submit_data(BoundedVec(example_data)); for _ in 0..n { tx_asend!(client, &data_submission, signer)?; } @@ -88,9 +84,7 @@ pub async fn batch_tx(client: &Client, signer: &PairSigner) -> Result<()> { rows: BLOCK_DIM_VALUE, cols: BLOCK_DIM_VALUE, }); - let sudo_call = Call::Sudo(SudoCall::sudo { - call: Box::new(block_length_update), - }); + let sudo_call = Call::Sudo(SudoCall::sudo { call: Box::new(block_length_update) }); let batch_call = api::tx().utility().batch(vec![sudo_call]); tx_send!(client, &batch_call, signer) .find_first::()? @@ -114,14 +108,9 @@ pub async fn fail_simple_tx(client: &Client, signer: &PairSigner) -> Result<()> let event = events .find_first::()? .expect("1-Fail - Sudid event is emitted .qed"); + assert!(event.sudo_result.is_err(), "1-Fail - BlockLengthProposal was abnormally successful"); assert!( - event.sudo_result.is_err(), - "1-Fail - BlockLengthProposal was abnormally successful" - ); - assert!( - events - .find_first::()? - .is_none(), + events.find_first::()?.is_none(), "1-Fail - BlockLengthProposal was abnormally successful" ); @@ -138,23 +127,16 @@ pub async fn fail_batch_tx(client: &Client, signer: &PairSigner) -> Result<()> { rows: BLOCK_DIM_VALUE, cols: BLOCK_DIM_VALUE, }); - let sudo_call = Call::Sudo(SudoCall::sudo { - call: Box::new(block_length_update), - }); + let sudo_call = Call::Sudo(SudoCall::sudo { call: Box::new(block_length_update) }); let batch_call = api::tx().utility().batch(vec![sudo_call]); let events = tx_send!(client, &batch_call, signer); let event = events .find_first::()? .expect("2-Fail - Sudid event is emitted .qed"); + assert!(event.sudo_result.is_err(), "2-Fail - BlockLengthProposal was abnormally successful"); assert!( - event.sudo_result.is_err(), - "2-Fail - BlockLengthProposal was abnormally successful" - ); - assert!( - events - .find_first::()? - .is_none(), + events.find_first::()?.is_none(), "2-Fail - BlockLengthProposal was abnormally successful" ); diff --git a/avail-subxt/examples/submit_block_length_proposal_democracy.rs b/avail-subxt/examples/submit_block_length_proposal_democracy.rs index 91aa1e56b..216981cb6 100644 --- a/avail-subxt/examples/submit_block_length_proposal_democracy.rs +++ b/avail-subxt/examples/submit_block_length_proposal_democracy.rs @@ -21,10 +21,8 @@ const BLOCK_DIM_VALUE: u32 = 32; /// Sets the block dimensions to default async fn reset(client: &Client, signer: &PairSigner) -> Result<()> { log::info!("Resetting block dimensions for further tests"); - let block_length_update = Call::DataAvailability(DaCall::submit_block_length_proposal { - rows: 256, - cols: 256, - }); + let block_length_update = + Call::DataAvailability(DaCall::submit_block_length_proposal { rows: 256, cols: 256 }); let sudo_call = api::tx().sudo().sudo(block_length_update); tx_send!(client, &sudo_call, signer); Ok(()) @@ -71,12 +69,10 @@ pub async fn batch_democracy_tx(client: &Client, signer: &PairSigner) -> Result< let n = 256 - BLOCK_DIM_VALUE; for i in 0..n { - calls.push(Call::DataAvailability( - DaCall::submit_block_length_proposal { - rows: BLOCK_DIM_VALUE + n - 1 - i, - cols: BLOCK_DIM_VALUE + n - 1 - i, - }, - )); + calls.push(Call::DataAvailability(DaCall::submit_block_length_proposal { + rows: BLOCK_DIM_VALUE + n - 1 - i, + cols: BLOCK_DIM_VALUE + n - 1 - i, + })); } let call = Call::Utility(UtilityCall::batch { calls }); let checked_pallet_name = DaEvent::BlockLengthProposalSubmitted::PALLET; diff --git a/avail-subxt/examples/submit_data.rs b/avail-subxt/examples/submit_data.rs index ae91e7d64..ac7c8ad32 100644 --- a/avail-subxt/examples/submit_data.rs +++ b/avail-subxt/examples/submit_data.rs @@ -24,9 +24,7 @@ async fn main() -> Result<()> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let example_data = b"example".to_vec(); - let data_transfer = api::tx() - .data_availability() - .submit_data(BoundedVec(example_data.clone())); + let data_transfer = api::tx().data_availability().submit_data(BoundedVec(example_data.clone())); let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1.into()); println!("Sending example data..."); @@ -44,9 +42,7 @@ async fn main() -> Result<()> { .extrinsics .into_iter() .filter_map(|chain_block_ext| { - AppUncheckedExtrinsic::try_from(chain_block_ext) - .map(|ext| ext.function) - .ok() + AppUncheckedExtrinsic::try_from(chain_block_ext).map(|ext| ext.function).ok() }) .find(|call| match call { Call::DataAvailability(da_call) => match da_call { diff --git a/avail-subxt/examples/submit_data_and_dispatch_data_root.rs b/avail-subxt/examples/submit_data_and_dispatch_data_root.rs index ae52bd62b..8572046af 100644 --- a/avail-subxt/examples/submit_data_and_dispatch_data_root.rs +++ b/avail-subxt/examples/submit_data_and_dispatch_data_root.rs @@ -21,9 +21,7 @@ async fn main() -> Result<()> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let example_data = b"example".to_vec(); - let data_transfer = api::tx() - .data_availability() - .submit_data(BoundedVec(example_data.clone())); + let data_transfer = api::tx().data_availability().submit_data(BoundedVec(example_data.clone())); let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1.into()); println!("Sending example data..."); @@ -65,12 +63,7 @@ async fn main() -> Result<()> { .await .unwrap(); - let submitted_block = client - .rpc() - .block(Some(h.block_hash())) - .await - .unwrap() - .unwrap(); + let submitted_block = client.rpc().block(Some(h.block_hash())).await.unwrap().unwrap(); let xts = submitted_block.block.extrinsics; println!("Submitted block extrinsic: {xts:?}"); diff --git a/avail-subxt/rustfmt.toml b/avail-subxt/rustfmt.toml new file mode 100644 index 000000000..7f2050368 --- /dev/null +++ b/avail-subxt/rustfmt.toml @@ -0,0 +1,31 @@ +# Basic +edition = "2021" +hard_tabs = true +max_width = 100 +use_small_heuristics = "Max" + +# Consistency +newline_style = "Unix" +# Misc +chain_width = 80 + +match_arm_leading_pipes = "Preserve" +match_block_trailing_comma = true + +use_field_init_shorthand = true + +# Disabled because we switched from nightly to stable +# +# binop_separator = "Back" +# match_arm_blocks = false +# trailing_comma = "Vertical" +# trailing_semicolon = false +# reorder_impl_items = false +# spaces_around_ranges = false +# binop_separator = "Back" +# Format comments +# comment_width = 100 +# wrap_comments = true +# Imports +# imports_granularity = "Crate" +# reorder_imports = true \ No newline at end of file diff --git a/avail-subxt/src/api_dev.rs b/avail-subxt/src/api_dev.rs index 9ad5ea030..e891af471 100644 --- a/avail-subxt/src/api_dev.rs +++ b/avail-subxt/src/api_dev.rs @@ -313,13 +313,11 @@ pub mod api { )?)); } if pallet_name == "NomadDABridge" { - return Ok(Event::NomadDABridge( - nomad_da_bridge::Event::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?, - )); + return Ok(Event::NomadDABridge(nomad_da_bridge::Event::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?)); } if pallet_name == "Preimage" { return Ok(Event::Preimage(preimage::Event::decode_with_metadata( @@ -343,13 +341,11 @@ pub mod api { )?)); } if pallet_name == "NominationPools" { - return Ok(Event::NominationPools( - nomination_pools::Event::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?, - )); + return Ok(Event::NominationPools(nomination_pools::Event::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?)); } if pallet_name == "Identity" { return Ok(Event::Identity(identity::Event::decode_with_metadata( @@ -611,13 +607,11 @@ pub mod api { )?)); } if pallet_name == "DataAvailability" { - return Ok(Call::DataAvailability( - data_availability::Call::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?, - )); + return Ok(Call::DataAvailability(data_availability::Call::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?)); } if pallet_name == "NomadUpdaterManager" { return Ok(Call::NomadUpdaterManager( @@ -636,13 +630,11 @@ pub mod api { )?)); } if pallet_name == "NomadDABridge" { - return Ok(Call::NomadDABridge( - nomad_da_bridge::Call::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?, - )); + return Ok(Call::NomadDABridge(nomad_da_bridge::Call::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?)); } if pallet_name == "Preimage" { return Ok(Call::Preimage(preimage::Call::decode_with_metadata( @@ -666,13 +658,11 @@ pub mod api { )?)); } if pallet_name == "NominationPools" { - return Ok(Call::NominationPools( - nomination_pools::Call::decode_with_metadata( - &mut &*pallet_bytes, - pallet_ty, - metadata, - )?, - )); + return Ok(Call::NominationPools(nomination_pools::Call::decode_with_metadata( + &mut &*pallet_bytes, + pallet_ty, + metadata, + )?)); } if pallet_name == "Identity" { return Ok(Call::Identity(identity::Call::decode_with_metadata( @@ -919,10 +909,18 @@ pub mod api { .into()) } } - pub fn constants() -> ConstantsApi { ConstantsApi } - pub fn storage() -> StorageApi { StorageApi } - pub fn tx() -> TransactionApi { TransactionApi } - pub fn apis() -> runtime_apis::RuntimeApi { runtime_apis::RuntimeApi } + pub fn constants() -> ConstantsApi { + ConstantsApi + } + pub fn storage() -> StorageApi { + StorageApi + } + pub fn tx() -> TransactionApi { + TransactionApi + } + pub fn apis() -> runtime_apis::RuntimeApi { + runtime_apis::RuntimeApi + } pub mod runtime_apis { use ::subxt::ext::codec::Encode; @@ -932,13 +930,17 @@ pub mod api { } pub struct ConstantsApi; impl ConstantsApi { - pub fn system(&self) -> system::constants::ConstantsApi { system::constants::ConstantsApi } + pub fn system(&self) -> system::constants::ConstantsApi { + system::constants::ConstantsApi + } pub fn utility(&self) -> utility::constants::ConstantsApi { utility::constants::ConstantsApi } - pub fn babe(&self) -> babe::constants::ConstantsApi { babe::constants::ConstantsApi } + pub fn babe(&self) -> babe::constants::ConstantsApi { + babe::constants::ConstantsApi + } pub fn timestamp(&self) -> timestamp::constants::ConstantsApi { timestamp::constants::ConstantsApi @@ -1002,7 +1004,9 @@ pub mod api { bounties::constants::ConstantsApi } - pub fn tips(&self) -> tips::constants::ConstantsApi { tips::constants::ConstantsApi } + pub fn tips(&self) -> tips::constants::ConstantsApi { + tips::constants::ConstantsApi + } pub fn data_availability(&self) -> data_availability::constants::ConstantsApi { data_availability::constants::ConstantsApi @@ -1034,19 +1038,29 @@ pub mod api { } pub struct StorageApi; impl StorageApi { - pub fn system(&self) -> system::storage::StorageApi { system::storage::StorageApi } + pub fn system(&self) -> system::storage::StorageApi { + system::storage::StorageApi + } - pub fn babe(&self) -> babe::storage::StorageApi { babe::storage::StorageApi } + pub fn babe(&self) -> babe::storage::StorageApi { + babe::storage::StorageApi + } - pub fn timestamp(&self) -> timestamp::storage::StorageApi { timestamp::storage::StorageApi } + pub fn timestamp(&self) -> timestamp::storage::StorageApi { + timestamp::storage::StorageApi + } pub fn authorship(&self) -> authorship::storage::StorageApi { authorship::storage::StorageApi } - pub fn indices(&self) -> indices::storage::StorageApi { indices::storage::StorageApi } + pub fn indices(&self) -> indices::storage::StorageApi { + indices::storage::StorageApi + } - pub fn balances(&self) -> balances::storage::StorageApi { balances::storage::StorageApi } + pub fn balances(&self) -> balances::storage::StorageApi { + balances::storage::StorageApi + } pub fn transaction_payment(&self) -> transaction_payment::storage::StorageApi { transaction_payment::storage::StorageApi @@ -1058,49 +1072,77 @@ pub mod api { election_provider_multi_phase::storage::StorageApi } - pub fn staking(&self) -> staking::storage::StorageApi { staking::storage::StorageApi } + pub fn staking(&self) -> staking::storage::StorageApi { + staking::storage::StorageApi + } - pub fn session(&self) -> session::storage::StorageApi { session::storage::StorageApi } + pub fn session(&self) -> session::storage::StorageApi { + session::storage::StorageApi + } - pub fn democracy(&self) -> democracy::storage::StorageApi { democracy::storage::StorageApi } + pub fn democracy(&self) -> democracy::storage::StorageApi { + democracy::storage::StorageApi + } - pub fn council(&self) -> council::storage::StorageApi { council::storage::StorageApi } + pub fn council(&self) -> council::storage::StorageApi { + council::storage::StorageApi + } pub fn technical_committee(&self) -> technical_committee::storage::StorageApi { technical_committee::storage::StorageApi } - pub fn elections(&self) -> elections::storage::StorageApi { elections::storage::StorageApi } + pub fn elections(&self) -> elections::storage::StorageApi { + elections::storage::StorageApi + } pub fn technical_membership(&self) -> technical_membership::storage::StorageApi { technical_membership::storage::StorageApi } - pub fn grandpa(&self) -> grandpa::storage::StorageApi { grandpa::storage::StorageApi } + pub fn grandpa(&self) -> grandpa::storage::StorageApi { + grandpa::storage::StorageApi + } - pub fn treasury(&self) -> treasury::storage::StorageApi { treasury::storage::StorageApi } + pub fn treasury(&self) -> treasury::storage::StorageApi { + treasury::storage::StorageApi + } - pub fn sudo(&self) -> sudo::storage::StorageApi { sudo::storage::StorageApi } + pub fn sudo(&self) -> sudo::storage::StorageApi { + sudo::storage::StorageApi + } - pub fn im_online(&self) -> im_online::storage::StorageApi { im_online::storage::StorageApi } + pub fn im_online(&self) -> im_online::storage::StorageApi { + im_online::storage::StorageApi + } pub fn authority_discovery(&self) -> authority_discovery::storage::StorageApi { authority_discovery::storage::StorageApi } - pub fn offences(&self) -> offences::storage::StorageApi { offences::storage::StorageApi } + pub fn offences(&self) -> offences::storage::StorageApi { + offences::storage::StorageApi + } pub fn historical(&self) -> historical::storage::StorageApi { historical::storage::StorageApi } - pub fn scheduler(&self) -> scheduler::storage::StorageApi { scheduler::storage::StorageApi } + pub fn scheduler(&self) -> scheduler::storage::StorageApi { + scheduler::storage::StorageApi + } - pub fn bounties(&self) -> bounties::storage::StorageApi { bounties::storage::StorageApi } + pub fn bounties(&self) -> bounties::storage::StorageApi { + bounties::storage::StorageApi + } - pub fn tips(&self) -> tips::storage::StorageApi { tips::storage::StorageApi } + pub fn tips(&self) -> tips::storage::StorageApi { + tips::storage::StorageApi + } - pub fn mmr(&self) -> mmr::storage::StorageApi { mmr::storage::StorageApi } + pub fn mmr(&self) -> mmr::storage::StorageApi { + mmr::storage::StorageApi + } pub fn data_availability(&self) -> data_availability::storage::StorageApi { data_availability::storage::StorageApi @@ -1114,9 +1156,13 @@ pub mod api { nomad_home::storage::StorageApi } - pub fn preimage(&self) -> preimage::storage::StorageApi { preimage::storage::StorageApi } + pub fn preimage(&self) -> preimage::storage::StorageApi { + preimage::storage::StorageApi + } - pub fn multisig(&self) -> multisig::storage::StorageApi { multisig::storage::StorageApi } + pub fn multisig(&self) -> multisig::storage::StorageApi { + multisig::storage::StorageApi + } pub fn voter_list(&self) -> voter_list::storage::StorageApi { voter_list::storage::StorageApi @@ -1126,21 +1172,31 @@ pub mod api { nomination_pools::storage::StorageApi } - pub fn identity(&self) -> identity::storage::StorageApi { identity::storage::StorageApi } + pub fn identity(&self) -> identity::storage::StorageApi { + identity::storage::StorageApi + } } pub struct TransactionApi; impl TransactionApi { - pub fn system(&self) -> system::calls::TransactionApi { system::calls::TransactionApi } + pub fn system(&self) -> system::calls::TransactionApi { + system::calls::TransactionApi + } - pub fn utility(&self) -> utility::calls::TransactionApi { utility::calls::TransactionApi } + pub fn utility(&self) -> utility::calls::TransactionApi { + utility::calls::TransactionApi + } - pub fn babe(&self) -> babe::calls::TransactionApi { babe::calls::TransactionApi } + pub fn babe(&self) -> babe::calls::TransactionApi { + babe::calls::TransactionApi + } pub fn timestamp(&self) -> timestamp::calls::TransactionApi { timestamp::calls::TransactionApi } - pub fn indices(&self) -> indices::calls::TransactionApi { indices::calls::TransactionApi } + pub fn indices(&self) -> indices::calls::TransactionApi { + indices::calls::TransactionApi + } pub fn balances(&self) -> balances::calls::TransactionApi { balances::calls::TransactionApi @@ -1152,15 +1208,21 @@ pub mod api { election_provider_multi_phase::calls::TransactionApi } - pub fn staking(&self) -> staking::calls::TransactionApi { staking::calls::TransactionApi } + pub fn staking(&self) -> staking::calls::TransactionApi { + staking::calls::TransactionApi + } - pub fn session(&self) -> session::calls::TransactionApi { session::calls::TransactionApi } + pub fn session(&self) -> session::calls::TransactionApi { + session::calls::TransactionApi + } pub fn democracy(&self) -> democracy::calls::TransactionApi { democracy::calls::TransactionApi } - pub fn council(&self) -> council::calls::TransactionApi { council::calls::TransactionApi } + pub fn council(&self) -> council::calls::TransactionApi { + council::calls::TransactionApi + } pub fn technical_committee(&self) -> technical_committee::calls::TransactionApi { technical_committee::calls::TransactionApi @@ -1174,13 +1236,17 @@ pub mod api { technical_membership::calls::TransactionApi } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi { grandpa::calls::TransactionApi } + pub fn grandpa(&self) -> grandpa::calls::TransactionApi { + grandpa::calls::TransactionApi + } pub fn treasury(&self) -> treasury::calls::TransactionApi { treasury::calls::TransactionApi } - pub fn sudo(&self) -> sudo::calls::TransactionApi { sudo::calls::TransactionApi } + pub fn sudo(&self) -> sudo::calls::TransactionApi { + sudo::calls::TransactionApi + } pub fn im_online(&self) -> im_online::calls::TransactionApi { im_online::calls::TransactionApi @@ -1194,7 +1260,9 @@ pub mod api { bounties::calls::TransactionApi } - pub fn tips(&self) -> tips::calls::TransactionApi { tips::calls::TransactionApi } + pub fn tips(&self) -> tips::calls::TransactionApi { + tips::calls::TransactionApi + } pub fn data_availability(&self) -> data_availability::calls::TransactionApi { data_availability::calls::TransactionApi @@ -1232,17 +1300,15 @@ pub mod api { identity::calls::TransactionApi } - pub fn mandate(&self) -> mandate::calls::TransactionApi { mandate::calls::TransactionApi } + pub fn mandate(&self) -> mandate::calls::TransactionApi { + mandate::calls::TransactionApi + } } #[doc = r" check whether the Client you are using is aligned with the statically generated codegen."] pub fn validate_codegen>( client: &C, ) -> Result<(), ::subxt::error::MetadataError> { - let runtime_metadata_hash = client - .metadata() - .hasher() - .only_these_pallets(&PALLETS) - .hash(); + let runtime_metadata_hash = client.metadata().hasher().only_these_pallets(&PALLETS).hash(); if runtime_metadata_hash != [ 74u8, 73u8, 11u8, 210u8, 139u8, 115u8, 23u8, 22u8, 120u8, 16u8, 98u8, 176u8, 185u8, @@ -1752,9 +1818,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "System", "Account", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 234u8, 12u8, 167u8, 96u8, 2u8, 244u8, 235u8, 62u8, 153u8, 200u8, 96u8, 74u8, 135u8, 8u8, 35u8, 188u8, 146u8, 249u8, 246u8, 40u8, 224u8, 22u8, @@ -1873,9 +1937,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "System", "BlockHash", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 217u8, 32u8, 215u8, 253u8, 24u8, 182u8, 207u8, 178u8, 157u8, 24u8, 103u8, 100u8, 195u8, 165u8, 69u8, 152u8, 112u8, 181u8, 56u8, 192u8, @@ -1922,9 +1984,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "System", "ExtrinsicData", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 160u8, 180u8, 122u8, 18u8, 196u8, 26u8, 2u8, 37u8, 115u8, 232u8, 133u8, 220u8, 106u8, 245u8, 4u8, 129u8, 42u8, 84u8, 241u8, 45u8, 199u8, 179u8, @@ -1965,11 +2025,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("System", "Number", vec![], [ - 30u8, 194u8, 177u8, 90u8, 194u8, 232u8, 46u8, 180u8, 85u8, 129u8, 14u8, - 9u8, 8u8, 8u8, 23u8, 95u8, 230u8, 5u8, 13u8, 105u8, 125u8, 2u8, 22u8, - 200u8, 78u8, 93u8, 115u8, 28u8, 150u8, 113u8, 48u8, 53u8, - ]) + ::subxt::storage::address::Address::new_static( + "System", + "Number", + vec![], + [ + 30u8, 194u8, 177u8, 90u8, 194u8, 232u8, 46u8, 180u8, 85u8, 129u8, 14u8, + 9u8, 8u8, 8u8, 23u8, 95u8, 230u8, 5u8, 13u8, 105u8, 125u8, 2u8, 22u8, + 200u8, 78u8, 93u8, 115u8, 28u8, 150u8, 113u8, 48u8, 53u8, + ], + ) } #[doc = " Hash of the previous block."] @@ -2004,11 +2069,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("System", "Digest", vec![], [ - 70u8, 156u8, 127u8, 89u8, 115u8, 250u8, 103u8, 62u8, 185u8, 153u8, 26u8, - 72u8, 39u8, 226u8, 181u8, 97u8, 137u8, 225u8, 45u8, 158u8, 212u8, 254u8, - 142u8, 136u8, 90u8, 22u8, 243u8, 125u8, 226u8, 49u8, 235u8, 215u8, - ]) + ::subxt::storage::address::Address::new_static( + "System", + "Digest", + vec![], + [ + 70u8, 156u8, 127u8, 89u8, 115u8, 250u8, 103u8, 62u8, 185u8, 153u8, + 26u8, 72u8, 39u8, 226u8, 181u8, 97u8, 137u8, 225u8, 45u8, 158u8, 212u8, + 254u8, 142u8, 136u8, 90u8, 22u8, 243u8, 125u8, 226u8, 49u8, 235u8, + 215u8, + ], + ) } #[doc = " Events deposited for the current block."] @@ -2032,11 +2103,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("System", "Events", vec![], [ - 135u8, 70u8, 188u8, 138u8, 189u8, 89u8, 46u8, 4u8, 225u8, 244u8, 212u8, - 189u8, 221u8, 105u8, 161u8, 239u8, 176u8, 2u8, 188u8, 39u8, 88u8, 209u8, - 24u8, 183u8, 165u8, 251u8, 104u8, 239u8, 253u8, 88u8, 150u8, 34u8, - ]) + ::subxt::storage::address::Address::new_static( + "System", + "Events", + vec![], + [ + 135u8, 70u8, 188u8, 138u8, 189u8, 89u8, 46u8, 4u8, 225u8, 244u8, 212u8, + 189u8, 221u8, 105u8, 161u8, 239u8, 176u8, 2u8, 188u8, 39u8, 88u8, + 209u8, 24u8, 183u8, 165u8, 251u8, 104u8, 239u8, 253u8, 88u8, 150u8, + 34u8, + ], + ) } #[doc = " The number of events in the `Events` list."] @@ -2085,9 +2162,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "System", "EventTopics", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 154u8, 29u8, 31u8, 148u8, 254u8, 7u8, 124u8, 251u8, 241u8, 77u8, 24u8, 37u8, 28u8, 75u8, 205u8, 17u8, 159u8, 79u8, 239u8, 62u8, 67u8, 60u8, @@ -2249,55 +2324,77 @@ pub mod api { &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("System", "BlockWeights", [ - 238u8, 20u8, 221u8, 11u8, 146u8, 236u8, 47u8, 103u8, 8u8, 239u8, 13u8, - 176u8, 202u8, 10u8, 151u8, 68u8, 110u8, 162u8, 99u8, 40u8, 211u8, 136u8, - 71u8, 82u8, 50u8, 80u8, 244u8, 211u8, 231u8, 198u8, 36u8, 152u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "BlockWeights", + [ + 238u8, 20u8, 221u8, 11u8, 146u8, 236u8, 47u8, 103u8, 8u8, 239u8, 13u8, + 176u8, 202u8, 10u8, 151u8, 68u8, 110u8, 162u8, 99u8, 40u8, 211u8, + 136u8, 71u8, 82u8, 50u8, 80u8, 244u8, 211u8, 231u8, 198u8, 36u8, 152u8, + ], + ) } #[doc = " The maximum length of a block (in bytes)."] pub fn block_length( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("System", "BlockLength", [ - 166u8, 7u8, 126u8, 154u8, 133u8, 31u8, 100u8, 149u8, 118u8, 168u8, 1u8, - 21u8, 202u8, 114u8, 104u8, 193u8, 44u8, 97u8, 240u8, 37u8, 177u8, 43u8, - 83u8, 195u8, 176u8, 252u8, 201u8, 229u8, 170u8, 45u8, 136u8, 81u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "BlockLength", + [ + 166u8, 7u8, 126u8, 154u8, 133u8, 31u8, 100u8, 149u8, 118u8, 168u8, 1u8, + 21u8, 202u8, 114u8, 104u8, 193u8, 44u8, 97u8, 240u8, 37u8, 177u8, 43u8, + 83u8, 195u8, 176u8, 252u8, 201u8, 229u8, 170u8, 45u8, 136u8, 81u8, + ], + ) } #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] pub fn block_hash_count( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("System", "BlockHashCount", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "BlockHashCount", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The weight of runtime database operations the runtime can invoke."] pub fn db_weight( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("System", "DbWeight", [ - 206u8, 53u8, 134u8, 247u8, 42u8, 38u8, 197u8, 59u8, 191u8, 83u8, 160u8, - 9u8, 207u8, 133u8, 108u8, 152u8, 150u8, 103u8, 109u8, 228u8, 218u8, 24u8, - 27u8, 210u8, 106u8, 252u8, 74u8, 93u8, 27u8, 63u8, 109u8, 252u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "DbWeight", + [ + 206u8, 53u8, 134u8, 247u8, 42u8, 38u8, 197u8, 59u8, 191u8, 83u8, 160u8, + 9u8, 207u8, 133u8, 108u8, 152u8, 150u8, 103u8, 109u8, 228u8, 218u8, + 24u8, 27u8, 210u8, 106u8, 252u8, 74u8, 93u8, 27u8, 63u8, 109u8, 252u8, + ], + ) } #[doc = " Get the chain's current version."] pub fn version( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("System", "Version", [ - 134u8, 0u8, 23u8, 0u8, 199u8, 213u8, 89u8, 240u8, 194u8, 186u8, 239u8, - 157u8, 168u8, 211u8, 223u8, 156u8, 138u8, 140u8, 194u8, 23u8, 167u8, 158u8, - 195u8, 233u8, 25u8, 165u8, 27u8, 237u8, 198u8, 206u8, 233u8, 28u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "Version", + [ + 134u8, 0u8, 23u8, 0u8, 199u8, 213u8, 89u8, 240u8, 194u8, 186u8, 239u8, + 157u8, 168u8, 211u8, 223u8, 156u8, 138u8, 140u8, 194u8, 23u8, 167u8, + 158u8, 195u8, 233u8, 25u8, 165u8, 27u8, 237u8, 198u8, 206u8, 233u8, + 28u8, + ], + ) } #[doc = " The designated SS58 prefix of this chain."] @@ -2306,11 +2403,15 @@ pub mod api { #[doc = " that the runtime should know about the prefix in order to make use of it as"] #[doc = " an identifier of the chain."] pub fn ss58_prefix(&self) -> ::subxt::constants::Address<::core::primitive::u16> { - ::subxt::constants::Address::new_static("System", "SS58Prefix", [ - 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, 41u8, - 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, 90u8, - 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, - ]) + ::subxt::constants::Address::new_static( + "System", + "SS58Prefix", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, + 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, + 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) } } } @@ -2457,11 +2558,16 @@ pub mod api { &self, calls: ::std::vec::Vec, ) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Utility", "batch", types::Batch { calls }, [ - 220u8, 133u8, 43u8, 120u8, 158u8, 223u8, 27u8, 148u8, 207u8, 167u8, 54u8, - 93u8, 208u8, 199u8, 29u8, 110u8, 176u8, 77u8, 51u8, 216u8, 24u8, 86u8, - 103u8, 71u8, 108u8, 82u8, 226u8, 22u8, 10u8, 20u8, 117u8, 152u8, - ]) + ::subxt::tx::Payload::new_static( + "Utility", + "batch", + types::Batch { calls }, + [ + 220u8, 133u8, 43u8, 120u8, 158u8, 223u8, 27u8, 148u8, 207u8, 167u8, + 54u8, 93u8, 208u8, 199u8, 29u8, 110u8, 176u8, 77u8, 51u8, 216u8, 24u8, + 86u8, 103u8, 71u8, 108u8, 82u8, 226u8, 22u8, 10u8, 20u8, 117u8, 152u8, + ], + ) } #[doc = "See [`Pallet::as_derivative`]."] @@ -2473,10 +2579,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Utility", "as_derivative", - types::AsDerivative { - index, - call: ::std::boxed::Box::new(call), - }, + types::AsDerivative { index, call: ::std::boxed::Box::new(call) }, [ 239u8, 156u8, 200u8, 232u8, 225u8, 151u8, 177u8, 64u8, 199u8, 123u8, 24u8, 52u8, 146u8, 2u8, 241u8, 222u8, 167u8, 163u8, 114u8, 219u8, @@ -2551,10 +2654,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Utility", "with_weight", - types::WithWeight { - call: ::std::boxed::Box::new(call), - weight, - }, + types::WithWeight { call: ::std::boxed::Box::new(call), weight }, [ 212u8, 227u8, 1u8, 152u8, 56u8, 137u8, 254u8, 209u8, 221u8, 124u8, 89u8, 1u8, 218u8, 114u8, 133u8, 15u8, 166u8, 228u8, 234u8, 59u8, 72u8, @@ -2700,11 +2800,16 @@ pub mod api { pub fn batched_calls_limit( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Utility", "batched_calls_limit", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Utility", + "batched_calls_limit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -2889,11 +2994,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "EpochIndex", vec![], [ - 32u8, 82u8, 130u8, 31u8, 190u8, 162u8, 237u8, 189u8, 104u8, 244u8, 30u8, - 199u8, 179u8, 0u8, 161u8, 107u8, 72u8, 240u8, 201u8, 222u8, 177u8, 222u8, - 35u8, 156u8, 81u8, 132u8, 162u8, 118u8, 238u8, 84u8, 112u8, 89u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "EpochIndex", + vec![], + [ + 32u8, 82u8, 130u8, 31u8, 190u8, 162u8, 237u8, 189u8, 104u8, 244u8, + 30u8, 199u8, 179u8, 0u8, 161u8, 107u8, 72u8, 240u8, 201u8, 222u8, + 177u8, 222u8, 35u8, 156u8, 81u8, 132u8, 162u8, 118u8, 238u8, 84u8, + 112u8, 89u8, + ], + ) } #[doc = " Current epoch authorities."] @@ -2909,11 +3020,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "Authorities", vec![], [ - 67u8, 196u8, 244u8, 13u8, 246u8, 245u8, 198u8, 98u8, 81u8, 55u8, 182u8, - 187u8, 214u8, 5u8, 181u8, 76u8, 251u8, 213u8, 144u8, 166u8, 36u8, 153u8, - 234u8, 181u8, 252u8, 55u8, 198u8, 175u8, 55u8, 211u8, 105u8, 85u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "Authorities", + vec![], + [ + 67u8, 196u8, 244u8, 13u8, 246u8, 245u8, 198u8, 98u8, 81u8, 55u8, 182u8, + 187u8, 214u8, 5u8, 181u8, 76u8, 251u8, 213u8, 144u8, 166u8, 36u8, + 153u8, 234u8, 181u8, 252u8, 55u8, 198u8, 175u8, 55u8, 211u8, 105u8, + 85u8, + ], + ) } #[doc = " The slot at which the first epoch actually started. This is 0"] @@ -2927,11 +3044,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "GenesisSlot", vec![], [ - 218u8, 174u8, 152u8, 76u8, 188u8, 214u8, 7u8, 88u8, 253u8, 187u8, 139u8, - 234u8, 51u8, 28u8, 220u8, 57u8, 73u8, 1u8, 18u8, 205u8, 80u8, 160u8, 120u8, - 216u8, 139u8, 191u8, 100u8, 108u8, 162u8, 106u8, 175u8, 107u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "GenesisSlot", + vec![], + [ + 218u8, 174u8, 152u8, 76u8, 188u8, 214u8, 7u8, 88u8, 253u8, 187u8, + 139u8, 234u8, 51u8, 28u8, 220u8, 57u8, 73u8, 1u8, 18u8, 205u8, 80u8, + 160u8, 120u8, 216u8, 139u8, 191u8, 100u8, 108u8, 162u8, 106u8, 175u8, + 107u8, + ], + ) } #[doc = " Current slot number."] @@ -2944,11 +3067,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "CurrentSlot", vec![], [ - 112u8, 199u8, 115u8, 248u8, 217u8, 242u8, 45u8, 231u8, 178u8, 53u8, 236u8, - 167u8, 219u8, 238u8, 81u8, 243u8, 39u8, 140u8, 68u8, 19u8, 201u8, 169u8, - 211u8, 133u8, 135u8, 213u8, 150u8, 105u8, 60u8, 252u8, 43u8, 57u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "CurrentSlot", + vec![], + [ + 112u8, 199u8, 115u8, 248u8, 217u8, 242u8, 45u8, 231u8, 178u8, 53u8, + 236u8, 167u8, 219u8, 238u8, 81u8, 243u8, 39u8, 140u8, 68u8, 19u8, + 201u8, 169u8, 211u8, 133u8, 135u8, 213u8, 150u8, 105u8, 60u8, 252u8, + 43u8, 57u8, + ], + ) } #[doc = " The epoch randomness for the *current* epoch."] @@ -2970,11 +3099,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "Randomness", vec![], [ - 36u8, 15u8, 52u8, 73u8, 195u8, 177u8, 186u8, 125u8, 134u8, 11u8, 103u8, - 248u8, 170u8, 237u8, 105u8, 239u8, 168u8, 204u8, 147u8, 52u8, 15u8, 226u8, - 126u8, 176u8, 133u8, 186u8, 169u8, 241u8, 156u8, 118u8, 67u8, 58u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "Randomness", + vec![], + [ + 36u8, 15u8, 52u8, 73u8, 195u8, 177u8, 186u8, 125u8, 134u8, 11u8, 103u8, + 248u8, 170u8, 237u8, 105u8, 239u8, 168u8, 204u8, 147u8, 52u8, 15u8, + 226u8, 126u8, 176u8, 133u8, 186u8, 169u8, 241u8, 156u8, 118u8, 67u8, + 58u8, + ], + ) } #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] @@ -3095,9 +3230,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Babe", "UnderConstruction", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 120u8, 120u8, 59u8, 247u8, 50u8, 6u8, 220u8, 14u8, 2u8, 76u8, 203u8, 244u8, 232u8, 144u8, 253u8, 191u8, 101u8, 35u8, 99u8, 85u8, 111u8, @@ -3141,11 +3274,16 @@ pub mod api { (), (), > { - ::subxt::storage::address::Address::new_static("Babe", "Initialized", vec![], [ - 61u8, 100u8, 12u8, 43u8, 50u8, 166u8, 173u8, 130u8, 86u8, 36u8, 92u8, - 221u8, 44u8, 235u8, 241u8, 150u8, 231u8, 108u8, 15u8, 134u8, 12u8, 6u8, - 198u8, 102u8, 63u8, 69u8, 201u8, 171u8, 14u8, 135u8, 254u8, 239u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "Initialized", + vec![], + [ + 61u8, 100u8, 12u8, 43u8, 50u8, 166u8, 173u8, 130u8, 86u8, 36u8, 92u8, + 221u8, 44u8, 235u8, 241u8, 150u8, 231u8, 108u8, 15u8, 134u8, 12u8, 6u8, + 198u8, 102u8, 63u8, 69u8, 201u8, 171u8, 14u8, 135u8, 254u8, 239u8, + ], + ) } #[doc = " This field should always be populated during block processing unless"] @@ -3188,11 +3326,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "EpochStart", vec![], [ - 246u8, 69u8, 165u8, 217u8, 181u8, 138u8, 201u8, 64u8, 251u8, 121u8, 50u8, - 231u8, 221u8, 144u8, 225u8, 249u8, 42u8, 135u8, 31u8, 136u8, 21u8, 160u8, - 186u8, 148u8, 139u8, 232u8, 182u8, 121u8, 82u8, 110u8, 14u8, 160u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "EpochStart", + vec![], + [ + 246u8, 69u8, 165u8, 217u8, 181u8, 138u8, 201u8, 64u8, 251u8, 121u8, + 50u8, 231u8, 221u8, 144u8, 225u8, 249u8, 42u8, 135u8, 31u8, 136u8, + 21u8, 160u8, 186u8, 148u8, 139u8, 232u8, 182u8, 121u8, 82u8, 110u8, + 14u8, 160u8, + ], + ) } #[doc = " How late the current block is compared to its parent."] @@ -3209,11 +3353,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Babe", "Lateness", vec![], [ - 229u8, 214u8, 133u8, 149u8, 32u8, 159u8, 26u8, 22u8, 252u8, 131u8, 200u8, - 191u8, 231u8, 176u8, 178u8, 127u8, 33u8, 212u8, 139u8, 220u8, 157u8, 38u8, - 4u8, 226u8, 204u8, 32u8, 55u8, 20u8, 205u8, 141u8, 29u8, 87u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "Lateness", + vec![], + [ + 229u8, 214u8, 133u8, 149u8, 32u8, 159u8, 26u8, 22u8, 252u8, 131u8, + 200u8, 191u8, 231u8, 176u8, 178u8, 127u8, 33u8, 212u8, 139u8, 220u8, + 157u8, 38u8, 4u8, 226u8, 204u8, 32u8, 55u8, 20u8, 205u8, 141u8, 29u8, + 87u8, + ], + ) } #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] @@ -3227,11 +3377,17 @@ pub mod api { (), (), > { - ::subxt::storage::address::Address::new_static("Babe", "EpochConfig", vec![], [ - 23u8, 188u8, 70u8, 119u8, 36u8, 199u8, 230u8, 191u8, 131u8, 219u8, 85u8, - 201u8, 237u8, 70u8, 214u8, 149u8, 212u8, 94u8, 87u8, 87u8, 62u8, 16u8, - 46u8, 143u8, 73u8, 169u8, 42u8, 139u8, 157u8, 139u8, 190u8, 166u8, - ]) + ::subxt::storage::address::Address::new_static( + "Babe", + "EpochConfig", + vec![], + [ + 23u8, 188u8, 70u8, 119u8, 36u8, 199u8, 230u8, 191u8, 131u8, 219u8, + 85u8, 201u8, 237u8, 70u8, 214u8, 149u8, 212u8, 94u8, 87u8, 87u8, 62u8, + 16u8, 46u8, 143u8, 73u8, 169u8, 42u8, 139u8, 157u8, 139u8, 190u8, + 166u8, + ], + ) } #[doc = " The configuration for the next epoch, `None` if the config will not change"] @@ -3300,11 +3456,16 @@ pub mod api { pub fn epoch_duration( &self, ) -> ::subxt::constants::Address<::core::primitive::u64> { - ::subxt::constants::Address::new_static("Babe", "EpochDuration", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, 59u8, - 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, 103u8, 119u8, - 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ]) + ::subxt::constants::Address::new_static( + "Babe", + "EpochDuration", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } #[doc = " The expected average block time at which BABE should be creating"] @@ -3315,22 +3476,32 @@ pub mod api { pub fn expected_block_time( &self, ) -> ::subxt::constants::Address<::core::primitive::u64> { - ::subxt::constants::Address::new_static("Babe", "ExpectedBlockTime", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, 59u8, - 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, 103u8, 119u8, - 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ]) + ::subxt::constants::Address::new_static( + "Babe", + "ExpectedBlockTime", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } #[doc = " Max number of authorities allowed"] pub fn max_authorities( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Babe", "MaxAuthorities", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Babe", + "MaxAuthorities", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -3370,11 +3541,16 @@ pub mod api { impl TransactionApi { #[doc = "See [`Pallet::set`]."] pub fn set(&self, now: ::core::primitive::u64) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Timestamp", "set", types::Set { now }, [ - 37u8, 95u8, 49u8, 218u8, 24u8, 22u8, 0u8, 95u8, 72u8, 35u8, 155u8, 199u8, - 213u8, 54u8, 207u8, 22u8, 185u8, 193u8, 221u8, 70u8, 18u8, 200u8, 4u8, - 231u8, 195u8, 173u8, 6u8, 122u8, 11u8, 203u8, 231u8, 227u8, - ]) + ::subxt::tx::Payload::new_static( + "Timestamp", + "set", + types::Set { now }, + [ + 37u8, 95u8, 49u8, 218u8, 24u8, 22u8, 0u8, 95u8, 72u8, 35u8, 155u8, + 199u8, 213u8, 54u8, 207u8, 22u8, 185u8, 193u8, 221u8, 70u8, 18u8, + 200u8, 4u8, 231u8, 195u8, 173u8, 6u8, 122u8, 11u8, 203u8, 231u8, 227u8, + ], + ) } } } @@ -3392,11 +3568,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Timestamp", "Now", vec![], [ - 44u8, 50u8, 80u8, 30u8, 195u8, 146u8, 123u8, 238u8, 8u8, 163u8, 187u8, - 92u8, 61u8, 39u8, 51u8, 29u8, 173u8, 169u8, 217u8, 158u8, 85u8, 187u8, - 141u8, 26u8, 12u8, 115u8, 51u8, 11u8, 200u8, 244u8, 138u8, 152u8, - ]) + ::subxt::storage::address::Address::new_static( + "Timestamp", + "Now", + vec![], + [ + 44u8, 50u8, 80u8, 30u8, 195u8, 146u8, 123u8, 238u8, 8u8, 163u8, 187u8, + 92u8, 61u8, 39u8, 51u8, 29u8, 173u8, 169u8, 217u8, 158u8, 85u8, 187u8, + 141u8, 26u8, 12u8, 115u8, 51u8, 11u8, 200u8, 244u8, 138u8, 152u8, + ], + ) } #[doc = " Did the timestamp get updated in this block?"] @@ -3434,11 +3615,16 @@ pub mod api { pub fn minimum_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u64> { - ::subxt::constants::Address::new_static("Timestamp", "MinimumPeriod", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, 59u8, - 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, 103u8, 119u8, - 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ]) + ::subxt::constants::Address::new_static( + "Timestamp", + "MinimumPeriod", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } } } @@ -3605,11 +3791,16 @@ pub mod api { &self, index: ::core::primitive::u32, ) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Indices", "claim", types::Claim { index }, [ - 146u8, 58u8, 246u8, 135u8, 59u8, 90u8, 3u8, 5u8, 140u8, 169u8, 232u8, - 195u8, 11u8, 107u8, 36u8, 141u8, 118u8, 174u8, 160u8, 160u8, 19u8, 205u8, - 177u8, 193u8, 18u8, 102u8, 115u8, 31u8, 72u8, 29u8, 91u8, 235u8, - ]) + ::subxt::tx::Payload::new_static( + "Indices", + "claim", + types::Claim { index }, + [ + 146u8, 58u8, 246u8, 135u8, 59u8, 90u8, 3u8, 5u8, 140u8, 169u8, 232u8, + 195u8, 11u8, 107u8, 36u8, 141u8, 118u8, 174u8, 160u8, 160u8, 19u8, + 205u8, 177u8, 193u8, 18u8, 102u8, 115u8, 31u8, 72u8, 29u8, 91u8, 235u8, + ], + ) } #[doc = "See [`Pallet::transfer`]."] @@ -3639,11 +3830,17 @@ pub mod api { &self, index: ::core::primitive::u32, ) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Indices", "free", types::Free { index }, [ - 241u8, 211u8, 234u8, 102u8, 189u8, 22u8, 209u8, 27u8, 8u8, 229u8, 80u8, - 227u8, 138u8, 252u8, 222u8, 111u8, 77u8, 201u8, 235u8, 51u8, 163u8, 247u8, - 13u8, 126u8, 216u8, 136u8, 57u8, 222u8, 56u8, 66u8, 215u8, 244u8, - ]) + ::subxt::tx::Payload::new_static( + "Indices", + "free", + types::Free { index }, + [ + 241u8, 211u8, 234u8, 102u8, 189u8, 22u8, 209u8, 27u8, 8u8, 229u8, 80u8, + 227u8, 138u8, 252u8, 222u8, 111u8, 77u8, 201u8, 235u8, 51u8, 163u8, + 247u8, 13u8, 126u8, 216u8, 136u8, 57u8, 222u8, 56u8, 66u8, 215u8, + 244u8, + ], + ) } #[doc = "See [`Pallet::force_transfer`]."] @@ -3769,11 +3966,7 @@ pub mod api { _0: impl ::std::borrow::Borrow<::core::primitive::u32>, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - ::subxt::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ), + (::subxt::utils::AccountId32, ::core::primitive::u128, ::core::primitive::bool), ::subxt::storage::address::Yes, (), ::subxt::storage::address::Yes, @@ -3781,9 +3974,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Indices", "Accounts", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 48u8, 189u8, 43u8, 119u8, 32u8, 168u8, 28u8, 12u8, 245u8, 81u8, 119u8, 182u8, 23u8, 201u8, 33u8, 147u8, 128u8, 171u8, 155u8, 134u8, 71u8, @@ -3798,11 +3989,7 @@ pub mod api { &self, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - ::subxt::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ), + (::subxt::utils::AccountId32, ::core::primitive::u128, ::core::primitive::bool), (), (), ::subxt::storage::address::Yes, @@ -3827,11 +4014,15 @@ pub mod api { impl ConstantsApi { #[doc = " The deposit needed for reserving an index."] pub fn deposit(&self) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Indices", "Deposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Indices", + "Deposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } @@ -4108,11 +4299,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Balances", "set_balance_deprecated", - types::SetBalanceDeprecated { - who, - new_free, - old_reserved, - }, + types::SetBalanceDeprecated { who, new_free, old_reserved }, [ 135u8, 204u8, 148u8, 253u8, 76u8, 20u8, 79u8, 5u8, 133u8, 232u8, 10u8, 79u8, 199u8, 52u8, 199u8, 42u8, 124u8, 55u8, 82u8, 71u8, 102u8, 81u8, @@ -4137,11 +4324,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Balances", "force_transfer", - types::ForceTransfer { - source, - dest, - value, - }, + types::ForceTransfer { source, dest, value }, [ 192u8, 208u8, 171u8, 116u8, 91u8, 20u8, 177u8, 202u8, 113u8, 195u8, 44u8, 49u8, 140u8, 190u8, 168u8, 41u8, 165u8, 202u8, 68u8, 127u8, @@ -4834,9 +5017,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Balances", "Account", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 47u8, 253u8, 83u8, 165u8, 18u8, 176u8, 62u8, 239u8, 78u8, 85u8, 231u8, 235u8, 157u8, 145u8, 251u8, 35u8, 225u8, 171u8, 82u8, 167u8, 68u8, @@ -4909,9 +5090,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Balances", "Locks", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 44u8, 44u8, 48u8, 20u8, 121u8, 168u8, 200u8, 87u8, 205u8, 172u8, 111u8, 208u8, 62u8, 243u8, 225u8, 223u8, 181u8, 36u8, 197u8, 9u8, 52u8, 182u8, @@ -4964,9 +5143,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Balances", "Reserves", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 192u8, 99u8, 91u8, 129u8, 195u8, 73u8, 153u8, 126u8, 82u8, 52u8, 56u8, 85u8, 105u8, 178u8, 113u8, 101u8, 229u8, 37u8, 242u8, 174u8, 166u8, @@ -5023,9 +5200,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Balances", "Holds", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 37u8, 176u8, 2u8, 18u8, 109u8, 26u8, 66u8, 81u8, 28u8, 104u8, 149u8, 117u8, 119u8, 114u8, 196u8, 35u8, 172u8, 155u8, 66u8, 195u8, 98u8, @@ -5080,9 +5255,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Balances", "Freezes", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 69u8, 49u8, 165u8, 76u8, 135u8, 142u8, 179u8, 118u8, 50u8, 109u8, 53u8, 112u8, 110u8, 94u8, 30u8, 93u8, 173u8, 38u8, 27u8, 142u8, 19u8, 5u8, @@ -5134,48 +5307,72 @@ pub mod api { pub fn existential_deposit( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Balances", "ExistentialDeposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Balances", + "ExistentialDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of locks that should exist on an account."] #[doc = " Not strictly enforced, but used for weight estimation."] pub fn max_locks(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Balances", "MaxLocks", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Balances", + "MaxLocks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of named reserves that can exist on an account."] pub fn max_reserves(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Balances", "MaxReserves", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Balances", + "MaxReserves", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of holds that can exist on an account at any time."] pub fn max_holds(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Balances", "MaxHolds", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Balances", + "MaxHolds", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of individual freeze locks that can exist on an account at any time."] pub fn max_freezes(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Balances", "MaxFreezes", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Balances", + "MaxFreezes", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -5504,9 +5701,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "ElectionProviderMultiPhase", "submit", - types::Submit { - raw_solution: ::std::boxed::Box::new(raw_solution), - }, + types::Submit { raw_solution: ::std::boxed::Box::new(raw_solution) }, [ 55u8, 153u8, 215u8, 21u8, 19u8, 192u8, 199u8, 19u8, 145u8, 27u8, 54u8, 128u8, 23u8, 3u8, 255u8, 87u8, 27u8, 75u8, 248u8, 145u8, 238u8, 75u8, @@ -5524,10 +5719,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "ElectionProviderMultiPhase", "governance_fallback", - types::GovernanceFallback { - maybe_max_voters, - maybe_max_targets, - }, + types::GovernanceFallback { maybe_max_voters, maybe_max_targets }, [ 168u8, 109u8, 243u8, 125u8, 188u8, 177u8, 251u8, 179u8, 158u8, 246u8, 179u8, 247u8, 87u8, 217u8, 190u8, 107u8, 207u8, 249u8, 204u8, 27u8, @@ -5934,9 +6126,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "ElectionProviderMultiPhase", "SignedSubmissionsMap", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 79u8, 183u8, 109u8, 221u8, 2u8, 64u8, 197u8, 162u8, 221u8, 170u8, 140u8, 136u8, 205u8, 111u8, 8u8, 179u8, 166u8, 104u8, 74u8, 219u8, @@ -7019,11 +7209,16 @@ pub mod api { #[doc = "See [`Pallet::chill`]."] pub fn chill(&self) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Staking", "chill", types::Chill {}, [ - 157u8, 75u8, 243u8, 69u8, 110u8, 192u8, 22u8, 27u8, 107u8, 68u8, 236u8, - 58u8, 179u8, 34u8, 118u8, 98u8, 131u8, 62u8, 242u8, 84u8, 149u8, 24u8, - 83u8, 223u8, 78u8, 12u8, 192u8, 22u8, 111u8, 11u8, 171u8, 149u8, - ]) + ::subxt::tx::Payload::new_static( + "Staking", + "chill", + types::Chill {}, + [ + 157u8, 75u8, 243u8, 69u8, 110u8, 192u8, 22u8, 27u8, 107u8, 68u8, 236u8, + 58u8, 179u8, 34u8, 118u8, 98u8, 131u8, 62u8, 242u8, 84u8, 149u8, 24u8, + 83u8, 223u8, 78u8, 12u8, 192u8, 22u8, 111u8, 11u8, 171u8, 149u8, + ], + ) } #[doc = "See [`Pallet::set_payee`]."] @@ -7170,10 +7365,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Staking", "force_unstake", - types::ForceUnstake { - stash, - num_slashing_spans, - }, + types::ForceUnstake { stash, num_slashing_spans }, [ 205u8, 115u8, 222u8, 58u8, 168u8, 3u8, 59u8, 58u8, 220u8, 98u8, 204u8, 90u8, 36u8, 250u8, 178u8, 45u8, 213u8, 158u8, 92u8, 107u8, 3u8, 94u8, @@ -7226,10 +7418,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Staking", "payout_stakers", - types::PayoutStakers { - validator_stash, - era, - }, + types::PayoutStakers { validator_stash, era }, [ 69u8, 67u8, 140u8, 197u8, 89u8, 20u8, 59u8, 55u8, 142u8, 197u8, 62u8, 107u8, 239u8, 50u8, 237u8, 52u8, 4u8, 65u8, 119u8, 73u8, 138u8, 57u8, @@ -7264,10 +7453,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Staking", "reap_stash", - types::ReapStash { - stash, - num_slashing_spans, - }, + types::ReapStash { stash, num_slashing_spans }, [ 231u8, 240u8, 152u8, 33u8, 10u8, 60u8, 18u8, 233u8, 0u8, 229u8, 90u8, 45u8, 118u8, 29u8, 98u8, 109u8, 89u8, 7u8, 228u8, 254u8, 119u8, 125u8, @@ -7286,11 +7472,16 @@ pub mod api { >, >, ) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Staking", "kick", types::Kick { who }, [ - 28u8, 254u8, 219u8, 14u8, 44u8, 187u8, 186u8, 72u8, 55u8, 21u8, 129u8, - 205u8, 225u8, 204u8, 162u8, 53u8, 255u8, 56u8, 49u8, 194u8, 63u8, 43u8, - 96u8, 177u8, 125u8, 0u8, 163u8, 97u8, 231u8, 159u8, 43u8, 249u8, - ]) + ::subxt::tx::Payload::new_static( + "Staking", + "kick", + types::Kick { who }, + [ + 28u8, 254u8, 219u8, 14u8, 44u8, 187u8, 186u8, 72u8, 55u8, 21u8, 129u8, + 205u8, 225u8, 204u8, 162u8, 53u8, 255u8, 56u8, 49u8, 194u8, 63u8, 43u8, + 96u8, 177u8, 125u8, 0u8, 163u8, 97u8, 231u8, 159u8, 43u8, 249u8, + ], + ) } #[doc = "See [`Pallet::set_staking_configs`]."] @@ -7814,9 +8005,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "Bonded", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 146u8, 230u8, 48u8, 190u8, 166u8, 127u8, 237u8, 216u8, 71u8, 33u8, 108u8, 121u8, 204u8, 211u8, 133u8, 123u8, 52u8, 164u8, 201u8, 209u8, @@ -7957,9 +8146,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "Ledger", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 77u8, 39u8, 230u8, 122u8, 108u8, 191u8, 251u8, 28u8, 233u8, 225u8, 195u8, 224u8, 234u8, 90u8, 173u8, 170u8, 143u8, 246u8, 246u8, 21u8, @@ -8008,9 +8195,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "Payee", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 198u8, 238u8, 10u8, 104u8, 204u8, 7u8, 193u8, 254u8, 169u8, 18u8, 187u8, 212u8, 90u8, 243u8, 73u8, 29u8, 216u8, 144u8, 93u8, 140u8, 11u8, @@ -8059,9 +8244,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "Validators", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 149u8, 207u8, 68u8, 38u8, 24u8, 220u8, 207u8, 84u8, 236u8, 33u8, 210u8, 124u8, 200u8, 99u8, 98u8, 29u8, 235u8, 46u8, 124u8, 4u8, 203u8, 6u8, @@ -8173,9 +8356,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "Nominators", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 114u8, 45u8, 86u8, 23u8, 12u8, 98u8, 114u8, 3u8, 170u8, 11u8, 100u8, 17u8, 122u8, 158u8, 192u8, 21u8, 160u8, 87u8, 85u8, 142u8, 241u8, @@ -8338,9 +8519,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "ErasStartSessionIndex", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 72u8, 185u8, 246u8, 202u8, 79u8, 127u8, 173u8, 74u8, 216u8, 238u8, 58u8, 82u8, 235u8, 222u8, 76u8, 144u8, 97u8, 84u8, 17u8, 164u8, 132u8, @@ -8593,9 +8772,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "ErasValidatorReward", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 185u8, 85u8, 179u8, 163u8, 178u8, 168u8, 141u8, 200u8, 59u8, 77u8, 2u8, 197u8, 36u8, 188u8, 133u8, 117u8, 2u8, 25u8, 105u8, 132u8, 44u8, 75u8, @@ -8643,9 +8820,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "ErasRewardPoints", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 237u8, 135u8, 146u8, 156u8, 172u8, 48u8, 147u8, 207u8, 15u8, 86u8, 55u8, 38u8, 29u8, 253u8, 198u8, 192u8, 99u8, 213u8, 80u8, 72u8, 212u8, @@ -8692,9 +8867,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "ErasTotalStake", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 8u8, 78u8, 101u8, 62u8, 124u8, 126u8, 66u8, 26u8, 47u8, 126u8, 239u8, 204u8, 222u8, 104u8, 19u8, 108u8, 238u8, 160u8, 112u8, 242u8, 56u8, @@ -8738,11 +8911,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Staking", "ForceEra", vec![], [ - 177u8, 148u8, 73u8, 108u8, 136u8, 126u8, 89u8, 18u8, 124u8, 66u8, 30u8, - 102u8, 133u8, 164u8, 78u8, 214u8, 184u8, 163u8, 75u8, 164u8, 117u8, 233u8, - 209u8, 158u8, 99u8, 208u8, 21u8, 194u8, 152u8, 82u8, 16u8, 222u8, - ]) + ::subxt::storage::address::Address::new_static( + "Staking", + "ForceEra", + vec![], + [ + 177u8, 148u8, 73u8, 108u8, 136u8, 126u8, 89u8, 18u8, 124u8, 66u8, 30u8, + 102u8, 133u8, 164u8, 78u8, 214u8, 184u8, 163u8, 75u8, 164u8, 117u8, + 233u8, 209u8, 158u8, 99u8, 208u8, 21u8, 194u8, 152u8, 82u8, 16u8, + 222u8, + ], + ) } #[doc = " The percentage of the slash that is distributed to reporters."] @@ -8813,9 +8992,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "UnappliedSlashes", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 121u8, 1u8, 135u8, 243u8, 99u8, 254u8, 238u8, 207u8, 145u8, 172u8, 186u8, 131u8, 181u8, 109u8, 199u8, 93u8, 129u8, 65u8, 106u8, 118u8, @@ -8887,10 +9064,7 @@ pub mod api { _1: impl ::std::borrow::Borrow<::subxt::utils::AccountId32>, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - ), + (runtime_types::sp_arithmetic::per_things::Perbill, ::core::primitive::u128), ::subxt::storage::address::Yes, (), ::subxt::storage::address::Yes, @@ -8916,10 +9090,7 @@ pub mod api { &self, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - runtime_types::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - ), + (runtime_types::sp_arithmetic::per_things::Perbill, ::core::primitive::u128), (), (), ::subxt::storage::address::Yes, @@ -8999,9 +9170,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Staking", "SlashingSpans", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 160u8, 190u8, 57u8, 128u8, 105u8, 73u8, 194u8, 75u8, 12u8, 120u8, 141u8, 190u8, 235u8, 250u8, 221u8, 200u8, 141u8, 162u8, 31u8, 85u8, @@ -9173,11 +9342,16 @@ pub mod api { pub fn max_nominations( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "MaxNominations", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "MaxNominations", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Number of eras to keep in history."] @@ -9201,33 +9375,48 @@ pub mod api { #[doc = " `StakingLedger` and will need to be handled properly in a migration."] #[doc = " The test `reducing_history_depth_abrupt` shows this effect."] pub fn history_depth(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "HistoryDepth", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "HistoryDepth", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Number of sessions per era."] pub fn sessions_per_era( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "SessionsPerEra", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "SessionsPerEra", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Number of eras that staked funds must remain bonded for."] pub fn bonding_duration( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "BondingDuration", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "BondingDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Number of eras that slashes are deferred by, after computation."] @@ -9237,11 +9426,16 @@ pub mod api { pub fn slash_defer_duration( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "SlashDeferDuration", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "SlashDeferDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of nominators rewarded for each validator."] @@ -9276,11 +9470,16 @@ pub mod api { pub fn max_unlocking_chunks( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Staking", "MaxUnlockingChunks", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Staking", + "MaxUnlockingChunks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -9541,9 +9740,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Session", "NextKeys", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 27u8, 24u8, 147u8, 49u8, 85u8, 69u8, 22u8, 49u8, 162u8, 194u8, 189u8, 109u8, 68u8, 151u8, 200u8, 43u8, 23u8, 251u8, 43u8, 102u8, 85u8, 236u8, @@ -10196,11 +10393,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Democracy", "fast_track", - types::FastTrack { - proposal_hash, - voting_period, - delay, - }, + types::FastTrack { proposal_hash, voting_period, delay }, [ 147u8, 226u8, 166u8, 105u8, 149u8, 171u8, 86u8, 165u8, 168u8, 78u8, 233u8, 182u8, 118u8, 36u8, 82u8, 155u8, 209u8, 55u8, 153u8, 141u8, @@ -10259,11 +10452,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Democracy", "delegate", - types::Delegate { - to, - conviction, - balance, - }, + types::Delegate { to, conviction, balance }, [ 252u8, 37u8, 255u8, 84u8, 153u8, 112u8, 84u8, 10u8, 131u8, 85u8, 6u8, 204u8, 85u8, 241u8, 104u8, 155u8, 219u8, 222u8, 30u8, 7u8, 245u8, 12u8, @@ -10373,10 +10562,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Democracy", "blacklist", - types::Blacklist { - proposal_hash, - maybe_ref_index, - }, + types::Blacklist { proposal_hash, maybe_ref_index }, [ 227u8, 200u8, 88u8, 154u8, 134u8, 121u8, 131u8, 177u8, 94u8, 119u8, 12u8, 129u8, 150u8, 59u8, 108u8, 103u8, 109u8, 55u8, 220u8, 211u8, @@ -10877,9 +11063,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "DepositOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 115u8, 12u8, 250u8, 191u8, 201u8, 165u8, 90u8, 140u8, 101u8, 47u8, 46u8, 3u8, 78u8, 30u8, 180u8, 22u8, 28u8, 154u8, 36u8, 99u8, 255u8, @@ -10985,9 +11169,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "ReferendumInfoOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 250u8, 201u8, 144u8, 220u8, 13u8, 14u8, 69u8, 171u8, 240u8, 119u8, 158u8, 200u8, 86u8, 77u8, 115u8, 156u8, 156u8, 101u8, 215u8, 233u8, @@ -11049,9 +11231,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "VotingOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 170u8, 234u8, 179u8, 190u8, 153u8, 172u8, 83u8, 105u8, 57u8, 88u8, 183u8, 54u8, 172u8, 149u8, 222u8, 240u8, 128u8, 46u8, 25u8, 10u8, @@ -11164,9 +11344,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "Blacklist", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 238u8, 119u8, 98u8, 220u8, 11u8, 209u8, 90u8, 9u8, 69u8, 51u8, 59u8, 177u8, 169u8, 113u8, 138u8, 13u8, 134u8, 14u8, 184u8, 6u8, 80u8, 182u8, @@ -11217,9 +11395,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "Cancellations", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 80u8, 190u8, 98u8, 105u8, 129u8, 25u8, 167u8, 180u8, 74u8, 128u8, 232u8, 29u8, 193u8, 209u8, 185u8, 60u8, 18u8, 180u8, 59u8, 192u8, @@ -11273,9 +11449,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Democracy", "MetadataOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 241u8, 106u8, 118u8, 66u8, 219u8, 192u8, 185u8, 117u8, 144u8, 174u8, 171u8, 207u8, 181u8, 32u8, 133u8, 127u8, 160u8, 218u8, 113u8, 153u8, @@ -11326,29 +11500,44 @@ pub mod api { pub fn enactment_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "EnactmentPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "EnactmentPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " How often (in blocks) new public referenda are launched."] pub fn launch_period(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "LaunchPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "LaunchPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " How often (in blocks) to check for new votes."] pub fn voting_period(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "VotingPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "VotingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The minimum period of vote locking."] @@ -11358,22 +11547,31 @@ pub mod api { pub fn vote_locking_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "VoteLockingPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "VoteLockingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] pub fn minimum_deposit( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Democracy", "MinimumDeposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "MinimumDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Indicator for whether an emergency origin is even allowed to happen. Some chains may"] @@ -11382,33 +11580,47 @@ pub mod api { pub fn instant_allowed( &self, ) -> ::subxt::constants::Address<::core::primitive::bool> { - ::subxt::constants::Address::new_static("Democracy", "InstantAllowed", [ - 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, 1u8, 68u8, - 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, 47u8, 126u8, 134u8, 100u8, - 14u8, 86u8, 209u8, 39u8, 20u8, 4u8, 233u8, 115u8, 102u8, 131u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "InstantAllowed", + [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, 1u8, 68u8, + 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, 47u8, 126u8, 134u8, + 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, 4u8, 233u8, 115u8, 102u8, 131u8, + ], + ) } #[doc = " Minimum voting period allowed for a fast-track referendum."] pub fn fast_track_voting_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "FastTrackVotingPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "FastTrackVotingPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Period in blocks where an external proposal may not be re-submitted after being vetoed."] pub fn cooloff_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "CooloffPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "CooloffPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of votes for an account."] @@ -11416,40 +11628,60 @@ pub mod api { #[doc = " Also used to compute weight, an overly big value can"] #[doc = " lead to extrinsic with very big weight: see `delegate` for instance."] pub fn max_votes(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "MaxVotes", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "MaxVotes", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of public proposals that can exist at any time."] pub fn max_proposals(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "MaxProposals", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "MaxProposals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of deposits a public proposal may have at any time."] pub fn max_deposits(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "MaxDeposits", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "MaxDeposits", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of items which can be blacklisted."] pub fn max_blacklisted( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Democracy", "MaxBlacklisted", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Democracy", + "MaxBlacklisted", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -11614,11 +11846,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Council", "set_members", - types::SetMembers { - new_members, - prime, - old_count, - }, + types::SetMembers { new_members, prime, old_count }, [ 141u8, 113u8, 137u8, 46u8, 75u8, 22u8, 143u8, 204u8, 50u8, 24u8, 137u8, 25u8, 226u8, 166u8, 121u8, 161u8, 54u8, 144u8, 12u8, 145u8, 157u8, @@ -11637,10 +11865,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Council", "execute", - types::Execute { - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }, + types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ 1u8, 38u8, 214u8, 226u8, 97u8, 229u8, 11u8, 242u8, 214u8, 241u8, 236u8, 153u8, 130u8, 210u8, 175u8, 160u8, 127u8, 82u8, 98u8, 101u8, 63u8, @@ -11683,11 +11908,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Council", "vote", - types::Vote { - proposal, - index, - approve, - }, + types::Vote { proposal, index, approve }, [ 110u8, 141u8, 24u8, 33u8, 91u8, 7u8, 89u8, 198u8, 54u8, 10u8, 76u8, 129u8, 45u8, 20u8, 216u8, 104u8, 231u8, 246u8, 174u8, 205u8, 190u8, @@ -11725,12 +11946,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Council", "close", - types::Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }, + types::Close { proposal_hash, index, proposal_weight_bound, length_bound }, [ 189u8, 149u8, 125u8, 63u8, 39u8, 201u8, 247u8, 4u8, 220u8, 74u8, 78u8, 14u8, 113u8, 163u8, 1u8, 159u8, 81u8, 248u8, 141u8, 111u8, 34u8, 243u8, @@ -11947,9 +12163,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Council", "ProposalOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 211u8, 81u8, 191u8, 143u8, 109u8, 169u8, 12u8, 12u8, 190u8, 218u8, 108u8, 146u8, 228u8, 21u8, 63u8, 28u8, 185u8, 152u8, 226u8, 164u8, @@ -11999,9 +12213,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Council", "Voting", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 56u8, 192u8, 111u8, 180u8, 253u8, 5u8, 232u8, 126u8, 177u8, 48u8, 135u8, 39u8, 89u8, 71u8, 62u8, 239u8, 216u8, 17u8, 64u8, 82u8, 130u8, @@ -12067,11 +12279,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Council", "Members", vec![], [ - 16u8, 29u8, 32u8, 222u8, 175u8, 136u8, 111u8, 101u8, 43u8, 74u8, 209u8, - 81u8, 47u8, 97u8, 129u8, 39u8, 225u8, 243u8, 110u8, 229u8, 237u8, 21u8, - 90u8, 127u8, 80u8, 239u8, 156u8, 32u8, 90u8, 109u8, 179u8, 0u8, - ]) + ::subxt::storage::address::Address::new_static( + "Council", + "Members", + vec![], + [ + 16u8, 29u8, 32u8, 222u8, 175u8, 136u8, 111u8, 101u8, 43u8, 74u8, 209u8, + 81u8, 47u8, 97u8, 129u8, 39u8, 225u8, 243u8, 110u8, 229u8, 237u8, 21u8, + 90u8, 127u8, 80u8, 239u8, 156u8, 32u8, 90u8, 109u8, 179u8, 0u8, + ], + ) } #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] @@ -12084,11 +12301,16 @@ pub mod api { (), (), > { - ::subxt::storage::address::Address::new_static("Council", "Prime", vec![], [ - 72u8, 128u8, 214u8, 72u8, 78u8, 80u8, 100u8, 198u8, 114u8, 215u8, 59u8, - 3u8, 103u8, 14u8, 152u8, 202u8, 12u8, 165u8, 224u8, 10u8, 41u8, 154u8, - 77u8, 95u8, 116u8, 143u8, 250u8, 250u8, 176u8, 92u8, 238u8, 154u8, - ]) + ::subxt::storage::address::Address::new_static( + "Council", + "Prime", + vec![], + [ + 72u8, 128u8, 214u8, 72u8, 78u8, 80u8, 100u8, 198u8, 114u8, 215u8, 59u8, + 3u8, 103u8, 14u8, 152u8, 202u8, 12u8, 165u8, 224u8, 10u8, 41u8, 154u8, + 77u8, 95u8, 116u8, 143u8, 250u8, 250u8, 176u8, 92u8, 238u8, 154u8, + ], + ) } } } @@ -12100,11 +12322,15 @@ pub mod api { pub fn max_proposal_weight( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Council", "MaxProposalWeight", [ - 222u8, 183u8, 203u8, 169u8, 31u8, 134u8, 28u8, 12u8, 47u8, 140u8, 71u8, - 74u8, 61u8, 55u8, 71u8, 236u8, 215u8, 83u8, 28u8, 70u8, 45u8, 128u8, 184u8, - 57u8, 101u8, 83u8, 42u8, 165u8, 34u8, 155u8, 64u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Council", + "MaxProposalWeight", + [ + 222u8, 183u8, 203u8, 169u8, 31u8, 134u8, 28u8, 12u8, 47u8, 140u8, 71u8, + 74u8, 61u8, 55u8, 71u8, 236u8, 215u8, 83u8, 28u8, 70u8, 45u8, 128u8, + 184u8, 57u8, 101u8, 83u8, 42u8, 165u8, 34u8, 155u8, 64u8, 145u8, + ], + ) } } } @@ -12269,11 +12495,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "TechnicalCommittee", "set_members", - types::SetMembers { - new_members, - prime, - old_count, - }, + types::SetMembers { new_members, prime, old_count }, [ 141u8, 113u8, 137u8, 46u8, 75u8, 22u8, 143u8, 204u8, 50u8, 24u8, 137u8, 25u8, 226u8, 166u8, 121u8, 161u8, 54u8, 144u8, 12u8, 145u8, 157u8, @@ -12292,10 +12514,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "TechnicalCommittee", "execute", - types::Execute { - proposal: ::std::boxed::Box::new(proposal), - length_bound, - }, + types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ 1u8, 38u8, 214u8, 226u8, 97u8, 229u8, 11u8, 242u8, 214u8, 241u8, 236u8, 153u8, 130u8, 210u8, 175u8, 160u8, 127u8, 82u8, 98u8, 101u8, 63u8, @@ -12338,11 +12557,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "TechnicalCommittee", "vote", - types::Vote { - proposal, - index, - approve, - }, + types::Vote { proposal, index, approve }, [ 110u8, 141u8, 24u8, 33u8, 91u8, 7u8, 89u8, 198u8, 54u8, 10u8, 76u8, 129u8, 45u8, 20u8, 216u8, 104u8, 231u8, 246u8, 174u8, 205u8, 190u8, @@ -12380,12 +12595,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "TechnicalCommittee", "close", - types::Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }, + types::Close { proposal_hash, index, proposal_weight_bound, length_bound }, [ 189u8, 149u8, 125u8, 63u8, 39u8, 201u8, 247u8, 4u8, 220u8, 74u8, 78u8, 14u8, 113u8, 163u8, 1u8, 159u8, 81u8, 248u8, 141u8, 111u8, 34u8, 243u8, @@ -12602,9 +12812,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "TechnicalCommittee", "ProposalOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 211u8, 81u8, 191u8, 143u8, 109u8, 169u8, 12u8, 12u8, 190u8, 218u8, 108u8, 146u8, 228u8, 21u8, 63u8, 28u8, 185u8, 152u8, 226u8, 164u8, @@ -12654,9 +12862,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "TechnicalCommittee", "Voting", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 56u8, 192u8, 111u8, 180u8, 253u8, 5u8, 232u8, 126u8, 177u8, 48u8, 135u8, 39u8, 89u8, 71u8, 62u8, 239u8, 216u8, 17u8, 64u8, 82u8, 130u8, @@ -13001,11 +13207,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Elections", "remove_member", - types::RemoveMember { - who, - slash_bond, - rerun_election, - }, + types::RemoveMember { who, slash_bond, rerun_election }, [ 121u8, 189u8, 213u8, 154u8, 126u8, 196u8, 140u8, 208u8, 152u8, 191u8, 224u8, 160u8, 42u8, 2u8, 243u8, 37u8, 120u8, 73u8, 160u8, 5u8, 243u8, @@ -13024,10 +13226,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Elections", "clean_defunct_voters", - types::CleanDefunctVoters { - num_voters, - num_defunct, - }, + types::CleanDefunctVoters { num_voters, num_defunct }, [ 103u8, 241u8, 66u8, 156u8, 118u8, 36u8, 101u8, 148u8, 76u8, 162u8, 240u8, 31u8, 114u8, 10u8, 247u8, 68u8, 163u8, 187u8, 117u8, 47u8, 14u8, @@ -13331,9 +13530,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Elections", "Voting", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 18u8, 65u8, 68u8, 10u8, 123u8, 174u8, 185u8, 95u8, 75u8, 37u8, 201u8, 31u8, 93u8, 189u8, 184u8, 76u8, 199u8, 168u8, 74u8, 199u8, 75u8, 78u8, @@ -13378,22 +13575,30 @@ pub mod api { pub fn pallet_id( &self, ) -> ::subxt::constants::Address<[::core::primitive::u8; 8usize]> { - ::subxt::constants::Address::new_static("Elections", "PalletId", [ - 157u8, 118u8, 79u8, 88u8, 241u8, 22u8, 185u8, 37u8, 42u8, 20u8, 133u8, - 240u8, 11u8, 25u8, 66u8, 154u8, 84u8, 163u8, 78u8, 92u8, 171u8, 82u8, - 248u8, 76u8, 189u8, 70u8, 142u8, 249u8, 153u8, 84u8, 180u8, 60u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "PalletId", + [ + 157u8, 118u8, 79u8, 88u8, 241u8, 22u8, 185u8, 37u8, 42u8, 20u8, 133u8, + 240u8, 11u8, 25u8, 66u8, 154u8, 84u8, 163u8, 78u8, 92u8, 171u8, 82u8, + 248u8, 76u8, 189u8, 70u8, 142u8, 249u8, 153u8, 84u8, 180u8, 60u8, + ], + ) } #[doc = " How much should be locked up in order to submit one's candidacy."] pub fn candidacy_bond( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Elections", "CandidacyBond", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "CandidacyBond", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Base deposit associated with voting."] @@ -13403,55 +13608,78 @@ pub mod api { pub fn voting_bond_base( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Elections", "VotingBondBase", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "VotingBondBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of bond that need to be locked for each vote (32 bytes)."] pub fn voting_bond_factor( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Elections", "VotingBondFactor", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "VotingBondFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Number of members to elect."] pub fn desired_members( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "DesiredMembers", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "DesiredMembers", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Number of runners_up to keep."] pub fn desired_runners_up( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "DesiredRunnersUp", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "DesiredRunnersUp", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " How long each seat is kept. This defines the next block number at which an election"] #[doc = " round will happen. If set to zero, no elections are ever triggered and the module will"] #[doc = " be in passive mode."] pub fn term_duration(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "TermDuration", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "TermDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of candidates in a phragmen election."] @@ -13463,11 +13691,16 @@ pub mod api { pub fn max_candidates( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "MaxCandidates", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "MaxCandidates", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of voters to allow in a phragmen election."] @@ -13477,11 +13710,16 @@ pub mod api { #[doc = ""] #[doc = " When the limit is reached the new voters are ignored."] pub fn max_voters(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "MaxVoters", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "MaxVoters", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Maximum numbers of votes per voter."] @@ -13491,11 +13729,16 @@ pub mod api { pub fn max_votes_per_voter( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Elections", "MaxVotesPerVoter", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Elections", + "MaxVotesPerVoter", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -14128,10 +14371,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Grandpa", "note_stalled", - types::NoteStalled { - delay, - best_finalized_block_number, - }, + types::NoteStalled { delay, best_finalized_block_number }, [ 232u8, 162u8, 42u8, 199u8, 101u8, 116u8, 38u8, 27u8, 147u8, 15u8, 224u8, 76u8, 229u8, 244u8, 13u8, 49u8, 218u8, 232u8, 253u8, 37u8, 7u8, @@ -14223,11 +14463,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Grandpa", "State", vec![], [ - 254u8, 81u8, 54u8, 203u8, 26u8, 74u8, 162u8, 215u8, 165u8, 247u8, 143u8, - 139u8, 242u8, 164u8, 67u8, 27u8, 97u8, 172u8, 66u8, 98u8, 28u8, 151u8, - 32u8, 38u8, 209u8, 82u8, 41u8, 209u8, 72u8, 3u8, 167u8, 42u8, - ]) + ::subxt::storage::address::Address::new_static( + "Grandpa", + "State", + vec![], + [ + 254u8, 81u8, 54u8, 203u8, 26u8, 74u8, 162u8, 215u8, 165u8, 247u8, + 143u8, 139u8, 242u8, 164u8, 67u8, 27u8, 97u8, 172u8, 66u8, 98u8, 28u8, + 151u8, 32u8, 38u8, 209u8, 82u8, 41u8, 209u8, 72u8, 3u8, 167u8, 42u8, + ], + ) } #[doc = " Pending change: (signaled at, scheduled change)."] @@ -14284,11 +14529,16 @@ pub mod api { (), (), > { - ::subxt::storage::address::Address::new_static("Grandpa", "Stalled", vec![], [ - 146u8, 18u8, 59u8, 59u8, 21u8, 246u8, 5u8, 167u8, 221u8, 8u8, 230u8, 74u8, - 81u8, 217u8, 67u8, 158u8, 136u8, 36u8, 23u8, 106u8, 136u8, 89u8, 110u8, - 217u8, 31u8, 138u8, 107u8, 251u8, 164u8, 10u8, 119u8, 18u8, - ]) + ::subxt::storage::address::Address::new_static( + "Grandpa", + "Stalled", + vec![], + [ + 146u8, 18u8, 59u8, 59u8, 21u8, 246u8, 5u8, 167u8, 221u8, 8u8, 230u8, + 74u8, 81u8, 217u8, 67u8, 158u8, 136u8, 36u8, 23u8, 106u8, 136u8, 89u8, + 110u8, 217u8, 31u8, 138u8, 107u8, 251u8, 164u8, 10u8, 119u8, 18u8, + ], + ) } #[doc = " The number of changes (both in terms of keys and underlying economic responsibilities)"] @@ -14338,9 +14588,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Grandpa", "SetIdSession", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 47u8, 0u8, 239u8, 121u8, 187u8, 213u8, 254u8, 50u8, 238u8, 10u8, 162u8, 65u8, 189u8, 166u8, 37u8, 74u8, 82u8, 81u8, 160u8, 20u8, 180u8, 253u8, @@ -14389,11 +14637,16 @@ pub mod api { pub fn max_authorities( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Grandpa", "MaxAuthorities", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Grandpa", + "MaxAuthorities", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The maximum number of entries to keep in the set id to session index mapping."] @@ -14405,11 +14658,16 @@ pub mod api { pub fn max_set_id_session_entries( &self, ) -> ::subxt::constants::Address<::core::primitive::u64> { - ::subxt::constants::Address::new_static("Grandpa", "MaxSetIdSessionEntries", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, 59u8, - 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, 103u8, 119u8, - 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ]) + ::subxt::constants::Address::new_static( + "Grandpa", + "MaxSetIdSessionEntries", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } } } @@ -14609,10 +14867,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Treasury", "spend", - types::Spend { - amount, - beneficiary, - }, + types::Spend { amount, beneficiary }, [ 84u8, 118u8, 232u8, 82u8, 17u8, 184u8, 100u8, 78u8, 38u8, 158u8, 78u8, 200u8, 60u8, 9u8, 47u8, 72u8, 52u8, 70u8, 208u8, 208u8, 169u8, 217u8, @@ -14888,9 +15143,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Treasury", "Proposals", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 182u8, 12u8, 98u8, 64u8, 117u8, 17u8, 90u8, 245u8, 80u8, 99u8, 161u8, 17u8, 59u8, 80u8, 64u8, 139u8, 89u8, 179u8, 254u8, 239u8, 143u8, 114u8, @@ -14982,42 +15235,60 @@ pub mod api { &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Treasury", "ProposalBond", [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, 114u8, - 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, 200u8, - 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "ProposalBond", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + ], + ) } #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] pub fn proposal_bond_minimum( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Treasury", "ProposalBondMinimum", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "ProposalBondMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] pub fn proposal_bond_maximum( &self, ) -> ::subxt::constants::Address<::core::option::Option<::core::primitive::u128>> { - ::subxt::constants::Address::new_static("Treasury", "ProposalBondMaximum", [ - 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, - 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, 215u8, - 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, 147u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "ProposalBondMaximum", + [ + 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, + 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, + 215u8, 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, + 147u8, + ], + ) } #[doc = " Period between successive spends."] pub fn spend_period(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Treasury", "SpendPeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "SpendPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] @@ -15025,33 +15296,46 @@ pub mod api { &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Treasury", "Burn", [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, 114u8, - 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, 200u8, - 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "Burn", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + ], + ) } #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] pub fn pallet_id( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Treasury", "PalletId", [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "PalletId", + [ + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, + ], + ) } #[doc = " The maximum number of approvals that can wait in the spending queue."] #[doc = ""] #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] pub fn max_approvals(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Treasury", "MaxApprovals", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Treasury", + "MaxApprovals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -15166,9 +15450,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Sudo", "sudo", - types::Sudo { - call: ::std::boxed::Box::new(call), - }, + types::Sudo { call: ::std::boxed::Box::new(call) }, [ 115u8, 211u8, 9u8, 14u8, 126u8, 94u8, 205u8, 184u8, 36u8, 23u8, 96u8, 244u8, 87u8, 102u8, 70u8, 124u8, 96u8, 70u8, 60u8, 202u8, 38u8, 47u8, @@ -15186,10 +15468,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Sudo", "sudo_unchecked_weight", - types::SudoUncheckedWeight { - call: ::std::boxed::Box::new(call), - weight, - }, + types::SudoUncheckedWeight { call: ::std::boxed::Box::new(call), weight }, [ 49u8, 133u8, 238u8, 204u8, 210u8, 155u8, 88u8, 95u8, 201u8, 135u8, 189u8, 255u8, 81u8, 67u8, 155u8, 238u8, 79u8, 240u8, 148u8, 174u8, @@ -15207,11 +15486,17 @@ pub mod api { ::core::primitive::u32, >, ) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Sudo", "set_key", types::SetKey { new }, [ - 46u8, 208u8, 84u8, 223u8, 141u8, 188u8, 184u8, 156u8, 101u8, 97u8, 255u8, - 166u8, 168u8, 102u8, 75u8, 3u8, 149u8, 105u8, 202u8, 220u8, 187u8, 117u8, - 156u8, 83u8, 159u8, 115u8, 231u8, 201u8, 171u8, 47u8, 170u8, 36u8, - ]) + ::subxt::tx::Payload::new_static( + "Sudo", + "set_key", + types::SetKey { new }, + [ + 46u8, 208u8, 84u8, 223u8, 141u8, 188u8, 184u8, 156u8, 101u8, 97u8, + 255u8, 166u8, 168u8, 102u8, 75u8, 3u8, 149u8, 105u8, 202u8, 220u8, + 187u8, 117u8, 156u8, 83u8, 159u8, 115u8, 231u8, 201u8, 171u8, 47u8, + 170u8, 36u8, + ], + ) } #[doc = "See [`Pallet::sudo_as`]."] @@ -15226,10 +15511,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Sudo", "sudo_as", - types::SudoAs { - who, - call: ::std::boxed::Box::new(call), - }, + types::SudoAs { who, call: ::std::boxed::Box::new(call) }, [ 171u8, 1u8, 142u8, 53u8, 76u8, 179u8, 179u8, 181u8, 77u8, 118u8, 240u8, 228u8, 12u8, 121u8, 254u8, 104u8, 40u8, 217u8, 143u8, 138u8, 147u8, @@ -15324,11 +15606,16 @@ pub mod api { (), (), > { - ::subxt::storage::address::Address::new_static("Sudo", "Key", vec![], [ - 72u8, 14u8, 225u8, 162u8, 205u8, 247u8, 227u8, 105u8, 116u8, 57u8, 4u8, - 31u8, 84u8, 137u8, 227u8, 228u8, 133u8, 245u8, 206u8, 227u8, 117u8, 36u8, - 252u8, 151u8, 107u8, 15u8, 180u8, 4u8, 4u8, 152u8, 195u8, 144u8, - ]) + ::subxt::storage::address::Address::new_static( + "Sudo", + "Key", + vec![], + [ + 72u8, 14u8, 225u8, 162u8, 205u8, 247u8, 227u8, 105u8, 116u8, 57u8, 4u8, + 31u8, 84u8, 137u8, 227u8, 228u8, 133u8, 245u8, 206u8, 227u8, 117u8, + 36u8, 252u8, 151u8, 107u8, 15u8, 180u8, 4u8, 4u8, 152u8, 195u8, 144u8, + ], + ) } } } @@ -15378,10 +15665,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "ImOnline", "heartbeat", - types::Heartbeat { - heartbeat, - signature, - }, + types::Heartbeat { heartbeat, signature }, [ 145u8, 227u8, 53u8, 178u8, 195u8, 173u8, 7u8, 209u8, 148u8, 82u8, 125u8, 236u8, 128u8, 10u8, 134u8, 114u8, 95u8, 104u8, 111u8, 202u8, @@ -15512,11 +15796,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("ImOnline", "Keys", vec![], [ - 111u8, 104u8, 188u8, 46u8, 152u8, 140u8, 137u8, 244u8, 52u8, 214u8, 115u8, - 156u8, 39u8, 239u8, 15u8, 168u8, 193u8, 125u8, 57u8, 195u8, 250u8, 156u8, - 234u8, 222u8, 222u8, 253u8, 135u8, 232u8, 196u8, 163u8, 29u8, 218u8, - ]) + ::subxt::storage::address::Address::new_static( + "ImOnline", + "Keys", + vec![], + [ + 111u8, 104u8, 188u8, 46u8, 152u8, 140u8, 137u8, 244u8, 52u8, 214u8, + 115u8, 156u8, 39u8, 239u8, 15u8, 168u8, 193u8, 125u8, 57u8, 195u8, + 250u8, 156u8, 234u8, 222u8, 222u8, 253u8, 135u8, 232u8, 196u8, 163u8, + 29u8, 218u8, + ], + ) } #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex`."] @@ -15633,11 +15923,16 @@ pub mod api { pub fn unsigned_priority( &self, ) -> ::subxt::constants::Address<::core::primitive::u64> { - ::subxt::constants::Address::new_static("ImOnline", "UnsignedPriority", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, 59u8, - 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, 103u8, 119u8, - 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, 246u8, - ]) + ::subxt::constants::Address::new_static( + "ImOnline", + "UnsignedPriority", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } } } @@ -15757,9 +16052,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Offences", "Reports", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 242u8, 69u8, 20u8, 130u8, 250u8, 223u8, 68u8, 121u8, 187u8, 215u8, 62u8, 204u8, 100u8, 51u8, 76u8, 164u8, 188u8, 182u8, 215u8, 93u8, @@ -15874,9 +16167,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Historical", "HistoricalSessions", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 219u8, 105u8, 245u8, 54u8, 143u8, 81u8, 56u8, 104u8, 60u8, 207u8, 165u8, 92u8, 123u8, 2u8, 64u8, 117u8, 154u8, 135u8, 252u8, 234u8, @@ -16431,9 +16722,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Scheduler", "Agenda", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 197u8, 7u8, 91u8, 13u8, 123u8, 168u8, 206u8, 127u8, 112u8, 147u8, 206u8, 4u8, 237u8, 18u8, 133u8, 209u8, 100u8, 73u8, 1u8, 11u8, 57u8, @@ -16495,9 +16784,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Scheduler", "Lookup", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 157u8, 102u8, 210u8, 65u8, 190u8, 48u8, 168u8, 20u8, 197u8, 184u8, 74u8, 119u8, 176u8, 22u8, 244u8, 186u8, 231u8, 239u8, 97u8, 175u8, @@ -16542,11 +16829,15 @@ pub mod api { pub fn maximum_weight( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Scheduler", "MaximumWeight", [ - 222u8, 183u8, 203u8, 169u8, 31u8, 134u8, 28u8, 12u8, 47u8, 140u8, 71u8, - 74u8, 61u8, 55u8, 71u8, 236u8, 215u8, 83u8, 28u8, 70u8, 45u8, 128u8, 184u8, - 57u8, 101u8, 83u8, 42u8, 165u8, 34u8, 155u8, 64u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Scheduler", + "MaximumWeight", + [ + 222u8, 183u8, 203u8, 169u8, 31u8, 134u8, 28u8, 12u8, 47u8, 140u8, 71u8, + 74u8, 61u8, 55u8, 71u8, 236u8, 215u8, 83u8, 28u8, 70u8, 45u8, 128u8, + 184u8, 57u8, 101u8, 83u8, 42u8, 165u8, 34u8, 155u8, 64u8, 145u8, + ], + ) } #[doc = " The maximum number of scheduled calls in the queue for a single block."] @@ -16557,11 +16848,16 @@ pub mod api { pub fn max_scheduled_per_block( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Scheduler", "MaxScheduledPerBlock", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Scheduler", + "MaxScheduledPerBlock", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -16830,11 +17126,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Bounties", "propose_curator", - types::ProposeCurator { - bounty_id, - curator, - fee, - }, + types::ProposeCurator { bounty_id, curator, fee }, [ 71u8, 194u8, 107u8, 158u8, 153u8, 106u8, 130u8, 173u8, 57u8, 240u8, 43u8, 213u8, 143u8, 48u8, 179u8, 254u8, 63u8, 190u8, 105u8, 52u8, @@ -16891,10 +17183,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Bounties", "award_bounty", - types::AwardBounty { - bounty_id, - beneficiary, - }, + types::AwardBounty { bounty_id, beneficiary }, [ 69u8, 87u8, 233u8, 113u8, 45u8, 84u8, 104u8, 158u8, 128u8, 111u8, 231u8, 80u8, 175u8, 226u8, 231u8, 61u8, 106u8, 6u8, 192u8, 208u8, @@ -17165,9 +17454,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Bounties", "Bounties", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 197u8, 26u8, 141u8, 98u8, 53u8, 123u8, 87u8, 219u8, 248u8, 200u8, 207u8, 196u8, 211u8, 159u8, 124u8, 173u8, 143u8, 144u8, 85u8, 180u8, @@ -17220,9 +17507,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Bounties", "BountyDescriptions", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 71u8, 40u8, 133u8, 84u8, 55u8, 207u8, 169u8, 189u8, 160u8, 51u8, 202u8, 144u8, 15u8, 226u8, 97u8, 114u8, 54u8, 247u8, 53u8, 26u8, 36u8, 54u8, @@ -17288,11 +17573,15 @@ pub mod api { pub fn bounty_deposit_base( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Bounties", "BountyDepositBase", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "BountyDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The delay period for which a bounty beneficiary need to wait before claim the payout."] @@ -17315,11 +17604,16 @@ pub mod api { pub fn bounty_update_period( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Bounties", "BountyUpdatePeriod", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "BountyUpdatePeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The curator deposit is calculated as a percentage of the curator fee."] @@ -17345,44 +17639,62 @@ pub mod api { pub fn curator_deposit_max( &self, ) -> ::subxt::constants::Address<::core::option::Option<::core::primitive::u128>> { - ::subxt::constants::Address::new_static("Bounties", "CuratorDepositMax", [ - 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, - 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, 215u8, - 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, 147u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "CuratorDepositMax", + [ + 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, + 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, + 215u8, 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, + 147u8, + ], + ) } #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] pub fn curator_deposit_min( &self, ) -> ::subxt::constants::Address<::core::option::Option<::core::primitive::u128>> { - ::subxt::constants::Address::new_static("Bounties", "CuratorDepositMin", [ - 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, - 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, 215u8, - 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, 147u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "CuratorDepositMin", + [ + 198u8, 51u8, 89u8, 159u8, 124u8, 251u8, 51u8, 80u8, 167u8, 193u8, 44u8, + 199u8, 80u8, 36u8, 41u8, 130u8, 137u8, 229u8, 178u8, 208u8, 37u8, + 215u8, 169u8, 183u8, 180u8, 191u8, 140u8, 240u8, 250u8, 61u8, 42u8, + 147u8, + ], + ) } #[doc = " Minimum value for a bounty."] pub fn bounty_value_minimum( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Bounties", "BountyValueMinimum", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "BountyValueMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] pub fn data_deposit_per_byte( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Bounties", "DataDepositPerByte", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "DataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " Maximum acceptable reason length."] @@ -17391,11 +17703,16 @@ pub mod api { pub fn maximum_reason_length( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Bounties", "MaximumReasonLength", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Bounties", + "MaximumReasonLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -17599,11 +17916,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Tips", "tip_new", - types::TipNew { - reason, - who, - tip_value, - }, + types::TipNew { reason, who, tip_value }, [ 236u8, 82u8, 15u8, 103u8, 143u8, 84u8, 161u8, 90u8, 120u8, 185u8, 251u8, 212u8, 168u8, 2u8, 227u8, 63u8, 222u8, 171u8, 187u8, 137u8, @@ -17808,9 +18121,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Tips", "Tips", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 173u8, 172u8, 116u8, 247u8, 202u8, 228u8, 47u8, 222u8, 67u8, 146u8, 225u8, 0u8, 74u8, 189u8, 226u8, 206u8, 245u8, 209u8, 26u8, 49u8, 189u8, @@ -17836,11 +18147,16 @@ pub mod api { (), ::subxt::storage::address::Yes, > { - ::subxt::storage::address::Address::new_static("Tips", "Tips", Vec::new(), [ - 173u8, 172u8, 116u8, 247u8, 202u8, 228u8, 47u8, 222u8, 67u8, 146u8, 225u8, - 0u8, 74u8, 189u8, 226u8, 206u8, 245u8, 209u8, 26u8, 49u8, 189u8, 73u8, - 20u8, 117u8, 30u8, 41u8, 129u8, 170u8, 5u8, 226u8, 92u8, 140u8, - ]) + ::subxt::storage::address::Address::new_static( + "Tips", + "Tips", + Vec::new(), + [ + 173u8, 172u8, 116u8, 247u8, 202u8, 228u8, 47u8, 222u8, 67u8, 146u8, + 225u8, 0u8, 74u8, 189u8, 226u8, 206u8, 245u8, 209u8, 26u8, 49u8, 189u8, + 73u8, 20u8, 117u8, 30u8, 41u8, 129u8, 170u8, 5u8, 226u8, 92u8, 140u8, + ], + ) } #[doc = " Simple preimage lookup from the reason's hash to the original data. Again, has an"] @@ -17858,9 +18174,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Tips", "Reasons", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 212u8, 224u8, 153u8, 133u8, 234u8, 213u8, 134u8, 255u8, 59u8, 61u8, 200u8, 47u8, 186u8, 177u8, 35u8, 108u8, 85u8, 144u8, 185u8, 69u8, @@ -17881,11 +18195,17 @@ pub mod api { (), ::subxt::storage::address::Yes, > { - ::subxt::storage::address::Address::new_static("Tips", "Reasons", Vec::new(), [ - 212u8, 224u8, 153u8, 133u8, 234u8, 213u8, 134u8, 255u8, 59u8, 61u8, 200u8, - 47u8, 186u8, 177u8, 35u8, 108u8, 85u8, 144u8, 185u8, 69u8, 159u8, 38u8, - 83u8, 166u8, 200u8, 20u8, 220u8, 234u8, 59u8, 61u8, 223u8, 167u8, - ]) + ::subxt::storage::address::Address::new_static( + "Tips", + "Reasons", + Vec::new(), + [ + 212u8, 224u8, 153u8, 133u8, 234u8, 213u8, 134u8, 255u8, 59u8, 61u8, + 200u8, 47u8, 186u8, 177u8, 35u8, 108u8, 85u8, 144u8, 185u8, 69u8, + 159u8, 38u8, 83u8, 166u8, 200u8, 20u8, 220u8, 234u8, 59u8, 61u8, 223u8, + 167u8, + ], + ) } } } @@ -17899,31 +18219,45 @@ pub mod api { pub fn maximum_reason_length( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Tips", "MaximumReasonLength", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Tips", + "MaximumReasonLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The amount held on deposit per byte within the tip report reason or bounty description."] pub fn data_deposit_per_byte( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Tips", "DataDepositPerByte", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Tips", + "DataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The period for which a tip remains open after is has achieved threshold tippers."] pub fn tip_countdown(&self) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Tips", "TipCountdown", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Tips", + "TipCountdown", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " The percent of the final tip which goes to the original reporter of the tip."] @@ -17931,22 +18265,31 @@ pub mod api { &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("Tips", "TipFindersFee", [ - 40u8, 171u8, 69u8, 196u8, 34u8, 184u8, 50u8, 128u8, 139u8, 192u8, 63u8, - 231u8, 249u8, 200u8, 252u8, 73u8, 244u8, 170u8, 51u8, 177u8, 106u8, 47u8, - 114u8, 234u8, 84u8, 104u8, 62u8, 118u8, 227u8, 50u8, 225u8, 122u8, - ]) + ::subxt::constants::Address::new_static( + "Tips", + "TipFindersFee", + [ + 40u8, 171u8, 69u8, 196u8, 34u8, 184u8, 50u8, 128u8, 139u8, 192u8, 63u8, + 231u8, 249u8, 200u8, 252u8, 73u8, 244u8, 170u8, 51u8, 177u8, 106u8, + 47u8, 114u8, 234u8, 84u8, 104u8, 62u8, 118u8, 227u8, 50u8, 225u8, + 122u8, + ], + ) } #[doc = " The amount held on deposit for placing a tip report."] pub fn tip_report_deposit_base( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Tips", "TipReportDepositBase", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Tips", + "TipReportDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } } } @@ -17967,11 +18310,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("Mmr", "RootHash", vec![], [ - 111u8, 206u8, 173u8, 92u8, 67u8, 49u8, 150u8, 113u8, 90u8, 245u8, 38u8, - 254u8, 76u8, 250u8, 167u8, 66u8, 130u8, 129u8, 251u8, 220u8, 172u8, 229u8, - 162u8, 251u8, 36u8, 227u8, 43u8, 189u8, 7u8, 106u8, 23u8, 13u8, - ]) + ::subxt::storage::address::Address::new_static( + "Mmr", + "RootHash", + vec![], + [ + 111u8, 206u8, 173u8, 92u8, 67u8, 49u8, 150u8, 113u8, 90u8, 245u8, 38u8, + 254u8, 76u8, 250u8, 167u8, 66u8, 130u8, 129u8, 251u8, 220u8, 172u8, + 229u8, 162u8, 251u8, 36u8, 227u8, 43u8, 189u8, 7u8, 106u8, 23u8, 13u8, + ], + ) } #[doc = " Current size of the MMR (number of leaves)."] @@ -18013,9 +18361,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Mmr", "Nodes", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 27u8, 84u8, 41u8, 195u8, 146u8, 81u8, 211u8, 189u8, 63u8, 125u8, 173u8, 206u8, 69u8, 198u8, 202u8, 213u8, 89u8, 31u8, 89u8, 177u8, 76u8, 154u8, @@ -18037,11 +18383,16 @@ pub mod api { (), ::subxt::storage::address::Yes, > { - ::subxt::storage::address::Address::new_static("Mmr", "Nodes", Vec::new(), [ - 27u8, 84u8, 41u8, 195u8, 146u8, 81u8, 211u8, 189u8, 63u8, 125u8, 173u8, - 206u8, 69u8, 198u8, 202u8, 213u8, 89u8, 31u8, 89u8, 177u8, 76u8, 154u8, - 249u8, 197u8, 133u8, 78u8, 142u8, 71u8, 183u8, 3u8, 132u8, 25u8, - ]) + ::subxt::storage::address::Address::new_static( + "Mmr", + "Nodes", + Vec::new(), + [ + 27u8, 84u8, 41u8, 195u8, 146u8, 81u8, 211u8, 189u8, 63u8, 125u8, 173u8, + 206u8, 69u8, 198u8, 202u8, 213u8, 89u8, 31u8, 89u8, 177u8, 76u8, 154u8, + 249u8, 197u8, 133u8, 78u8, 142u8, 71u8, 183u8, 3u8, 132u8, 25u8, + ], + ) } } } @@ -18302,9 +18653,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "DataAvailability", "AppKeys", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 225u8, 43u8, 37u8, 100u8, 192u8, 189u8, 228u8, 197u8, 252u8, 31u8, 67u8, 94u8, 250u8, 213u8, 122u8, 209u8, 171u8, 193u8, 66u8, 243u8, @@ -18378,44 +18727,60 @@ pub mod api { pub fn min_block_rows( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("DataAvailability", "MinBlockRows", [ - 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, - 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, - 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, - ]) + ::subxt::constants::Address::new_static( + "DataAvailability", + "MinBlockRows", + [ + 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, + 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, + 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, + ], + ) } #[doc = " Maximum number of rows in a block."] pub fn max_block_rows( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("DataAvailability", "MaxBlockRows", [ - 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, - 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, - 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, - ]) + ::subxt::constants::Address::new_static( + "DataAvailability", + "MaxBlockRows", + [ + 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, + 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, + 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, + ], + ) } #[doc = " Minimum number of cols in a block."] pub fn min_block_cols( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("DataAvailability", "MinBlockCols", [ - 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, - 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, - 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, - ]) + ::subxt::constants::Address::new_static( + "DataAvailability", + "MinBlockCols", + [ + 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, + 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, + 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, + ], + ) } #[doc = " Maximum number of cols in a block."] pub fn max_block_cols( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("DataAvailability", "MaxBlockCols", [ - 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, - 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, - 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, - ]) + ::subxt::constants::Address::new_static( + "DataAvailability", + "MaxBlockCols", + [ + 65u8, 68u8, 180u8, 146u8, 16u8, 133u8, 230u8, 51u8, 17u8, 170u8, 88u8, + 49u8, 171u8, 96u8, 82u8, 152u8, 101u8, 63u8, 46u8, 141u8, 161u8, 104u8, + 204u8, 24u8, 1u8, 20u8, 116u8, 46u8, 232u8, 62u8, 223u8, 15u8, + ], + ) } } } @@ -18622,11 +18987,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NomadHome", "dispatch", - types::Dispatch { - destination_domain, - recipient_address, - message_body, - }, + types::Dispatch { destination_domain, recipient_address, message_body }, [ 7u8, 224u8, 49u8, 89u8, 228u8, 226u8, 26u8, 35u8, 45u8, 124u8, 124u8, 55u8, 26u8, 234u8, 151u8, 239u8, 140u8, 176u8, 228u8, 35u8, 207u8, @@ -18644,10 +19005,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NomadHome", "update", - types::Update { - signed_update, - max_index, - }, + types::Update { signed_update, max_index }, [ 41u8, 107u8, 21u8, 50u8, 78u8, 61u8, 173u8, 159u8, 208u8, 99u8, 27u8, 164u8, 166u8, 136u8, 83u8, 219u8, 146u8, 122u8, 148u8, 41u8, 45u8, @@ -18800,11 +19158,16 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("NomadHome", "Base", vec![], [ - 254u8, 56u8, 220u8, 109u8, 51u8, 237u8, 70u8, 31u8, 134u8, 49u8, 145u8, - 104u8, 204u8, 243u8, 216u8, 242u8, 57u8, 113u8, 132u8, 190u8, 170u8, 80u8, - 232u8, 190u8, 37u8, 91u8, 20u8, 188u8, 41u8, 41u8, 187u8, 107u8, - ]) + ::subxt::storage::address::Address::new_static( + "NomadHome", + "Base", + vec![], + [ + 254u8, 56u8, 220u8, 109u8, 51u8, 237u8, 70u8, 31u8, 134u8, 49u8, 145u8, + 104u8, 204u8, 243u8, 216u8, 242u8, 57u8, 113u8, 132u8, 190u8, 170u8, + 80u8, 232u8, 190u8, 37u8, 91u8, 20u8, 188u8, 41u8, 41u8, 187u8, 107u8, + ], + ) } pub fn tree( @@ -18816,11 +19179,17 @@ pub mod api { ::subxt::storage::address::Yes, (), > { - ::subxt::storage::address::Address::new_static("NomadHome", "Tree", vec![], [ - 22u8, 211u8, 114u8, 109u8, 20u8, 79u8, 40u8, 238u8, 244u8, 223u8, 95u8, - 97u8, 85u8, 113u8, 201u8, 242u8, 23u8, 140u8, 106u8, 222u8, 130u8, 29u8, - 218u8, 108u8, 210u8, 13u8, 115u8, 231u8, 22u8, 137u8, 227u8, 175u8, - ]) + ::subxt::storage::address::Address::new_static( + "NomadHome", + "Tree", + vec![], + [ + 22u8, 211u8, 114u8, 109u8, 20u8, 79u8, 40u8, 238u8, 244u8, 223u8, 95u8, + 97u8, 85u8, 113u8, 201u8, 242u8, 23u8, 140u8, 106u8, 222u8, 130u8, + 29u8, 218u8, 108u8, 210u8, 13u8, 115u8, 231u8, 22u8, 137u8, 227u8, + 175u8, + ], + ) } pub fn nonces( @@ -18836,9 +19205,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NomadHome", "Nonces", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 155u8, 100u8, 216u8, 144u8, 68u8, 188u8, 75u8, 83u8, 99u8, 245u8, 27u8, 196u8, 64u8, 193u8, 166u8, 33u8, 47u8, 87u8, 188u8, 46u8, 101u8, 144u8, @@ -18881,9 +19248,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NomadHome", "IndexToRoot", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 101u8, 71u8, 233u8, 178u8, 28u8, 89u8, 252u8, 186u8, 13u8, 210u8, 44u8, 76u8, 161u8, 238u8, 35u8, 40u8, 182u8, 168u8, 39u8, 114u8, 91u8, 125u8, @@ -18926,9 +19291,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NomadHome", "RootToIndex", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 82u8, 113u8, 217u8, 4u8, 206u8, 200u8, 21u8, 79u8, 246u8, 211u8, 8u8, 37u8, 160u8, 89u8, 10u8, 228u8, 211u8, 167u8, 119u8, 98u8, 50u8, 158u8, @@ -18967,11 +19330,16 @@ pub mod api { pub fn max_message_body_bytes( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("NomadHome", "MaxMessageBodyBytes", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "NomadHome", + "MaxMessageBodyBytes", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -19080,11 +19448,16 @@ pub mod api { pub fn da_bridge_pallet_id( &self, ) -> ::subxt::constants::Address<::subxt::utils::H256> { - ::subxt::constants::Address::new_static("NomadDABridge", "DABridgePalletId", [ - 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, 155u8, - 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, 204u8, - 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, 135u8, - ]) + ::subxt::constants::Address::new_static( + "NomadDABridge", + "DABridgePalletId", + [ + 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, + 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, + 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, + 135u8, + ], + ) } } } @@ -19343,9 +19716,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Preimage", "StatusFor", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 176u8, 174u8, 255u8, 131u8, 156u8, 64u8, 181u8, 119u8, 81u8, 243u8, 144u8, 55u8, 19u8, 140u8, 119u8, 30u8, 210u8, 112u8, 201u8, 247u8, @@ -19637,12 +20008,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Multisig", "cancel_as_multi", - types::CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }, + types::CancelAsMulti { threshold, other_signatories, timepoint, call_hash }, [ 14u8, 123u8, 126u8, 239u8, 174u8, 101u8, 28u8, 221u8, 117u8, 75u8, 82u8, 249u8, 151u8, 59u8, 224u8, 239u8, 54u8, 196u8, 244u8, 46u8, 31u8, @@ -19827,11 +20193,15 @@ pub mod api { #[doc = " `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is"] #[doc = " `32 + sizeof(AccountId)` bytes."] pub fn deposit_base(&self) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Multisig", "DepositBase", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Multisig", + "DepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] @@ -19840,22 +20210,31 @@ pub mod api { pub fn deposit_factor( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Multisig", "DepositFactor", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Multisig", + "DepositFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum amount of signatories allowed in the multisig."] pub fn max_signatories( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Multisig", "MaxSignatories", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Multisig", + "MaxSignatories", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -20032,9 +20411,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "VoterList", "ListNodes", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 252u8, 218u8, 186u8, 230u8, 86u8, 177u8, 112u8, 218u8, 9u8, 62u8, 217u8, 5u8, 39u8, 70u8, 15u8, 104u8, 157u8, 19u8, 175u8, 136u8, 71u8, @@ -20108,9 +20485,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "VoterList", "ListBags", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 157u8, 147u8, 94u8, 26u8, 37u8, 89u8, 114u8, 210u8, 158u8, 36u8, 155u8, 0u8, 137u8, 78u8, 65u8, 165u8, 226u8, 192u8, 65u8, 13u8, 244u8, 159u8, @@ -20194,11 +20569,15 @@ pub mod api { pub fn bag_thresholds( &self, ) -> ::subxt::constants::Address<::std::vec::Vec<::core::primitive::u64>> { - ::subxt::constants::Address::new_static("VoterList", "BagThresholds", [ - 215u8, 118u8, 183u8, 172u8, 4u8, 42u8, 248u8, 108u8, 4u8, 110u8, 43u8, - 165u8, 228u8, 7u8, 36u8, 30u8, 135u8, 184u8, 56u8, 201u8, 107u8, 68u8, - 25u8, 164u8, 134u8, 32u8, 82u8, 107u8, 200u8, 219u8, 212u8, 198u8, - ]) + ::subxt::constants::Address::new_static( + "VoterList", + "BagThresholds", + [ + 215u8, 118u8, 183u8, 172u8, 4u8, 42u8, 248u8, 108u8, 4u8, 110u8, 43u8, + 165u8, 228u8, 7u8, 36u8, 30u8, 135u8, 184u8, 56u8, 201u8, 107u8, 68u8, + 25u8, 164u8, 134u8, 32u8, 82u8, 107u8, 200u8, 219u8, 212u8, 198u8, + ], + ) } } } @@ -20778,10 +21157,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "unbond", - types::Unbond { - member_account, - unbonding_points, - }, + types::Unbond { member_account, unbonding_points }, [ 230u8, 112u8, 85u8, 216u8, 164u8, 250u8, 5u8, 18u8, 50u8, 206u8, 194u8, 0u8, 167u8, 149u8, 220u8, 212u8, 138u8, 33u8, 117u8, 130u8, 47u8, @@ -20799,10 +21175,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "pool_withdraw_unbonded", - types::PoolWithdrawUnbonded { - pool_id, - num_slashing_spans, - }, + types::PoolWithdrawUnbonded { pool_id, num_slashing_spans }, [ 234u8, 49u8, 43u8, 199u8, 55u8, 2u8, 252u8, 39u8, 147u8, 136u8, 34u8, 239u8, 116u8, 155u8, 129u8, 72u8, 83u8, 161u8, 90u8, 207u8, 1u8, 193u8, @@ -20823,10 +21196,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "withdraw_unbonded", - types::WithdrawUnbonded { - member_account, - num_slashing_spans, - }, + types::WithdrawUnbonded { member_account, num_slashing_spans }, [ 252u8, 38u8, 22u8, 98u8, 64u8, 133u8, 118u8, 62u8, 179u8, 226u8, 212u8, 186u8, 32u8, 227u8, 253u8, 119u8, 200u8, 53u8, 35u8, 193u8, 20u8, 64u8, @@ -20855,12 +21225,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "create", - types::Create { - amount, - root, - nominator, - bouncer, - }, + types::Create { amount, root, nominator, bouncer }, [ 4u8, 111u8, 53u8, 212u8, 226u8, 159u8, 144u8, 191u8, 152u8, 252u8, 30u8, 169u8, 185u8, 150u8, 229u8, 234u8, 140u8, 46u8, 237u8, 197u8, @@ -20891,13 +21256,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "create_with_pool_id", - types::CreateWithPoolId { - amount, - root, - nominator, - bouncer, - pool_id, - }, + types::CreateWithPoolId { amount, root, nominator, bouncer, pool_id }, [ 102u8, 254u8, 178u8, 47u8, 79u8, 12u8, 230u8, 142u8, 226u8, 205u8, 25u8, 166u8, 133u8, 0u8, 172u8, 58u8, 75u8, 96u8, 71u8, 187u8, 237u8, @@ -20915,10 +21274,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "nominate", - types::Nominate { - pool_id, - validators, - }, + types::Nominate { pool_id, validators }, [ 118u8, 80u8, 137u8, 47u8, 102u8, 9u8, 20u8, 136u8, 76u8, 164u8, 161u8, 114u8, 33u8, 159u8, 204u8, 49u8, 233u8, 199u8, 246u8, 67u8, 144u8, @@ -21021,12 +21377,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "update_roles", - types::UpdateRoles { - pool_id, - new_root, - new_nominator, - new_bouncer, - }, + types::UpdateRoles { pool_id, new_root, new_nominator, new_bouncer }, [ 58u8, 51u8, 136u8, 162u8, 218u8, 195u8, 121u8, 6u8, 243u8, 69u8, 19u8, 130u8, 152u8, 180u8, 226u8, 28u8, 0u8, 218u8, 237u8, 56u8, 52u8, 139u8, @@ -21123,10 +21474,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "set_commission", - types::SetCommission { - pool_id, - new_commission, - }, + types::SetCommission { pool_id, new_commission }, [ 144u8, 94u8, 73u8, 69u8, 224u8, 158u8, 244u8, 77u8, 169u8, 219u8, 101u8, 41u8, 37u8, 211u8, 198u8, 32u8, 92u8, 108u8, 7u8, 27u8, 153u8, @@ -21145,10 +21493,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "set_commission_max", - types::SetCommissionMax { - pool_id, - max_commission, - }, + types::SetCommissionMax { pool_id, max_commission }, [ 180u8, 80u8, 204u8, 129u8, 141u8, 86u8, 45u8, 76u8, 224u8, 123u8, 212u8, 38u8, 224u8, 79u8, 41u8, 143u8, 237u8, 174u8, 126u8, 1u8, 215u8, @@ -21168,10 +21513,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "NominationPools", "set_commission_change_rate", - types::SetCommissionChangeRate { - pool_id, - change_rate, - }, + types::SetCommissionChangeRate { pool_id, change_rate }, [ 138u8, 30u8, 155u8, 127u8, 181u8, 99u8, 89u8, 138u8, 130u8, 53u8, 224u8, 96u8, 190u8, 14u8, 76u8, 244u8, 142u8, 50u8, 39u8, 245u8, 144u8, @@ -21734,9 +22076,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "PoolMembers", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 116u8, 41u8, 89u8, 74u8, 35u8, 243u8, 213u8, 178u8, 41u8, 249u8, 62u8, 119u8, 72u8, 34u8, 197u8, 168u8, 147u8, 178u8, 159u8, 10u8, 181u8, @@ -21806,9 +22146,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "BondedPools", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 171u8, 143u8, 96u8, 95u8, 196u8, 228u8, 116u8, 22u8, 63u8, 105u8, 193u8, 77u8, 171u8, 99u8, 144u8, 70u8, 166u8, 55u8, 14u8, 191u8, 156u8, @@ -21878,9 +22216,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "RewardPools", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 150u8, 53u8, 204u8, 26u8, 187u8, 118u8, 80u8, 133u8, 94u8, 127u8, 155u8, 78u8, 71u8, 72u8, 0u8, 220u8, 174u8, 174u8, 109u8, 238u8, 13u8, @@ -21952,9 +22288,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "SubPoolsStorage", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 248u8, 37u8, 232u8, 231u8, 14u8, 140u8, 12u8, 27u8, 61u8, 222u8, 185u8, 128u8, 158u8, 30u8, 57u8, 121u8, 35u8, 11u8, 42u8, 242u8, 56u8, 1u8, @@ -22025,9 +22359,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "Metadata", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 10u8, 171u8, 251u8, 5u8, 72u8, 74u8, 86u8, 144u8, 59u8, 67u8, 92u8, 111u8, 217u8, 111u8, 175u8, 107u8, 119u8, 206u8, 199u8, 78u8, 182u8, @@ -22123,9 +22455,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "ReversePoolIdLookup", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 76u8, 76u8, 150u8, 33u8, 64u8, 81u8, 90u8, 75u8, 212u8, 221u8, 59u8, 83u8, 178u8, 45u8, 86u8, 206u8, 196u8, 221u8, 117u8, 94u8, 229u8, @@ -22196,9 +22526,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "NominationPools", "ClaimPermissions", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 98u8, 241u8, 185u8, 102u8, 61u8, 53u8, 215u8, 105u8, 2u8, 148u8, 197u8, 17u8, 107u8, 253u8, 74u8, 159u8, 14u8, 30u8, 213u8, 38u8, 35u8, 163u8, @@ -22238,11 +22566,15 @@ pub mod api { pub fn pallet_id( &self, ) -> ::subxt::constants::Address { - ::subxt::constants::Address::new_static("NominationPools", "PalletId", [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ]) + ::subxt::constants::Address::new_static( + "NominationPools", + "PalletId", + [ + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, + ], + ) } #[doc = " The maximum pool points-to-balance ratio that an `open` pool can have."] @@ -22657,9 +22989,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Identity", "set_identity", - types::SetIdentity { - info: ::std::boxed::Box::new(info), - }, + types::SetIdentity { info: ::std::boxed::Box::new(info) }, [ 205u8, 7u8, 54u8, 226u8, 123u8, 160u8, 173u8, 25u8, 179u8, 93u8, 172u8, 37u8, 222u8, 143u8, 209u8, 1u8, 230u8, 32u8, 84u8, 80u8, 110u8, 195u8, @@ -22816,12 +23146,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Identity", "provide_judgement", - types::ProvideJudgement { - reg_index, - target, - judgement, - identity, - }, + types::ProvideJudgement { reg_index, target, judgement, identity }, [ 51u8, 75u8, 24u8, 146u8, 141u8, 86u8, 141u8, 188u8, 77u8, 71u8, 5u8, 76u8, 44u8, 35u8, 208u8, 98u8, 217u8, 80u8, 248u8, 201u8, 225u8, 230u8, @@ -22916,11 +23241,17 @@ pub mod api { #[doc = "See [`Pallet::quit_sub`]."] pub fn quit_sub(&self) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static("Identity", "quit_sub", types::QuitSub {}, [ - 147u8, 131u8, 175u8, 171u8, 187u8, 201u8, 240u8, 26u8, 146u8, 224u8, 74u8, - 166u8, 242u8, 193u8, 204u8, 247u8, 168u8, 93u8, 18u8, 32u8, 27u8, 208u8, - 149u8, 146u8, 179u8, 172u8, 75u8, 112u8, 84u8, 141u8, 233u8, 223u8, - ]) + ::subxt::tx::Payload::new_static( + "Identity", + "quit_sub", + types::QuitSub {}, + [ + 147u8, 131u8, 175u8, 171u8, 187u8, 201u8, 240u8, 26u8, 146u8, 224u8, + 74u8, 166u8, 242u8, 193u8, 204u8, 247u8, 168u8, 93u8, 18u8, 32u8, 27u8, + 208u8, 149u8, 146u8, 179u8, 172u8, 75u8, 112u8, 84u8, 141u8, 233u8, + 223u8, + ], + ) } } } @@ -23172,9 +23503,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Identity", "IdentityOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 239u8, 55u8, 5u8, 97u8, 227u8, 243u8, 118u8, 13u8, 98u8, 30u8, 141u8, 84u8, 170u8, 90u8, 166u8, 116u8, 17u8, 122u8, 190u8, 76u8, 34u8, 51u8, @@ -23214,10 +23543,7 @@ pub mod api { _0: impl ::std::borrow::Borrow<::subxt::utils::AccountId32>, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - ::subxt::utils::AccountId32, - runtime_types::pallet_identity::types::Data, - ), + (::subxt::utils::AccountId32, runtime_types::pallet_identity::types::Data), ::subxt::storage::address::Yes, (), ::subxt::storage::address::Yes, @@ -23225,9 +23551,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Identity", "SuperOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 51u8, 225u8, 21u8, 92u8, 85u8, 14u8, 14u8, 211u8, 61u8, 99u8, 176u8, 236u8, 212u8, 156u8, 103u8, 175u8, 208u8, 105u8, 94u8, 226u8, 136u8, @@ -23242,10 +23566,7 @@ pub mod api { &self, ) -> ::subxt::storage::address::Address< ::subxt::storage::address::StaticStorageMapKey, - ( - ::subxt::utils::AccountId32, - runtime_types::pallet_identity::types::Data, - ), + (::subxt::utils::AccountId32, runtime_types::pallet_identity::types::Data), (), (), ::subxt::storage::address::Yes, @@ -23285,9 +23606,7 @@ pub mod api { ::subxt::storage::address::Address::new_static( "Identity", "SubsOf", - vec![::subxt::storage::address::make_static_storage_map_key( - _0.borrow(), - )], + vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ 93u8, 124u8, 154u8, 157u8, 159u8, 103u8, 233u8, 225u8, 59u8, 20u8, 201u8, 239u8, 128u8, 209u8, 207u8, 38u8, 123u8, 48u8, 119u8, 102u8, @@ -23371,22 +23690,30 @@ pub mod api { pub fn basic_deposit( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Identity", "BasicDeposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "BasicDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit per additional field for a registered identity."] pub fn field_deposit( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Identity", "FieldDeposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "FieldDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The amount held on deposit for a registered subaccount. This should account for the fact"] @@ -23395,22 +23722,31 @@ pub mod api { pub fn sub_account_deposit( &self, ) -> ::subxt::constants::Address<::core::primitive::u128> { - ::subxt::constants::Address::new_static("Identity", "SubAccountDeposit", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, 136u8, - 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "SubAccountDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) } #[doc = " The maximum number of sub-accounts allowed per identified account."] pub fn max_sub_accounts( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Identity", "MaxSubAccounts", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "MaxSubAccounts", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O"] @@ -23418,11 +23754,16 @@ pub mod api { pub fn max_additional_fields( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Identity", "MaxAdditionalFields", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "MaxAdditionalFields", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } #[doc = " Maxmimum number of registrars allowed in the system. Needed to bound the complexity"] @@ -23430,11 +23771,16 @@ pub mod api { pub fn max_registrars( &self, ) -> ::subxt::constants::Address<::core::primitive::u32> { - ::subxt::constants::Address::new_static("Identity", "MaxRegistrars", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, - 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, 178u8, 197u8, - 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, 145u8, - ]) + ::subxt::constants::Address::new_static( + "Identity", + "MaxRegistrars", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } } } @@ -23479,9 +23825,7 @@ pub mod api { ::subxt::tx::Payload::new_static( "Mandate", "mandate", - types::Mandate { - call: ::std::boxed::Box::new(call), - }, + types::Mandate { call: ::std::boxed::Box::new(call) }, [ 255u8, 84u8, 185u8, 34u8, 76u8, 12u8, 184u8, 13u8, 57u8, 225u8, 52u8, 20u8, 140u8, 32u8, 20u8, 134u8, 12u8, 84u8, 88u8, 239u8, 214u8, 203u8, @@ -24868,22 +25212,16 @@ pub mod api { pub enum Call { #[codec(index = 0)] #[doc = "See [`Pallet::remark`]."] - remark { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, + remark { remark: ::std::vec::Vec<::core::primitive::u8> }, #[codec(index = 1)] #[doc = "See [`Pallet::set_heap_pages`]."] set_heap_pages { pages: ::core::primitive::u64 }, #[codec(index = 2)] #[doc = "See [`Pallet::set_code`]."] - set_code { - code: ::std::vec::Vec<::core::primitive::u8>, - }, + set_code { code: ::std::vec::Vec<::core::primitive::u8> }, #[codec(index = 3)] #[doc = "See [`Pallet::set_code_without_checks`]."] - set_code_without_checks { - code: ::std::vec::Vec<::core::primitive::u8>, - }, + set_code_without_checks { code: ::std::vec::Vec<::core::primitive::u8> }, #[codec(index = 4)] #[doc = "See [`Pallet::set_storage`]."] set_storage { @@ -24894,9 +25232,7 @@ pub mod api { }, #[codec(index = 5)] #[doc = "See [`Pallet::kill_storage`]."] - kill_storage { - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - }, + kill_storage { keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>> }, #[codec(index = 6)] #[doc = "See [`Pallet::kill_prefix`]."] kill_prefix { @@ -24905,9 +25241,7 @@ pub mod api { }, #[codec(index = 7)] #[doc = "See [`Pallet::remark_with_event`]."] - remark_with_event { - remark: ::std::vec::Vec<::core::primitive::u8>, - }, + remark_with_event { remark: ::std::vec::Vec<::core::primitive::u8> }, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -24978,20 +25312,13 @@ pub mod api { CodeUpdated, #[codec(index = 3)] #[doc = "A new account was created."] - NewAccount { - account: ::subxt::utils::AccountId32, - }, + NewAccount { account: ::subxt::utils::AccountId32 }, #[codec(index = 4)] #[doc = "An account was reaped."] - KilledAccount { - account: ::subxt::utils::AccountId32, - }, + KilledAccount { account: ::subxt::utils::AccountId32 }, #[codec(index = 5)] #[doc = "On on-chain remark happened."] - Remarked { - sender: ::subxt::utils::AccountId32, - hash: ::subxt::utils::H256, - }, + Remarked { sender: ::subxt::utils::AccountId32, hash: ::subxt::utils::H256 }, #[codec(index = 6)] #[doc = "On on-chain remark happend called by Root."] RemarkedByRoot { hash: ::subxt::utils::H256 }, @@ -25487,9 +25814,7 @@ pub mod api { new_updater: ::subxt::utils::H160, }, #[codec(index = 1)] - FakeSlashed { - reporter: ::subxt::utils::AccountId32, - }, + FakeSlashed { reporter: ::subxt::utils::AccountId32 }, } } } @@ -25810,9 +26135,7 @@ pub mod api { }, #[codec(index = 6)] #[doc = "See [`Pallet::upgrade_accounts`]."] - upgrade_accounts { - who: ::std::vec::Vec<::subxt::utils::AccountId32>, - }, + upgrade_accounts { who: ::std::vec::Vec<::subxt::utils::AccountId32> }, #[codec(index = 7)] #[doc = "See [`Pallet::transfer`]."] transfer { @@ -25917,22 +26240,13 @@ pub mod api { }, #[codec(index = 3)] #[doc = "A balance was set by root."] - BalanceSet { - who: ::subxt::utils::AccountId32, - free: ::core::primitive::u128, - }, + BalanceSet { who: ::subxt::utils::AccountId32, free: ::core::primitive::u128 }, #[codec(index = 4)] #[doc = "Some balance was reserved (moved from free to reserved)."] - Reserved { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Reserved { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 5)] #[doc = "Some balance was unreserved (moved from reserved to free)."] - Unreserved { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Unreserved { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 6)] #[doc = "Some balance was moved from the reserve of the first account to the second account."] #[doc = "Final argument indicates the destination balance type."] @@ -25945,46 +26259,25 @@ pub mod api { }, #[codec(index = 7)] #[doc = "Some amount was deposited (e.g. for transaction fees)."] - Deposit { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Deposit { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 8)] #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - Withdraw { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Withdraw { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 9)] #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] - Slashed { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Slashed { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 10)] #[doc = "Some amount was minted into an account."] - Minted { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Minted { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 11)] #[doc = "Some amount was burned from an account."] - Burned { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Burned { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 12)] #[doc = "Some amount was suspended from an account (it can be restored later)."] - Suspended { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Suspended { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 13)] #[doc = "Some amount was restored into an account."] - Restored { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Restored { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 14)] #[doc = "An account was upgraded."] Upgraded { who: ::subxt::utils::AccountId32 }, @@ -25996,28 +26289,16 @@ pub mod api { Rescinded { amount: ::core::primitive::u128 }, #[codec(index = 17)] #[doc = "Some balance was locked."] - Locked { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Locked { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 18)] #[doc = "Some balance was unlocked."] - Unlocked { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Unlocked { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 19)] #[doc = "Some balance was frozen."] - Frozen { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Frozen { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, #[codec(index = 20)] #[doc = "Some balance was thawed."] - Thawed { - who: ::subxt::utils::AccountId32, - amount: ::core::primitive::u128, - }, + Thawed { who: ::subxt::utils::AccountId32, amount: ::core::primitive::u128 }, } } pub mod types { @@ -26287,10 +26568,7 @@ pub mod api { BountyProposed { index: ::core::primitive::u32 }, #[codec(index = 1)] #[doc = "A bounty proposal was rejected; funds were slashed."] - BountyRejected { - index: ::core::primitive::u32, - bond: ::core::primitive::u128, - }, + BountyRejected { index: ::core::primitive::u32, bond: ::core::primitive::u128 }, #[codec(index = 2)] #[doc = "A bounty proposal is funded and became active."] BountyBecameActive { index: ::core::primitive::u32 }, @@ -26361,11 +26639,7 @@ pub mod api { #[codec(index = 4)] Active { curator: _0, update_due: _1 }, #[codec(index = 5)] - PendingPayout { - curator: _0, - beneficiary: _0, - unlock_at: _1, - }, + PendingPayout { curator: _0, beneficiary: _0, unlock_at: _1 }, } } pub mod pallet_collective { @@ -27063,9 +27337,7 @@ pub mod api { }, #[codec(index = 8)] #[doc = "An account has cancelled a previous delegation operation."] - Undelegated { - account: ::subxt::utils::AccountId32, - }, + Undelegated { account: ::subxt::utils::AccountId32 }, #[codec(index = 9)] #[doc = "An external proposal has been vetoed."] Vetoed { @@ -27172,10 +27444,7 @@ pub mod api { #[codec(index = 0)] Ongoing(runtime_types::pallet_democracy::types::ReferendumStatus<_0, _1, _2>), #[codec(index = 1)] - Finished { - approved: ::core::primitive::bool, - end: _0, - }, + Finished { approved: ::core::primitive::bool, end: _0 }, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -27233,10 +27502,7 @@ pub mod api { #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum AccountVote<_0> { #[codec(index = 0)] - Standard { - vote: runtime_types::pallet_democracy::vote::Vote, - balance: _0, - }, + Standard { vote: runtime_types::pallet_democracy::vote::Vote, balance: _0 }, #[codec(index = 1)] Split { aye: _0, nay: _0 }, } @@ -27454,10 +27720,7 @@ pub mod api { }, #[codec(index = 4)] #[doc = "An account has been slashed for submitting an invalid signed submission."] - Slashed { - account: ::subxt::utils::AccountId32, - value: ::core::primitive::u128, - }, + Slashed { account: ::subxt::utils::AccountId32, value: ::core::primitive::u128 }, #[codec(index = 5)] #[doc = "There was a phase transition in a given round."] PhaseTransitioned { @@ -27780,9 +28043,7 @@ pub mod api { MemberKicked { member: ::subxt::utils::AccountId32 }, #[codec(index = 4)] #[doc = "Someone has renounced their candidacy."] - Renounced { - candidate: ::subxt::utils::AccountId32, - }, + Renounced { candidate: ::subxt::utils::AccountId32 }, #[codec(index = 5)] #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] #[doc = "runner-up."] @@ -28277,9 +28538,7 @@ pub mod api { }, #[codec(index = 6)] #[doc = "A registrar was added."] - RegistrarAdded { - registrar_index: ::core::primitive::u32, - }, + RegistrarAdded { registrar_index: ::core::primitive::u32 }, #[codec(index = 7)] #[doc = "A sub-identity was added to an identity and the deposit paid."] SubIdentityAdded { @@ -28789,10 +29048,7 @@ pub mod api { IndexFreed { index: ::core::primitive::u32 }, #[codec(index = 2)] #[doc = "A account index has been frozen to its current account ID."] - IndexFrozen { - index: ::core::primitive::u32, - who: ::subxt::utils::AccountId32, - }, + IndexFrozen { index: ::core::primitive::u32, who: ::subxt::utils::AccountId32 }, } } } @@ -28817,9 +29073,7 @@ pub mod api { pub enum Call { #[codec(index = 0)] #[doc = "See [`Pallet::mandate`]."] - mandate { - call: ::std::boxed::Box, - }, + mandate { call: ::std::boxed::Box }, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -28894,9 +29148,7 @@ pub mod api { }, #[codec(index = 3)] #[doc = "See [`Pallet::reset_members`]."] - reset_members { - members: ::std::vec::Vec<::subxt::utils::AccountId32>, - }, + reset_members { members: ::std::vec::Vec<::subxt::utils::AccountId32> }, #[codec(index = 4)] #[doc = "See [`Pallet::change_key`]."] change_key { @@ -29965,9 +30217,7 @@ pub mod api { pub enum Call { #[codec(index = 0)] #[doc = "See [`Pallet::note_preimage`]."] - note_preimage { - bytes: ::std::vec::Vec<::core::primitive::u8>, - }, + note_preimage { bytes: ::std::vec::Vec<::core::primitive::u8> }, #[codec(index = 1)] #[doc = "See [`Pallet::unnote_preimage`]."] unnote_preimage { hash: ::subxt::utils::H256 }, @@ -30053,10 +30303,7 @@ pub mod api { #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub enum RequestStatus<_0, _1> { #[codec(index = 0)] - Unrequested { - deposit: (_0, _1), - len: ::core::primitive::u32, - }, + Unrequested { deposit: (_0, _1), len: ::core::primitive::u32 }, #[codec(index = 1)] Requested { deposit: ::core::option::Option<(_0, _1)>, @@ -30097,10 +30344,7 @@ pub mod api { }, #[codec(index = 1)] #[doc = "See [`Pallet::cancel`]."] - cancel { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, + cancel { when: ::core::primitive::u32, index: ::core::primitive::u32 }, #[codec(index = 2)] #[doc = "See [`Pallet::schedule_named`]."] schedule_named { @@ -30115,9 +30359,7 @@ pub mod api { }, #[codec(index = 3)] #[doc = "See [`Pallet::cancel_named`]."] - cancel_named { - id: [::core::primitive::u8; 32usize], - }, + cancel_named { id: [::core::primitive::u8; 32usize] }, #[codec(index = 4)] #[doc = "See [`Pallet::schedule_after`]."] schedule_after { @@ -30190,16 +30432,10 @@ pub mod api { pub enum Event { #[codec(index = 0)] #[doc = "Scheduled some task."] - Scheduled { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, + Scheduled { when: ::core::primitive::u32, index: ::core::primitive::u32 }, #[codec(index = 1)] #[doc = "Canceled some task."] - Canceled { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, + Canceled { when: ::core::primitive::u32, index: ::core::primitive::u32 }, #[codec(index = 2)] #[doc = "Dispatched some task."] Dispatched { @@ -30329,9 +30565,7 @@ pub mod api { #[codec(index = 0)] #[doc = "New session has happened. Note that the argument is the session index, not the"] #[doc = "block number as the type might suggest."] - NewSession { - session_index: ::core::primitive::u32, - }, + NewSession { session_index: ::core::primitive::u32 }, } } } @@ -30379,14 +30613,10 @@ pub mod api { }, #[codec(index = 3)] #[doc = "See [`Pallet::withdraw_unbonded`]."] - withdraw_unbonded { - num_slashing_spans: ::core::primitive::u32, - }, + withdraw_unbonded { num_slashing_spans: ::core::primitive::u32 }, #[codec(index = 4)] #[doc = "See [`Pallet::validate`]."] - validate { - prefs: runtime_types::pallet_staking::ValidatorPrefs, - }, + validate { prefs: runtime_types::pallet_staking::ValidatorPrefs }, #[codec(index = 5)] #[doc = "See [`Pallet::nominate`]."] nominate { @@ -30510,14 +30740,10 @@ pub mod api { }, #[codec(index = 23)] #[doc = "See [`Pallet::chill_other`]."] - chill_other { - controller: ::subxt::utils::AccountId32, - }, + chill_other { controller: ::subxt::utils::AccountId32 }, #[codec(index = 24)] #[doc = "See [`Pallet::force_apply_min_commission`]."] - force_apply_min_commission { - validator_stash: ::subxt::utils::AccountId32, - }, + force_apply_min_commission { validator_stash: ::subxt::utils::AccountId32 }, #[codec(index = 25)] #[doc = "See [`Pallet::set_min_commission`]."] set_min_commission { @@ -30686,9 +30912,7 @@ pub mod api { #[codec(index = 4)] #[doc = "An old slashing report from a prior era was discarded because it could"] #[doc = "not be processed."] - OldSlashingReportDiscarded { - session_index: ::core::primitive::u32, - }, + OldSlashingReportDiscarded { session_index: ::core::primitive::u32 }, #[codec(index = 5)] #[doc = "A new set of stakers was elected."] StakersElected, @@ -30740,9 +30964,7 @@ pub mod api { }, #[codec(index = 14)] #[doc = "A new force era mode was set."] - ForceEra { - mode: runtime_types::pallet_staking::Forcing, - }, + ForceEra { mode: runtime_types::pallet_staking::Forcing }, } } } @@ -31031,9 +31253,7 @@ pub mod api { pub enum Call { #[codec(index = 0)] #[doc = "See [`Pallet::sudo`]."] - sudo { - call: ::std::boxed::Box, - }, + sudo { call: ::std::boxed::Box }, #[codec(index = 1)] #[doc = "See [`Pallet::sudo_unchecked_weight`]."] sudo_unchecked_weight { @@ -31100,9 +31320,7 @@ pub mod api { }, #[codec(index = 1)] #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied if one existed."] - KeyChanged { - old_sudoer: ::core::option::Option<::subxt::utils::AccountId32>, - }, + KeyChanged { old_sudoer: ::core::option::Option<::subxt::utils::AccountId32> }, #[codec(index = 2)] #[doc = "A sudo just took place. \\[result\\]"] SudoAsDone { @@ -31463,14 +31681,10 @@ pub mod api { pub enum Event { #[codec(index = 0)] #[doc = "New proposal."] - Proposed { - proposal_index: ::core::primitive::u32, - }, + Proposed { proposal_index: ::core::primitive::u32 }, #[codec(index = 1)] #[doc = "We have ended a spend period and will now allocate funds."] - Spending { - budget_remaining: ::core::primitive::u128, - }, + Spending { budget_remaining: ::core::primitive::u128 }, #[codec(index = 2)] #[doc = "Some funds have been allocated."] Awarded { @@ -31486,14 +31700,10 @@ pub mod api { }, #[codec(index = 4)] #[doc = "Some of our funds have been burnt."] - Burnt { - burnt_funds: ::core::primitive::u128, - }, + Burnt { burnt_funds: ::core::primitive::u128 }, #[codec(index = 5)] #[doc = "Spending has finished; this is the amount that rolls over until next spend."] - Rollover { - rollover_balance: ::core::primitive::u128, - }, + Rollover { rollover_balance: ::core::primitive::u128 }, #[codec(index = 6)] #[doc = "Some funds have been deposited."] Deposit { value: ::core::primitive::u128 }, @@ -31553,9 +31763,7 @@ pub mod api { pub enum Call { #[codec(index = 0)] #[doc = "See [`Pallet::batch`]."] - batch { - calls: ::std::vec::Vec, - }, + batch { calls: ::std::vec::Vec }, #[codec(index = 1)] #[doc = "See [`Pallet::as_derivative`]."] as_derivative { @@ -31564,9 +31772,7 @@ pub mod api { }, #[codec(index = 2)] #[doc = "See [`Pallet::batch_all`]."] - batch_all { - calls: ::std::vec::Vec, - }, + batch_all { calls: ::std::vec::Vec }, #[codec(index = 3)] #[doc = "See [`Pallet::dispatch_as`]."] dispatch_as { @@ -31575,9 +31781,7 @@ pub mod api { }, #[codec(index = 4)] #[doc = "See [`Pallet::force_batch`]."] - force_batch { - calls: ::std::vec::Vec, - }, + force_batch { calls: ::std::vec::Vec }, #[codec(index = 5)] #[doc = "See [`Pallet::with_weight`]."] with_weight { @@ -31637,9 +31841,7 @@ pub mod api { ItemCompleted, #[codec(index = 4)] #[doc = "A single item within a Batch of dispatches has completed with error."] - ItemFailed { - error: runtime_types::sp_runtime::DispatchError, - }, + ItemFailed { error: runtime_types::sp_runtime::DispatchError }, #[codec(index = 5)] #[doc = "A call was dispatched."] DispatchedAs { diff --git a/avail-subxt/src/e2e.rs b/avail-subxt/src/e2e.rs index 689c0f23d..38cf9298d 100644 --- a/avail-subxt/src/e2e.rs +++ b/avail-subxt/src/e2e.rs @@ -64,10 +64,7 @@ async fn run_example(example: impl AsRef, _opts: &E2EOpts) -> Result<()> { .wait() .await?; - ensure!( - status.success(), - anyhow!("Example {} failed", example.as_ref()) - ); + ensure!(status.success(), anyhow!("Example {} failed", example.as_ref())); Ok(()) } diff --git a/avail-subxt/src/lib.rs b/avail-subxt/src/lib.rs index fccc69adc..b3b5bc23b 100644 --- a/avail-subxt/src/lib.rs +++ b/avail-subxt/src/lib.rs @@ -97,10 +97,7 @@ macro_rules! tx_send { #[macro_export] macro_rules! tx_asend { ($client: expr, $call: expr, $signer: expr) => { - $client - .tx() - .sign_and_submit_then_watch_default($call, $signer) - .await + $client.tx().sign_and_submit_then_watch_default($call, $signer).await }; } @@ -117,9 +114,7 @@ mod test { const TIMESTAMP_1: &[u8] = &hex!("280403000b804aa9518401"); fn timestamp_1_call() -> Result { - Ok(Call::Timestamp(TimestampCall::set { - now: 1_667_817_360_000, - })) + Ok(Call::Timestamp(TimestampCall::set { now: 1_667_817_360_000 })) } #[test_case( TIMESTAMP_1.to_vec() => timestamp_1_call(); "Timestamp 16678173600000" )] diff --git a/avail-subxt/src/primitives/app_unchecked_extrinsic.rs b/avail-subxt/src/primitives/app_unchecked_extrinsic.rs index 2ac433f0d..ddef25aeb 100644 --- a/avail-subxt/src/primitives/app_unchecked_extrinsic.rs +++ b/avail-subxt/src/primitives/app_unchecked_extrinsic.rs @@ -56,9 +56,8 @@ impl Decode for AppUncheckedExtrinsic { let signature = is_signed.then(|| Decode::decode(input)).transpose()?; let function = Decode::decode(input)?; - if let Some((before_length, after_length)) = input - .remaining_len()? - .and_then(|a| before_length.map(|b| (b, a))) + if let Some((before_length, after_length)) = + input.remaining_len()?.and_then(|a| before_length.map(|b| (b, a))) { let length = before_length.saturating_sub(after_length); @@ -67,10 +66,7 @@ impl Decode for AppUncheckedExtrinsic { } } - Ok(Self { - signature, - function, - }) + Ok(Self { signature, function }) } } diff --git a/avail-subxt/src/primitives/extrinsic_params.rs b/avail-subxt/src/primitives/extrinsic_params.rs index 0c9214e15..5424cf4a1 100644 --- a/avail-subxt/src/primitives/extrinsic_params.rs +++ b/avail-subxt/src/primitives/extrinsic_params.rs @@ -44,13 +44,7 @@ impl ExtrinsicParams for AvailExtrinsicParams { } fn encode_additional_to(&self, v: &mut Vec) { - ( - self.spec_version, - self.tx_version, - self.genesis_hash, - self.genesis_hash, - ) - .encode_to(v); + (self.spec_version, self.tx_version, self.genesis_hash, self.genesis_hash).encode_to(v); } } @@ -70,19 +64,12 @@ impl Default for AvailExtrinsicParams { impl AvailExtrinsicParams { /// Create params with the addition of tip and app_id pub fn new_with_tip_and_app_id(tip: u128, app_id: AppId) -> Self { - Self { - tip: tip.into(), - app_id, - ..Default::default() - } + Self { tip: tip.into(), app_id, ..Default::default() } } /// Create params with the addition of app_id pub fn new_with_app_id(app_id: AppId) -> Self { - Self { - app_id, - ..Default::default() - } + Self { app_id, ..Default::default() } } } @@ -97,12 +84,6 @@ impl Decode for AvailExtrinsicParams { fn decode(input: &mut I) -> Result { let (mortality, nonce, tip, app_id) = <(Era, Compact, Compact, AppId)>::decode(input)?; - Ok(Self { - mortality, - nonce, - tip, - app_id, - ..Default::default() - }) + Ok(Self { mortality, nonce, tip, app_id, ..Default::default() }) } } diff --git a/avail-subxt/src/primitives/header.rs b/avail-subxt/src/primitives/header.rs index 72da1d9ae..d7382ebd7 100644 --- a/avail-subxt/src/primitives/header.rs +++ b/avail-subxt/src/primitives/header.rs @@ -41,9 +41,13 @@ impl SPHeader for Header { type Hasher = BlakeTwo256; type Number = u32; - fn number(&self) -> Self::Number { self.number } + fn number(&self) -> Self::Number { + self.number + } - fn hash(&self) -> ::Output { Self::Hasher::hash_of(self) } + fn hash(&self) -> ::Output { + Self::Hasher::hash_of(self) + } } fn number_from_hex<'de, D>(deserializer: D) -> Result @@ -74,11 +78,7 @@ where impl From for ApiDigest { fn from(d: Digest) -> Self { - let logs = d - .logs - .into_iter() - .map(|xt_item| xt_item.into()) - .collect::>(); + let logs = d.logs.into_iter().map(|xt_item| xt_item.into()).collect::>(); Self { logs } } } diff --git a/base/src/metrics.rs b/base/src/metrics.rs index 04226f000..cdb7ca34d 100644 --- a/base/src/metrics.rs +++ b/base/src/metrics.rs @@ -63,7 +63,5 @@ fn linear_histogram + Display + Clone>( // NOTE: `linear_buckets` exists on `prometheus` library but it is not exported by // `prometheus-endpoint` O_o! fn linear_buckets(start: f64, width: f64, count: usize) -> Vec { - (0..count) - .map(|step| start + width * (step as f64)) - .collect() + (0..count).map(|step| start + width * (step as f64)).collect() } diff --git a/base/src/metrics/general.rs b/base/src/metrics/general.rs index 12d2790c9..af01a090d 100644 --- a/base/src/metrics/general.rs +++ b/base/src/metrics/general.rs @@ -10,29 +10,13 @@ pub struct GeneralMetrics { impl GeneralMetrics { pub fn new(registry: &Registry) -> Result { - let block_dims_rows = exp_histogram( - registry, - "avail_block_dims_rows", - "Block dimension row", - 32.0, - 2.0, - 5, - )?; - let block_dims_cols = exp_histogram( - registry, - "avail_block_dims_cols", - "Block dimension col", - 32.0, - 2.0, - 5, - )?; + let block_dims_rows = + exp_histogram(registry, "avail_block_dims_rows", "Block dimension row", 32.0, 2.0, 5)?; + let block_dims_cols = + exp_histogram(registry, "avail_block_dims_cols", "Block dimension col", 32.0, 2.0, 5)?; // @TODO Define buckets properly let block_len = exp_histogram(registry, "avail_block_len", "Block length", 0.001, 4.0, 9)?; - Ok(Self { - block_dims_cols, - block_dims_rows, - block_len, - }) + Ok(Self { block_dims_cols, block_dims_rows, block_len }) } } diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index edafca68d..d633f13a3 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -43,13 +43,19 @@ pub struct RemarkBuilder { impl RemarkBuilder { /// Creates a new [`Self`] from the given client. #[allow(dead_code)] - pub fn new(client: Arc) -> Self { Self { client } } + pub fn new(client: Arc) -> Self { + Self { client } + } } impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder { - fn pallet(&self) -> &str { "system" } + fn pallet(&self) -> &str { + "system" + } - fn extrinsic(&self) -> &str { "remark" } + fn extrinsic(&self) -> &str { + "remark" + } fn build(&self, nonce: u32) -> std::result::Result { let acc = Sr25519Keyring::Bob.pair(); @@ -78,28 +84,25 @@ impl TransferKeepAliveBuilder { /// Creates a new [`Self`] from the given client. #[allow(dead_code)] pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self { - Self { - client, - dest, - value, - } + Self { client, dest, value } } } impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { - fn pallet(&self) -> &str { "balances" } + fn pallet(&self) -> &str { + "balances" + } - fn extrinsic(&self) -> &str { "transfer_keep_alive" } + fn extrinsic(&self) -> &str { + "transfer_keep_alive" + } fn build(&self, nonce: u32) -> std::result::Result { let acc = Sr25519Keyring::Bob.pair(); let extrinsic = create_extrinsic( self.client.as_ref(), acc, - BalancesCall::transfer_keep_alive { - dest: self.dest.clone().into(), - value: self.value, - }, + BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value }, Some(nonce), AppId(0), ); diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 791863d5b..29f78e98b 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -89,22 +89,14 @@ impl AuthorityKeys { authority_discovery: get_from_seed::(seed), }; - Self { - controller, - stash, - session_keys, - } + Self { controller, stash, session_keys } } pub fn from_accounts(controller: AccountId, grandpa: GrandpaId) -> Self { let session_keys = session_keys(controller.clone(), grandpa); let stash = controller.clone(); - Self { - controller, - stash, - session_keys, - } + Self { controller, stash, session_keys } } } @@ -251,7 +243,9 @@ pub(crate) mod tests { */ #[test] - fn test_create_development_chain_spec() { locals::solo::chain_spec().build_storage().unwrap(); } + fn test_create_development_chain_spec() { + locals::solo::chain_spec().build_storage().unwrap(); + } #[test] fn test_create_development_tri_chain_spec() { diff --git a/node/src/chain_spec/config.rs b/node/src/chain_spec/config.rs index bf5c3667c..767e302e7 100644 --- a/node/src/chain_spec/config.rs +++ b/node/src/chain_spec/config.rs @@ -29,12 +29,7 @@ pub(crate) fn make_system_config() -> SystemConfig { ) .expect("Valid `BlockLength` genesis definition .qed"); - SystemConfig { - code, - kc_public_params, - block_length, - ..Default::default() - } + SystemConfig { code, kc_public_params, block_length, ..Default::default() } } /// Creates the Balances configuration and endows each account @@ -74,10 +69,7 @@ pub(crate) fn make_staking_config<'a, I: Iterator>( }) .unzip(); - let len: u32 = invulnerables - .len() - .try_into() - .expect("Too much authorities .qed"); + let len: u32 = invulnerables.len().try_into().expect("Too much authorities .qed"); StakingConfig { stakers, @@ -93,14 +85,13 @@ pub(crate) fn make_staking_config<'a, I: Iterator>( /// Creates the Technical Committee configuration and adds `members` to it. pub(crate) fn make_technical_committee_config(members: Vec) -> TechnicalCommitteeConfig { - TechnicalCommitteeConfig { - members, - ..Default::default() - } + TechnicalCommitteeConfig { members, ..Default::default() } } /// Uses `key` as `sudo` key. -pub(crate) fn make_sudo_config(key: AccountId) -> SudoConfig { SudoConfig { key: Some(key) } } +pub(crate) fn make_sudo_config(key: AccountId) -> SudoConfig { + SudoConfig { key: Some(key) } +} const INIT_APP_IDS: [&str; 3] = ["Data Avail", "Ethereum", "Polygon"]; @@ -109,18 +100,12 @@ pub(crate) fn make_data_avail_config(owner: AccountId) -> DataAvailabilityConfig .iter() .enumerate() .map(|(id, app)| { - let info = AppKeyInfo { - owner: owner.clone(), - id: AppId(id as u32), - }; + let info = AppKeyInfo { owner: owner.clone(), id: AppId(id as u32) }; (app.as_bytes().to_vec(), info) }) .collect(); - DataAvailabilityConfig { - app_keys, - ..Default::default() - } + DataAvailabilityConfig { app_keys, ..Default::default() } } pub(crate) fn make_nomination_pools_config() -> NominationPoolsConfig { @@ -161,17 +146,10 @@ pub(crate) mod nomad { use primitive_types::H160; pub(crate) fn make_home_config(local_domain: u32, updater: H160) -> NomadHomeConfig { - NomadHomeConfig { - local_domain, - updater, - ..Default::default() - } + NomadHomeConfig { local_domain, updater, ..Default::default() } } pub(crate) fn make_update_manager_config(updater: H160) -> NomadUpdaterManagerConfig { - NomadUpdaterManagerConfig { - updater, - ..Default::default() - } + NomadUpdaterManagerConfig { updater, ..Default::default() } } } diff --git a/node/src/chain_spec/locals.rs b/node/src/chain_spec/locals.rs index a9bcd2a63..6f83f75cd 100644 --- a/node/src/chain_spec/locals.rs +++ b/node/src/chain_spec/locals.rs @@ -24,7 +24,9 @@ fn dev_endowed_accounts() -> HashMap { } /// `Alice` is the sudo key in `dev`. -fn dev_sudo() -> AccountId { get_account_id_from_seed::("Alice") } +fn dev_sudo() -> AccountId { + get_account_id_from_seed::("Alice") +} fn make_genesis( sudo: AccountId, diff --git a/node/src/command.rs b/node/src/command.rs index f8c37a86f..51d0034d3 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -35,17 +35,29 @@ use crate::{ }; impl SubstrateCli for Cli { - fn impl_name() -> String { "Avail Node".into() } + fn impl_name() -> String { + "Avail Node".into() + } - fn impl_version() -> String { env!("SUBSTRATE_CLI_IMPL_VERSION").into() } + fn impl_version() -> String { + env!("SUBSTRATE_CLI_IMPL_VERSION").into() + } - fn description() -> String { env!("CARGO_PKG_DESCRIPTION").into() } + fn description() -> String { + env!("CARGO_PKG_DESCRIPTION").into() + } - fn author() -> String { env!("CARGO_PKG_AUTHORS").into() } + fn author() -> String { + env!("CARGO_PKG_AUTHORS").into() + } - fn support_url() -> String { "support.anonymous.an".into() } + fn support_url() -> String { + "support.anonymous.an".into() + } - fn copyright_start_year() -> i32 { 2017 } + fn copyright_start_year() -> i32 { + 2017 + } fn load_spec(&self, id: &str) -> std::result::Result, String> { let spec = match id { @@ -59,9 +71,9 @@ impl SubstrateCli for Cli { "local.tri" => Box::new(chain_spec::locals::tri::chain_spec()), "testnet" | "testnet.kate" => Box::new(chain_spec::testnets::kate::chain_spec()), // "mainnet" => Box::new(chain_spec::mainnet::chain_spec()), - path => Box::new(chain_spec::ChainSpec::from_json_file( - std::path::PathBuf::from(path), - )?), + path => { + Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?) + }, }; Ok(spec) } @@ -181,46 +193,30 @@ pub fn run() -> Result<()> { Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { - client, - task_manager, - import_queue, - .. - } = new_partial(&config)?; + let PartialComponents { client, task_manager, import_queue, .. } = + new_partial(&config)?; Ok((cmd.run(client, import_queue), task_manager)) }) }, Some(Subcommand::ExportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { - client, - task_manager, - .. - } = new_partial(&config)?; + let PartialComponents { client, task_manager, .. } = new_partial(&config)?; Ok((cmd.run(client, config.database), task_manager)) }) }, Some(Subcommand::ExportState(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { - client, - task_manager, - .. - } = new_partial(&config)?; + let PartialComponents { client, task_manager, .. } = new_partial(&config)?; Ok((cmd.run(client, config.chain_spec), task_manager)) }) }, Some(Subcommand::ImportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { - client, - task_manager, - import_queue, - .. - } = new_partial(&config)?; + let PartialComponents { client, task_manager, import_queue, .. } = + new_partial(&config)?; Ok((cmd.run(client, import_queue), task_manager)) }) }, @@ -231,12 +227,7 @@ pub fn run() -> Result<()> { Some(Subcommand::Revert(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { - client, - task_manager, - backend, - .. - } = new_partial(&config)?; + let PartialComponents { client, task_manager, backend, .. } = new_partial(&config)?; let aux_revert = Box::new(|client: Arc, backend, blocks| { sc_consensus_babe::revert(client.clone(), backend, blocks)?; sc_consensus_grandpa::revert(client, blocks)?; diff --git a/node/src/da_block_import.rs b/node/src/da_block_import.rs index b16fd7250..3cc22c547 100644 --- a/node/src/da_block_import.rs +++ b/node/src/da_block_import.rs @@ -31,10 +31,7 @@ pub struct BlockImport { impl Clone for BlockImport { fn clone(&self) -> Self { - Self { - client: self.client.clone(), - inner: self.inner.clone(), - } + Self { client: self.client.clone(), inner: self.inner.clone() } } } diff --git a/node/src/main.rs b/node/src/main.rs index 7ed4f3491..accfed47f 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -11,4 +11,6 @@ mod command; mod da_block_import; mod rpc; -fn main() -> sc_cli::Result<()> { command::run() } +fn main() -> sc_cli::Result<()> { + command::run() +} diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 8d16db0dc..dda328752 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -131,20 +131,9 @@ where use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer}; let mut io = RpcModule::new(()); - let FullDeps { - client, - pool, - select_chain, - chain_spec, - deny_unsafe, - babe, - grandpa, - } = deps; - - let BabeDeps { - keystore, - babe_worker_handle, - } = babe; + let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa } = deps; + + let BabeDeps { keystore, babe_worker_handle } = babe; let GrandpaDeps { shared_voter_state, shared_authority_set, @@ -154,11 +143,7 @@ where } = grandpa; let chain_name = chain_spec.name().to_string(); - let genesis_hash = client - .block_hash(0) - .ok() - .flatten() - .expect("Genesis block exists; qed"); + let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); let properties = chain_spec.properties(); io.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?; @@ -177,14 +162,8 @@ where )?; io.merge(TransactionPayment::new(client.clone()).into_rpc())?; io.merge( - Babe::new( - client.clone(), - babe_worker_handle.clone(), - keystore, - select_chain, - deny_unsafe, - ) - .into_rpc(), + Babe::new(client.clone(), babe_worker_handle.clone(), keystore, select_chain, deny_unsafe) + .into_rpc(), )?; io.merge( Grandpa::new( @@ -198,13 +177,8 @@ where )?; io.merge( - SyncState::new( - chain_spec, - client.clone(), - shared_authority_set, - babe_worker_handle, - )? - .into_rpc(), + SyncState::new(chain_spec, client.clone(), shared_authority_set, babe_worker_handle)? + .into_rpc(), )?; io.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?; diff --git a/node/src/service.rs b/node/src/service.rs index 37b430efc..2da508c0b 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -59,7 +59,9 @@ impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { da_runtime::apis::api::dispatch(method, data) } - fn native_version() -> sc_executor::NativeVersion { da_runtime::native_version() } + fn native_version() -> sc_executor::NativeVersion { + da_runtime::native_version() + } } /// The full client type definition. @@ -103,11 +105,7 @@ pub fn create_extrinsic( app_id: AppId, ) -> da_runtime::UncheckedExtrinsic { let function = function.into(); - let genesis_hash = client - .block_hash(0) - .ok() - .flatten() - .expect("Genesis block exists; qed"); + let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); let best_hash = client.chain_info().best_hash; let best_block = client.chain_info().best_number; let nonce = nonce.unwrap_or_else(|| fetch_nonce(client, sender.clone())); @@ -204,9 +202,7 @@ pub fn new_partial( let client = Arc::new(client); let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager - .spawn_handle() - .spawn("telemetry", None, worker.run()); + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); telemetry }); @@ -366,11 +362,7 @@ pub fn new_full_base( let auth_disc_publish_non_global_ips = config.network.allow_non_globals_in_dht; let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( - &client - .block_hash(0) - .ok() - .flatten() - .expect("Genesis block exists; qed"), + &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), &config.chain_spec, ); net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( @@ -498,14 +490,12 @@ pub fn new_full_base( let authority_discovery_role = sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore()); let dht_event_stream = - network - .event_stream("authority-discovery") - .filter_map(|e| async move { - match e { - Event::Dht(e) => Some(e), - _ => None, - } - }); + network.event_stream("authority-discovery").filter_map(|e| async move { + match e { + Event::Dht(e) => Some(e), + _ => None, + } + }); let (authority_discovery_worker, _service) = sc_authority_discovery::new_worker_and_service_with_config( sc_authority_discovery::WorkerConfig { @@ -528,11 +518,7 @@ pub fn new_full_base( // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = if role.is_authority() { - Some(keystore_container.keystore()) - } else { - None - }; + let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None }; let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec diff --git a/pallets/bridges/nomad/da-bridge/src/lib.rs b/pallets/bridges/nomad/da-bridge/src/lib.rs index 5cb1b376e..f8417fa48 100644 --- a/pallets/bridges/nomad/da-bridge/src/lib.rs +++ b/pallets/bridges/nomad/da-bridge/src/lib.rs @@ -99,11 +99,7 @@ pub mod pallet { let block_number: u32 = (*header.number()).saturated_into(); let data_root = header.extension().data_root(); - let message: DABridgeMessages = DataRootMessage { - block_number, - data_root, - } - .into(); + let message: DABridgeMessages = DataRootMessage { block_number, data_root }.into(); let body: BoundedVec = message .encode() @@ -138,10 +134,7 @@ pub mod pallet { // Ensure header's hash matches that in the block number to hash // mapping let hash = header.hash(); - ensure!( - stored_hash == hash, - Error::::HashOfBlockNotMatchBlockNumber, - ); + ensure!(stored_hash == hash, Error::::HashOfBlockNotMatchBlockNumber,); Ok(().into()) } diff --git a/pallets/bridges/nomad/da-bridge/src/message.rs b/pallets/bridges/nomad/da-bridge/src/message.rs index 281beeec9..960660070 100644 --- a/pallets/bridges/nomad/da-bridge/src/message.rs +++ b/pallets/bridges/nomad/da-bridge/src/message.rs @@ -65,7 +65,9 @@ pub enum DABridgeMessages { } impl From for DABridgeMessages { - fn from(data_root_msg: DataRootMessage) -> Self { Self::DataRootMessage(data_root_msg) } + fn from(data_root_msg: DataRootMessage) -> Self { + Self::DataRootMessage(data_root_msg) + } } impl TypedMessage for DABridgeMessages { @@ -95,10 +97,7 @@ mod test { #[test] fn it_creates_data_root_msg() { - let message = DataRootMessage { - block_number: 5, - data_root: H256::repeat_byte(1), - }; + let message = DataRootMessage { block_number: 5, data_root: H256::repeat_byte(1) }; assert_eq!(message.len(), DATA_ROOT_MSG_LEN); diff --git a/pallets/bridges/nomad/da-bridge/src/mock.rs b/pallets/bridges/nomad/da-bridge/src/mock.rs index 509ba77b8..f08da56ec 100644 --- a/pallets/bridges/nomad/da-bridge/src/mock.rs +++ b/pallets/bridges/nomad/da-bridge/src/mock.rs @@ -132,13 +132,7 @@ pub(crate) fn _events() -> Vec> { System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| { - if let RuntimeEvent::DABridge(inner) = e { - Some(inner) - } else { - None - } - }) + .filter_map(|e| if let RuntimeEvent::DABridge(inner) = e { Some(inner) } else { None }) .collect::>() } diff --git a/pallets/bridges/nomad/da-bridge/src/tests.rs b/pallets/bridges/nomad/da-bridge/src/tests.rs index 43ae7feb7..882b419a4 100644 --- a/pallets/bridges/nomad/da-bridge/src/tests.rs +++ b/pallets/bridges/nomad/da-bridge/src/tests.rs @@ -15,53 +15,50 @@ const DESTINATION_DOMAIN: u32 = 1000; #[test] fn it_accepts_valid_extrinsic_root() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(|| { - fill_block_hash_mapping_up_to_n(9); + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(|| { + fill_block_hash_mapping_up_to_n(9); - // Create extrinsics root for block 10 - let extension = HeaderExtension::default(); + // Create extrinsics root for block 10 + let extension = HeaderExtension::default(); - // Create block header for block 10 - let header = Header::, BlakeTwo256> { - parent_hash: [1u8; 32].into(), - number: 10_u32, - state_root: [2u8; 32].into(), - extrinsics_root: hex!( - "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314" - ) - .into(), - digest: Digest { logs: vec![] }, - extension, - }; + // Create block header for block 10 + let header = Header::, BlakeTwo256> { + parent_hash: [1u8; 32].into(), + number: 10_u32, + state_root: [2u8; 32].into(), + extrinsics_root: hex!( + "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314" + ) + .into(), + digest: Digest { logs: vec![] }, + extension, + }; - // Insert 10th block's hash into block number --> hash mapping so - // submitting 10th block's header is accepted by pallet - frame_system::BlockHash::::insert::::Hash>( - 10u32, - header.hash(), - ); + // Insert 10th block's hash into block number --> hash mapping so + // submitting 10th block's header is accepted by pallet + frame_system::BlockHash::::insert::::Hash>( + 10u32, + header.hash(), + ); - // Get home's current merkle root pre-enqueue - let root_pre = Home::tree().root(); - let nonce_pre = Home::nonces(DESTINATION_DOMAIN); + // Get home's current merkle root pre-enqueue + let root_pre = Home::tree().root(); + let nonce_pre = Home::nonces(DESTINATION_DOMAIN); - // Enqueue extrinsic root - assert_ok!(DABridge::try_dispatch_data_root( - RuntimeOrigin::signed(TEST_SENDER_ACCOUNT), - DESTINATION_DOMAIN, - H256::zero(), - Box::new(header) - )); + // Enqueue extrinsic root + assert_ok!(DABridge::try_dispatch_data_root( + RuntimeOrigin::signed(TEST_SENDER_ACCOUNT), + DESTINATION_DOMAIN, + H256::zero(), + Box::new(header) + )); - // Get home's merkle root post-enqueue - let root_post = Home::tree().root(); - let nonce_post = Home::nonces(DESTINATION_DOMAIN); + // Get home's merkle root post-enqueue + let root_post = Home::tree().root(); + let nonce_post = Home::nonces(DESTINATION_DOMAIN); - // Ensure home's merkle root changed after enqueueing message - assert_ne!(root_pre, root_post); - assert_eq!(nonce_pre + 1, nonce_post); - }) + // Ensure home's merkle root changed after enqueueing message + assert_ne!(root_pre, root_post); + assert_eq!(nonce_pre + 1, nonce_post); + }) } diff --git a/pallets/bridges/nomad/home/src/benchmarking.rs b/pallets/bridges/nomad/home/src/benchmarking.rs index f543bd75b..c0664c312 100644 --- a/pallets/bridges/nomad/home/src/benchmarking.rs +++ b/pallets/bridges/nomad/home/src/benchmarking.rs @@ -151,11 +151,7 @@ where let origin = RawOrigin::Signed(whitelisted_caller::()); // Initial base: - Base::::put(nomad_base::NomadBase::new( - ID, - H256([0u8; 32]), - UPDATER_ADDRESS, - )); + Base::::put(nomad_base::NomadBase::new(ID, H256([0u8; 32]), UPDATER_ADDRESS)); for _ in 0..index { assert_ok!(Pallet::::dispatch( diff --git a/pallets/bridges/nomad/home/src/lib.rs b/pallets/bridges/nomad/home/src/lib.rs index db1308df1..1218a087c 100644 --- a/pallets/bridges/nomad/home/src/lib.rs +++ b/pallets/bridges/nomad/home/src/lib.rs @@ -85,11 +85,7 @@ pub mod pallet { #[pallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - >::put(NomadBase::new( - self.local_domain, - self.committed_root, - self.updater, - )); + >::put(NomadBase::new(self.local_domain, self.committed_root, self.updater)); >::put(NomadLightMerkle::default()); } } @@ -150,12 +146,7 @@ pub mod pallet { message_body: BoundedVec, ) -> DispatchResult { let sender: [u8; 32] = ensure_signed(origin)?.into(); - Self::do_dispatch( - sender.into(), - destination_domain, - recipient_address, - message_body, - ) + Self::do_dispatch(sender.into(), destination_domain, recipient_address, message_body) } /// Verify/submit signed update. @@ -205,10 +196,7 @@ pub mod pallet { [u8; 32]: From, { fn ensure_not_failed() -> Result<(), Error> { - ensure!( - Self::base().state != NomadState::Failed, - Error::::FailedState - ); + ensure!(Self::base().state != NomadState::Failed, Error::::FailedState); Ok(()) } @@ -226,9 +214,8 @@ pub mod pallet { // Get nonce and set new nonce Nonces::::try_mutate(destination_domain, |nonce| -> Result<(), DispatchError> { - let new_nonce = nonce - .checked_add(1) - .ok_or_else(|| DispatchError::from(Overflow))?; + let new_nonce = + nonce.checked_add(1).ok_or_else(|| DispatchError::from(Overflow))?; // Format message and get message hash let message = NomadMessage { @@ -375,9 +362,8 @@ pub mod common_tests_and_benches { use nomad_signature::Signature; use sp_core::{H256, U256}; - const EXPECTED_NEW_ROOT_LONGEST_TREE: H256 = H256(hex!( - "dd0a05d7b71c171d06b51f11d1191f2ce23dbe679ecabea374ee3a7909383fb6" - )); + const EXPECTED_NEW_ROOT_LONGEST_TREE: H256 = + H256(hex!("dd0a05d7b71c171d06b51f11d1191f2ce23dbe679ecabea374ee3a7909383fb6")); pub fn expected_longest_tree_signed_update() -> SignedUpdate { SignedUpdate { diff --git a/pallets/bridges/nomad/home/src/mock.rs b/pallets/bridges/nomad/home/src/mock.rs index 74d0f5aac..84d5777f2 100644 --- a/pallets/bridges/nomad/home/src/mock.rs +++ b/pallets/bridges/nomad/home/src/mock.rs @@ -118,12 +118,6 @@ pub(crate) fn events() -> Vec> { System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| { - if let RuntimeEvent::Home(inner) = e { - Some(inner) - } else { - None - } - }) + .filter_map(|e| if let RuntimeEvent::Home(inner) = e { Some(inner) } else { None }) .collect::>() } diff --git a/pallets/bridges/nomad/home/src/tests.rs b/pallets/bridges/nomad/home/src/tests.rs index f5e77ac07..9fbab1370 100644 --- a/pallets/bridges/nomad/home/src/tests.rs +++ b/pallets/bridges/nomad/home/src/tests.rs @@ -23,111 +23,91 @@ const TEST_RECIPIENT: H256 = H256::repeat_byte(3); #[test] fn it_dispatches_message() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(|| { - // Fetch expected values - let nonce = Home::nonces(TEST_REMOTE_DOMAIN); - let destination_and_nonce = destination_and_nonce(TEST_REMOTE_DOMAIN, nonce); - let leaf_index = Home::tree().count(); - let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); - let committed_root = Home::base().committed_root; - - // Format expected message - let message = NomadMessage { - origin: TEST_LOCAL_DOMAIN, - sender: TEST_SENDER_BYTES, - nonce, - destination: TEST_REMOTE_DOMAIN, - recipient: TEST_RECIPIENT, - body: body.clone(), - }; - let message_hash = message.hash(); - - // Dispatch message - let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); - assert_ok!(Home::dispatch( - origin, - TEST_REMOTE_DOMAIN, - TEST_RECIPIENT, - body - )); - - // Tree count incremented - assert!(Home::tree().count() == 1); - - // Mappings have root and index - let current_root = Home::tree().root(); - assert!(Home::index_to_root(leaf_index).unwrap() == current_root); - assert!(Home::root_to_index(current_root).unwrap() == leaf_index); - - let expected = vec![crate::Event::Dispatch { - message_hash, - leaf_index, - destination_and_nonce, - committed_root, - message: message.to_vec(), - }]; - assert_eq!(events(), expected); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(|| { + // Fetch expected values + let nonce = Home::nonces(TEST_REMOTE_DOMAIN); + let destination_and_nonce = destination_and_nonce(TEST_REMOTE_DOMAIN, nonce); + let leaf_index = Home::tree().count(); + let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); + let committed_root = Home::base().committed_root; + + // Format expected message + let message = NomadMessage { + origin: TEST_LOCAL_DOMAIN, + sender: TEST_SENDER_BYTES, + nonce, + destination: TEST_REMOTE_DOMAIN, + recipient: TEST_RECIPIENT, + body: body.clone(), + }; + let message_hash = message.hash(); + + // Dispatch message + let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::dispatch(origin, TEST_REMOTE_DOMAIN, TEST_RECIPIENT, body)); + + // Tree count incremented + assert!(Home::tree().count() == 1); + + // Mappings have root and index + let current_root = Home::tree().root(); + assert!(Home::index_to_root(leaf_index).unwrap() == current_root); + assert!(Home::root_to_index(current_root).unwrap() == leaf_index); + + let expected = vec![crate::Event::Dispatch { + message_hash, + leaf_index, + destination_and_nonce, + committed_root, + message: message.to_vec(), + }]; + assert_eq!(events(), expected); + }) } #[test] fn it_rejects_big_message() { use core::convert::TryFrom; - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(|| { - let bounded_res = BoundedVec::::MaxMessageBodyBytes>::try_from( - [1u8; 5001].to_vec(), - ); - assert!(bounded_res.is_err()); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(|| { + let bounded_res = + BoundedVec::::MaxMessageBodyBytes>::try_from([1u8; 5001].to_vec()); + assert!(bounded_res.is_err()); + }) } #[test] fn it_catches_improper_update() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(|| { - let committed_root = Home::base().committed_root; - - // Sign improper update - let fake_root = H256::repeat_byte(9); - let improper_signed = TEST_UPDATER.sign_update(committed_root, fake_root); - - let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); - assert_ok!(Home::improper_update(origin, improper_signed.clone())); - assert!(Home::base().state == NomadState::Failed); - - let expected = vec![ - crate::Event::UpdaterSlashed { - updater: TEST_UPDATER.address(), - reporter: TEST_SENDER_ACCOUNT, - }, - crate::Event::ImproperUpdate { - previous_root: committed_root, - new_root: fake_root, - signature: improper_signed.signature.to_vec(), - }, - ]; - assert_eq!(events(), expected); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(|| { + let committed_root = Home::base().committed_root; + + // Sign improper update + let fake_root = H256::repeat_byte(9); + let improper_signed = TEST_UPDATER.sign_update(committed_root, fake_root); + + let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::improper_update(origin, improper_signed.clone())); + assert!(Home::base().state == NomadState::Failed); + + let expected = vec![ + crate::Event::UpdaterSlashed { + updater: TEST_UPDATER.address(), + reporter: TEST_SENDER_ACCOUNT, + }, + crate::Event::ImproperUpdate { + previous_root: committed_root, + new_root: fake_root, + signature: improper_signed.signature.to_vec(), + }, + ]; + assert_eq!(events(), expected); + }) } /// Dispatch a random message and returns the new `root`. fn dispatch_random_message(origin: RuntimeOrigin) -> H256 { let body = [1u8; 8].to_vec().try_into().unwrap(); - assert_ok!(Home::dispatch( - origin, - TEST_REMOTE_DOMAIN, - TEST_RECIPIENT, - body - )); + assert_ok!(Home::dispatch(origin, TEST_REMOTE_DOMAIN, TEST_RECIPIENT, body)); Home::tree().root() } @@ -136,151 +116,124 @@ fn dispatch_random_message(origin: RuntimeOrigin) -> H256 { #[test_case( 2, 1 => Err(Error::::MaxIndexWitnessExhausted.into()) ; "Max index witness exhausted")] #[test_case( 2, 2 => Ok(()); "Valid update")] fn it_update_max_index_witness(dispatch_messages: usize, max_index: u32) -> DispatchResult { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(move || { - let committed_root = Home::base().committed_root; - - // Dispatch `dispatch_messages` messages and get the latest root. - let sender = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); - let last_root = (0..) - .take(dispatch_messages) - .map(|_| dispatch_random_message(sender.clone())) - .last() - .unwrap_or(committed_root); - - let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); - Home::update(sender, signed_update, max_index) - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(move || { + let committed_root = Home::base().committed_root; + + // Dispatch `dispatch_messages` messages and get the latest root. + let sender = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); + let last_root = (0..) + .take(dispatch_messages) + .map(|_| dispatch_random_message(sender.clone())) + .last() + .unwrap_or(committed_root); + + let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); + Home::update(sender, signed_update, max_index) + }) } #[test] fn it_dispatches_messages_and_accepts_updates() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(move || { - let committed_root = Home::base().committed_root; - - let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); - - // Dispatch 2 messages. - let roots = (0..2) - .map(|_| dispatch_random_message(origin.clone())) - .collect::>(); - let last_root = *roots.last().unwrap(); - - // Get updater signature - let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); - - // Submit signed update - assert_ok!(Home::update(origin.clone(), signed_update.clone(), 3)); - - let expected_update_event = crate::Event::Update { - home_domain: TEST_LOCAL_DOMAIN, - previous_root: committed_root, - new_root: last_root, - signature: signed_update.signature.to_vec(), - }; - assert!(events().contains(&expected_update_event)); - - // Assert mappings are cleared out up to signed_update.new_root() - assert_eq!(Home::base().committed_root, last_root); - for (idx, root) in roots.into_iter().enumerate() { - assert_eq!(Home::index_to_root(idx as u32), None); - assert_eq!(Home::root_to_index(root), None); - } - - // Dispatch third message - let committed_root = Home::base().committed_root; - let root_after_third_msg = dispatch_random_message(origin.clone()); - - // Get updater signature - let signed_update = TEST_UPDATER.sign_update(committed_root, root_after_third_msg); - - // Submit signed update - assert_ok!(Home::update(origin, signed_update.clone(), 3)); - - let expected_update_event = crate::Event::Update { - home_domain: TEST_LOCAL_DOMAIN, - previous_root: committed_root, - new_root: root_after_third_msg, - signature: signed_update.signature.to_vec(), - }; - assert!(events().contains(&expected_update_event)); - - // Assert mappings are cleared out up to signed_update.new_root() - assert!(Home::index_to_root(2).is_none()); - assert!(Home::root_to_index(root_after_third_msg).is_none()); - assert!(Home::base().committed_root == root_after_third_msg); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(move || { + let committed_root = Home::base().committed_root; + + let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); + + // Dispatch 2 messages. + let roots = (0..2).map(|_| dispatch_random_message(origin.clone())).collect::>(); + let last_root = *roots.last().unwrap(); + + // Get updater signature + let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); + + // Submit signed update + assert_ok!(Home::update(origin.clone(), signed_update.clone(), 3)); + + let expected_update_event = crate::Event::Update { + home_domain: TEST_LOCAL_DOMAIN, + previous_root: committed_root, + new_root: last_root, + signature: signed_update.signature.to_vec(), + }; + assert!(events().contains(&expected_update_event)); + + // Assert mappings are cleared out up to signed_update.new_root() + assert_eq!(Home::base().committed_root, last_root); + for (idx, root) in roots.into_iter().enumerate() { + assert_eq!(Home::index_to_root(idx as u32), None); + assert_eq!(Home::root_to_index(root), None); + } + + // Dispatch third message + let committed_root = Home::base().committed_root; + let root_after_third_msg = dispatch_random_message(origin.clone()); + + // Get updater signature + let signed_update = TEST_UPDATER.sign_update(committed_root, root_after_third_msg); + + // Submit signed update + assert_ok!(Home::update(origin, signed_update.clone(), 3)); + + let expected_update_event = crate::Event::Update { + home_domain: TEST_LOCAL_DOMAIN, + previous_root: committed_root, + new_root: root_after_third_msg, + signature: signed_update.signature.to_vec(), + }; + assert!(events().contains(&expected_update_event)); + + // Assert mappings are cleared out up to signed_update.new_root() + assert!(Home::index_to_root(2).is_none()); + assert!(Home::root_to_index(root_after_third_msg).is_none()); + assert!(Home::base().committed_root == root_after_third_msg); + }) } #[test] fn it_rejects_invalid_signature() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(move || { - let committed_root = Home::base().committed_root; - - let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); - // Dispatch message - let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); - assert_ok!(Home::dispatch( - origin.clone(), - TEST_REMOTE_DOMAIN, - TEST_RECIPIENT, - body - )); - - // Get fake updater signature - let new_root = Home::tree().root(); - let signed_update = FAKE_UPDATER.sign_update(committed_root, new_root); - - // Assert err returned from submitting signed update - assert_err!( - Home::update(origin, signed_update, 10), - Error::::InvalidUpdaterSignature - ); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(move || { + let committed_root = Home::base().committed_root; + + let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); + // Dispatch message + let origin = RuntimeOrigin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::dispatch(origin.clone(), TEST_REMOTE_DOMAIN, TEST_RECIPIENT, body)); + + // Get fake updater signature + let new_root = Home::tree().root(); + let signed_update = FAKE_UPDATER.sign_update(committed_root, new_root); + + // Assert err returned from submitting signed update + assert_err!( + Home::update(origin, signed_update, 10), + Error::::InvalidUpdaterSignature + ); + }) } #[test] fn it_longest_tree() { - ExtBuilder::default() - .with_base(*TEST_NOMAD_BASE) - .build() - .execute_with(move || { - use nomad_merkle::TREE_DEPTH; - - let committed_root = Home::base().committed_root; - - let body_len = ::MaxMessageBodyBytes::get() as usize; - let body: BoundedVec = sp_std::iter::repeat(3u8) - .take(body_len) - .collect::>() - .try_into() - .unwrap(); - - let origin = RuntimeOrigin::signed(whitelisted_caller::()); - - for _ in 0..TREE_DEPTH { - assert_ok!(Home::dispatch( - origin.clone(), - 1111, - TEST_RECIPIENT, - body.clone() - )); - } - - let new_root = Home::tree().root(); - let signed_update = TEST_UPDATER.sign_update(committed_root, new_root); - let exp_signed_update = expected_longest_tree_signed_update(); - assert_eq!(new_root, exp_signed_update.update.new_root); - assert_eq!(signed_update, exp_signed_update); - - assert_ok!(Home::update(origin, signed_update, TREE_DEPTH as u32)); - }) + ExtBuilder::default().with_base(*TEST_NOMAD_BASE).build().execute_with(move || { + use nomad_merkle::TREE_DEPTH; + + let committed_root = Home::base().committed_root; + + let body_len = ::MaxMessageBodyBytes::get() as usize; + let body: BoundedVec = + sp_std::iter::repeat(3u8).take(body_len).collect::>().try_into().unwrap(); + + let origin = RuntimeOrigin::signed(whitelisted_caller::()); + + for _ in 0..TREE_DEPTH { + assert_ok!(Home::dispatch(origin.clone(), 1111, TEST_RECIPIENT, body.clone())); + } + + let new_root = Home::tree().root(); + let signed_update = TEST_UPDATER.sign_update(committed_root, new_root); + let exp_signed_update = expected_longest_tree_signed_update(); + assert_eq!(new_root, exp_signed_update.update.new_root); + assert_eq!(signed_update, exp_signed_update); + + assert_ok!(Home::update(origin, signed_update, TREE_DEPTH as u32)); + }) } diff --git a/pallets/bridges/nomad/updater-manager/src/lib.rs b/pallets/bridges/nomad/updater-manager/src/lib.rs index 59a53ce42..1dafcb98c 100644 --- a/pallets/bridges/nomad/updater-manager/src/lib.rs +++ b/pallets/bridges/nomad/updater-manager/src/lib.rs @@ -43,19 +43,16 @@ pub mod pallet { #[pallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { - fn build(&self) { >::put(self.updater); } + fn build(&self) { + >::put(self.updater); + } } #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - NewUpdater { - old_updater: H160, - new_updater: H160, - }, - FakeSlashed { - reporter: T::AccountId, - }, + NewUpdater { old_updater: H160, new_updater: H160 }, + FakeSlashed { reporter: T::AccountId }, } #[pallet::error] @@ -69,16 +66,15 @@ pub mod pallet { impl Pallet {} impl Pallet { - pub fn get_updater() -> H160 { Updater::::get() } + pub fn get_updater() -> H160 { + Updater::::get() + } pub fn set_updater(new_updater: H160) -> DispatchResult { let old_updater = Updater::::get(); Updater::::put(new_updater); - Self::deposit_event(Event::::NewUpdater { - old_updater, - new_updater, - }); + Self::deposit_event(Event::::NewUpdater { old_updater, new_updater }); Ok(()) } diff --git a/pallets/bridges/nomad/updater-manager/src/mock.rs b/pallets/bridges/nomad/updater-manager/src/mock.rs index 34cc96b4c..deb3b2c6b 100644 --- a/pallets/bridges/nomad/updater-manager/src/mock.rs +++ b/pallets/bridges/nomad/updater-manager/src/mock.rs @@ -76,12 +76,14 @@ pub(crate) fn events() -> Vec> { System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| { - if let RuntimeEvent::UpdaterManager(inner) = e { - Some(inner) - } else { - None - } - }) + .filter_map( + |e| { + if let RuntimeEvent::UpdaterManager(inner) = e { + Some(inner) + } else { + None + } + }, + ) .collect::>() } diff --git a/pallets/bridges/nomad/updater-manager/src/tests.rs b/pallets/bridges/nomad/updater-manager/src/tests.rs index b3eff107a..97d9d7796 100644 --- a/pallets/bridges/nomad/updater-manager/src/tests.rs +++ b/pallets/bridges/nomad/updater-manager/src/tests.rs @@ -14,10 +14,7 @@ fn it_sets_updater() { assert_ok!(UpdaterManager::set_updater(new_updater)); assert_eq!(UpdaterManager::get_updater(), new_updater); - let expected = vec![crate::Event::NewUpdater { - old_updater: H160::zero(), - new_updater, - }]; + let expected = vec![crate::Event::NewUpdater { old_updater: H160::zero(), new_updater }]; assert_eq!(events(), expected); }); } diff --git a/pallets/dactr/src/benchmarking.rs b/pallets/dactr/src/benchmarking.rs index 989c77902..100b88306 100644 --- a/pallets/dactr/src/benchmarking.rs +++ b/pallets/dactr/src/benchmarking.rs @@ -151,10 +151,7 @@ where let txs = vec![AppExtrinsic::from(data.to_vec()); nb_tx as usize]; info!("Launching extrinsic with:"); - info!( - "rows: {} - cols: {} - DataLength: {} - Nb Txs: {}", - rows.0, cols.0, data_length, nb_tx - ); + info!("rows: {} - cols: {} - DataLength: {} - Nb Txs: {}", rows.0, cols.0, data_length, nb_tx); (txs, root, block_length, block_number, seed) } diff --git a/pallets/dactr/src/extensions/check_app_id.rs b/pallets/dactr/src/extensions/check_app_id.rs index 3829ca902..0d6d0dcf1 100644 --- a/pallets/dactr/src/extensions/check_app_id.rs +++ b/pallets/dactr/src/extensions/check_app_id.rs @@ -43,7 +43,9 @@ where ::RuntimeCall: IsSubType> + IsSubType>, { /// utility constructor. Used only in client/factory code. - pub fn from(app_id: AppId) -> Self { Self(app_id, sp_std::marker::PhantomData) } + pub fn from(app_id: AppId) -> Self { + Self(app_id, sp_std::marker::PhantomData) + } /// It validates that `AppId` is correct and already registered for the call and potential nested calls. /// Transaction validation: @@ -86,11 +88,9 @@ where } Ok(()) }, - _ => Err(TransactionValidityError::Invalid( - InvalidTransaction::Custom( - InvalidTransactionCustomId::ForbiddenAppId as u8, - ), - )), + _ => Err(TransactionValidityError::Invalid(InvalidTransaction::Custom( + InvalidTransactionCustomId::ForbiddenAppId as u8, + ))), }?; } } @@ -100,7 +100,9 @@ where } impl Default for CheckAppId { - fn default() -> Self { Self(AppId::default(), PhantomData) } + fn default() -> Self { + Self(AppId::default(), PhantomData) + } } impl Debug for CheckAppId @@ -108,10 +110,14 @@ where T: DAConfig + UtilityConfig + Send + Sync, { #[cfg(feature = "std")] - fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "CheckAppId: {}", self.0) } + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "CheckAppId: {}", self.0) + } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut Formatter) -> fmt::Result { Ok(()) } + fn fmt(&self, _: &mut Formatter) -> fmt::Result { + Ok(()) + } } impl SignedExtension for CheckAppId @@ -158,7 +164,9 @@ where T: DAConfig + UtilityConfig + Send + Sync, { #[inline] - fn app_id(&self) -> AppId { self.0 } + fn app_id(&self) -> AppId { + self.0 + } } #[cfg(test)] @@ -175,33 +183,27 @@ mod tests { pallet::Call as DACall, }; - fn remark_call() -> RuntimeCall { RuntimeCall::System(SysCall::remark { remark: vec![] }) } + fn remark_call() -> RuntimeCall { + RuntimeCall::System(SysCall::remark { remark: vec![] }) + } fn submit_data_call() -> RuntimeCall { - RuntimeCall::DataAvailability(DACall::submit_data { - data: vec![].try_into().unwrap(), - }) + RuntimeCall::DataAvailability(DACall::submit_data { data: vec![].try_into().unwrap() }) } fn batch_submit_call() -> RuntimeCall { let call = submit_data_call(); - RuntimeCall::Utility(UtilityCall::batch { - calls: vec![call.clone(), call.clone(), call], - }) + RuntimeCall::Utility(UtilityCall::batch { calls: vec![call.clone(), call.clone(), call] }) } fn batch_mixed_call() -> RuntimeCall { let call = submit_data_call(); let remark = remark_call(); - RuntimeCall::Utility(UtilityCall::batch { - calls: vec![remark, call.clone(), call], - }) + RuntimeCall::Utility(UtilityCall::batch { calls: vec![remark, call.clone(), call] }) } fn to_invalid_tx(custom_id: InvalidTransactionCustomId) -> TransactionValidity { - Err(TransactionValidityError::Invalid( - InvalidTransaction::Custom(custom_id as u8), - )) + Err(TransactionValidityError::Invalid(InvalidTransaction::Custom(custom_id as u8))) } #[test_case(100, submit_data_call() => to_invalid_tx(InvalidAppId); "100 AppId is invalid" )] diff --git a/pallets/dactr/src/lib.rs b/pallets/dactr/src/lib.rs index cffa061f8..7c2d6161a 100644 --- a/pallets/dactr/src/lib.rs +++ b/pallets/dactr/src/lib.rs @@ -109,10 +109,7 @@ pub mod pallet { ensure!(key_info.is_none(), Error::::AppKeyAlreadyExists); let id = Self::next_application_id()?; - *key_info = Some(AppKeyInfo { - id, - owner: owner.clone(), - }); + *key_info = Some(AppKeyInfo { id, owner: owner.clone() }); Ok(id) })?; @@ -228,11 +225,7 @@ pub mod pallet { impl BuildGenesisConfig for GenesisConfig { fn build(&self) { // Ensure app ids are unique. - let mut ids = self - .app_keys - .iter() - .map(|(_, info)| info.id) - .collect::>(); + let mut ids = self.app_keys.iter().map(|(_, info)| info.id).collect::>(); ids.sort_unstable(); ids.dedup(); if ids.len() != self.app_keys.len() { diff --git a/pallets/dactr/src/mock.rs b/pallets/dactr/src/mock.rs index f24bd654f..b5bcbb2ad 100644 --- a/pallets/dactr/src/mock.rs +++ b/pallets/dactr/src/mock.rs @@ -139,9 +139,7 @@ impl da_control::Config for Test { /// Create new externalities for `System` module tests. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::::default() - .build_storage() - .unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(1, 10_000 * AVL), (2, 5_000 * AVL), (3, 1_000 * AVL)], @@ -152,18 +150,9 @@ pub fn new_test_ext() -> sp_io::TestExternalities { da_control::GenesisConfig:: { _config: Default::default(), app_keys: vec![ - (b"Data Avail".to_vec(), AppKeyInfo { - owner: 1, - id: AppId(0), - }), - (b"Ethereum".to_vec(), AppKeyInfo { - owner: 2, - id: AppId(1), - }), - (b"Polygon".to_vec(), AppKeyInfo { - owner: 2, - id: AppId(2), - }), + (b"Data Avail".to_vec(), AppKeyInfo { owner: 1, id: AppId(0) }), + (b"Ethereum".to_vec(), AppKeyInfo { owner: 2, id: AppId(1) }), + (b"Polygon".to_vec(), AppKeyInfo { owner: 2, id: AppId(2) }), ], } .assimilate_storage(&mut storage) diff --git a/pallets/dactr/src/tests.rs b/pallets/dactr/src/tests.rs index 0ef4f4147..86f7d7062 100644 --- a/pallets/dactr/src/tests.rs +++ b/pallets/dactr/src/tests.rs @@ -25,16 +25,10 @@ mod create_application_key { let new_key = AppKeyFor::::try_from(b"New App".to_vec()).unwrap(); assert_eq!(DataAvailability::application_key(&new_key), None); - assert_ok!(DataAvailability::create_application_key( - alice, - new_key.clone() - )); + assert_ok!(DataAvailability::create_application_key(alice, new_key.clone())); assert_eq!( DataAvailability::application_key(&new_key), - Some(AppKeyInfoFor:: { - id: new_id, - owner: ALICE - }) + Some(AppKeyInfoFor:: { id: new_id, owner: ALICE }) ); let event = RuntimeEvent::DataAvailability(Event::ApplicationKeyCreated { @@ -63,10 +57,7 @@ mod create_application_key { let alice: RuntimeOrigin = RawOrigin::Signed(ALICE).into(); let new_key = AppKeyFor::::try_from(b"New App".to_vec()).unwrap(); - assert_ok!(DataAvailability::create_application_key( - alice.clone(), - new_key.clone() - )); + assert_ok!(DataAvailability::create_application_key(alice.clone(), new_key.clone())); let err = DataAvailability::create_application_key(alice, new_key); assert_noop!(err, Error::AppKeyAlreadyExists); @@ -123,9 +114,7 @@ mod submit_block_length_proposal { let rows = BlockLengthRows(128); let cols = BlockLengthColumns(128); - assert_ok!(DataAvailability::submit_block_length_proposal( - root, rows.0, cols.0 - )); + assert_ok!(DataAvailability::submit_block_length_proposal(root, rows.0, cols.0)); let dynamic_block_length = System::block_length(); let new_block_length = @@ -146,9 +135,7 @@ mod submit_block_length_proposal { let rows = MinBlockRows::get(); let cols = MinBlockCols::get(); - assert_ok!(DataAvailability::submit_block_length_proposal( - root, rows.0, cols.0 - )); + assert_ok!(DataAvailability::submit_block_length_proposal(root, rows.0, cols.0)); let dynamic_block_length = System::block_length(); let new_block_length = @@ -169,9 +156,7 @@ mod submit_block_length_proposal { let rows = MaxBlockRows::get(); let cols = MaxBlockCols::get(); - assert_ok!(DataAvailability::submit_block_length_proposal( - root, rows.0, cols.0 - )); + assert_ok!(DataAvailability::submit_block_length_proposal(root, rows.0, cols.0)); let dynamic_block_length = System::block_length(); let new_block_length = diff --git a/pallets/executive/src/lib.rs b/pallets/executive/src/lib.rs index 3f137c472..fae8b070b 100644 --- a/pallets/executive/src/lib.rs +++ b/pallets/executive/src/lib.rs @@ -316,17 +316,10 @@ where // the state root check. { let new_header = >::finalize(); - let items_zip = header - .digest() - .logs() - .iter() - .zip(new_header.digest().logs().iter()); + let items_zip = header.digest().logs().iter().zip(new_header.digest().logs().iter()); for (header_item, computed_item) in items_zip { header_item.check_equal(computed_item); - assert!( - header_item == computed_item, - "Digest item must match that calculated." - ); + assert!(header_item == computed_item, "Digest item must match that calculated."); } if state_root_check { @@ -617,26 +610,16 @@ where new_header.digest().logs().len(), "Number of digest items must match that calculated." ); - let items_zip = header - .digest() - .logs() - .iter() - .zip(new_header.digest().logs().iter()); + let items_zip = header.digest().logs().iter().zip(new_header.digest().logs().iter()); for (header_item, computed_item) in items_zip { header_item.check_equal(computed_item); - assert!( - header_item == computed_item, - "Digest item must match that calculated." - ); + assert!(header_item == computed_item, "Digest item must match that calculated."); } // check storage root. let storage_root = new_header.state_root(); header.state_root().check_equal(storage_root); - assert!( - header.state_root() == storage_root, - "Storage root must match that calculated." - ); + assert!(header.state_root() == storage_root, "Storage root must match that calculated."); assert!( header.extrinsics_root() == new_header.extrinsics_root(), diff --git a/pallets/mandate/src/lib.rs b/pallets/mandate/src/lib.rs index 4dc2e7067..2a7b08bda 100644 --- a/pallets/mandate/src/lib.rs +++ b/pallets/mandate/src/lib.rs @@ -58,9 +58,7 @@ pub mod pallet { T::ApprovedOrigin::ensure_origin(origin)?; let res = call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()); - Self::deposit_event(Event::RootOp { - result: res.map(|_| ()).map_err(|e| e.error), - }); + Self::deposit_event(Event::RootOp { result: res.map(|_| ()).map_err(|e| e.error) }); // Sudo user does not pay a fee. Ok(Pays::No.into()) diff --git a/pallets/mandate/src/mock.rs b/pallets/mandate/src/mock.rs index 788c18d78..71e199daf 100644 --- a/pallets/mandate/src/mock.rs +++ b/pallets/mandate/src/mock.rs @@ -107,9 +107,7 @@ where /// Create new externalities for `Mandate` module tests. pub fn new_test_ext() -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::::default() - .build_storage() - .unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); ext diff --git a/pallets/mandate/src/tests.rs b/pallets/mandate/src/tests.rs index 65f665cbc..f3acb92e8 100644 --- a/pallets/mandate/src/tests.rs +++ b/pallets/mandate/src/tests.rs @@ -47,12 +47,7 @@ fn mandate_can_be_called_with_technical_committee() { // Making Alice the only members of TC let sudo = RuntimeOrigin::from(RawOrigin::Root); - assert_ok!(TechnicalCommittee::set_members( - sudo, - [ALICE].to_vec(), - None, - 0 - )); + assert_ok!(TechnicalCommittee::set_members(sudo, [ALICE].to_vec(), None, 0)); // Create Proposal let new_members = [ALICE, BOB].to_vec(); @@ -99,9 +94,6 @@ fn mandate_can_not_be_called_with_normal_signed_origins() { // The Call let o = RuntimeOrigin::from(RawOrigin::Signed(ALICE)); - assert_noop!( - Mandate::mandate(o, call), - sp_runtime::DispatchError::BadOrigin - ); + assert_noop!(Mandate::mandate(o, call), sp_runtime::DispatchError::BadOrigin); }); } diff --git a/pallets/system/benches/bench.rs b/pallets/system/benches/bench.rs index f8ed80bcb..2ade51f34 100644 --- a/pallets/system/benches/bench.rs +++ b/pallets/system/benches/bench.rs @@ -126,9 +126,7 @@ fn deposit_events(n: usize) { } fn sr_system_benchmark(c: &mut Criterion) { - c.bench_function("deposit 100 events", |b| { - b.iter(|| deposit_events(black_box(100))) - }); + c.bench_function("deposit 100 events", |b| b.iter(|| deposit_events(black_box(100)))); } criterion_group!(benches, sr_system_benchmark); diff --git a/pallets/system/benchmarking/src/mock.rs b/pallets/system/benchmarking/src/mock.rs index 559f374ca..55c5f8ce3 100644 --- a/pallets/system/benchmarking/src/mock.rs +++ b/pallets/system/benchmarking/src/mock.rs @@ -100,9 +100,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { }; let mut ext = sp_io::TestExternalities::new(t); let read_runtime_version = MockedReadRuntimeVersion(version.encode()); - ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new( - read_runtime_version, - )); + ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(read_runtime_version)); ext } diff --git a/pallets/system/src/extensions/check_genesis.rs b/pallets/system/src/extensions/check_genesis.rs index aa0f4e626..155ff8d0f 100644 --- a/pallets/system/src/extensions/check_genesis.rs +++ b/pallets/system/src/extensions/check_genesis.rs @@ -41,13 +41,17 @@ impl sp_std::fmt::Debug for CheckGenesis { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl CheckGenesis { /// Creates new `SignedExtension` to check genesis hash. #[allow(clippy::new_without_default)] - pub fn new() -> Self { Self(sp_std::marker::PhantomData) } + pub fn new() -> Self { + Self(sp_std::marker::PhantomData) + } } impl SignedExtension for CheckGenesis { diff --git a/pallets/system/src/extensions/check_mortality.rs b/pallets/system/src/extensions/check_mortality.rs index f0f9b97ab..46cb1be0d 100644 --- a/pallets/system/src/extensions/check_mortality.rs +++ b/pallets/system/src/extensions/check_mortality.rs @@ -38,7 +38,9 @@ pub struct CheckMortality(pub Era, sp_std::marker::Phan impl CheckMortality { /// utility constructor. Used only in client/factory code. - pub fn from(era: Era) -> Self { Self(era, sp_std::marker::PhantomData) } + pub fn from(era: Era) -> Self { + Self(era, sp_std::marker::PhantomData) + } } impl sp_std::fmt::Debug for CheckMortality { @@ -48,7 +50,9 @@ impl sp_std::fmt::Debug for CheckMortality { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl SignedExtension for CheckMortality { @@ -76,10 +80,7 @@ impl SignedExtension for CheckMortality { fn additional_signed(&self) -> Result { let current_u64 = >::block_number().saturated_into::(); - let n = self - .0 - .birth(current_u64) - .saturated_into::>(); + let n = self.0.birth(current_u64).saturated_into::>(); if !>::contains_key(n) { Err(InvalidTransaction::AncientBirthBlock.into()) } else { @@ -124,9 +125,7 @@ mod tests { // correct System::set_block_number(13); >::insert(12, H256::repeat_byte(1)); - assert!(CheckMortality::::from(Era::mortal(4, 12)) - .additional_signed() - .is_ok()); + assert!(CheckMortality::::from(Era::mortal(4, 12)).additional_signed().is_ok()); }) } diff --git a/pallets/system/src/extensions/check_non_zero_sender.rs b/pallets/system/src/extensions/check_non_zero_sender.rs index f2a7c3d72..b808a46a6 100644 --- a/pallets/system/src/extensions/check_non_zero_sender.rs +++ b/pallets/system/src/extensions/check_non_zero_sender.rs @@ -40,13 +40,17 @@ impl sp_std::fmt::Debug for CheckNonZeroSender { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl CheckNonZeroSender { /// Create new `SignedExtension` to check runtime version. #[allow(clippy::new_without_default)] - pub fn new() -> Self { Self(sp_std::marker::PhantomData) } + pub fn new() -> Self { + Self(sp_std::marker::PhantomData) + } } impl SignedExtension for CheckNonZeroSender @@ -60,7 +64,9 @@ where const IDENTIFIER: &'static str = "CheckNonZeroSender"; - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) } + fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { + Ok(()) + } fn pre_dispatch( self, @@ -80,9 +86,7 @@ where _len: usize, ) -> TransactionValidity { if who.using_encoded(|d| d.iter().all(|x| *x == 0)) { - return Err(TransactionValidityError::Invalid( - InvalidTransaction::BadSigner, - )); + return Err(TransactionValidityError::Invalid(InvalidTransaction::BadSigner)); } Ok(ValidTransaction::default()) } diff --git a/pallets/system/src/extensions/check_nonce.rs b/pallets/system/src/extensions/check_nonce.rs index bea3bc235..622305e25 100644 --- a/pallets/system/src/extensions/check_nonce.rs +++ b/pallets/system/src/extensions/check_nonce.rs @@ -42,7 +42,9 @@ pub struct CheckNonce(#[codec(compact)] pub T::Nonce); impl CheckNonce { /// utility constructor. Used only in client/factory code. - pub fn from(nonce: T::Nonce) -> Self { Self(nonce) } + pub fn from(nonce: T::Nonce) -> Self { + Self(nonce) + } } impl sp_std::fmt::Debug for CheckNonce { @@ -52,7 +54,9 @@ impl sp_std::fmt::Debug for CheckNonce { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl SignedExtension for CheckNonce @@ -66,7 +70,9 @@ where const IDENTIFIER: &'static str = "CheckNonce"; - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) } + fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { + Ok(()) + } fn pre_dispatch( self, @@ -129,13 +135,16 @@ mod tests { #[test] fn signed_ext_check_nonce_works() { new_test_ext().execute_with(|| { - crate::Account::::insert(1, crate::AccountInfo { - nonce: 1, - consumers: 0, - providers: 0, - sufficients: 0, - data: 0, - }); + crate::Account::::insert( + 1, + crate::AccountInfo { + nonce: 1, + consumers: 0, + providers: 0, + sufficients: 0, + data: 0, + }, + ); let info = DispatchInfo::default(); let len = 0_usize; // stale diff --git a/pallets/system/src/extensions/check_spec_version.rs b/pallets/system/src/extensions/check_spec_version.rs index 7057051ad..f46a02c62 100644 --- a/pallets/system/src/extensions/check_spec_version.rs +++ b/pallets/system/src/extensions/check_spec_version.rs @@ -41,13 +41,17 @@ impl sp_std::fmt::Debug for CheckSpecVersion { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl CheckSpecVersion { /// Create new `SignedExtension` to check runtime version. #[allow(clippy::new_without_default)] - pub fn new() -> Self { Self(sp_std::marker::PhantomData) } + pub fn new() -> Self { + Self(sp_std::marker::PhantomData) + } } impl SignedExtension for CheckSpecVersion { diff --git a/pallets/system/src/extensions/check_tx_version.rs b/pallets/system/src/extensions/check_tx_version.rs index f5566054a..6d7f74f2a 100644 --- a/pallets/system/src/extensions/check_tx_version.rs +++ b/pallets/system/src/extensions/check_tx_version.rs @@ -41,13 +41,17 @@ impl sp_std::fmt::Debug for CheckTxVersion { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } impl CheckTxVersion { /// Create new `SignedExtension` to check transaction version. #[allow(clippy::new_without_default)] - pub fn new() -> Self { Self(sp_std::marker::PhantomData) } + pub fn new() -> Self { + Self(sp_std::marker::PhantomData) + } } impl SignedExtension for CheckTxVersion { diff --git a/pallets/system/src/extensions/check_weight.rs b/pallets/system/src/extensions/check_weight.rs index af9cfe37b..7d483fcb3 100644 --- a/pallets/system/src/extensions/check_weight.rs +++ b/pallets/system/src/extensions/check_weight.rs @@ -129,7 +129,9 @@ where } /// Creates new `SignedExtension` to check weight of the extrinsic. - pub fn new() -> Self { Self(Default::default()) } + pub fn new() -> Self { + Self(Default::default()) + } /// Do the pre-dispatch checks. This can be applied to both signed and unsigned. /// @@ -170,9 +172,8 @@ pub fn calculate_consumed_weight( where Call: Dispatchable, { - let extrinsic_weight = info - .weight - .saturating_add(maximum_weight.get(info.class).base_extrinsic); + let extrinsic_weight = + info.weight.saturating_add(maximum_weight.get(info.class).base_extrinsic); let limit_per_class = maximum_weight.get(info.class); // add the weight. If class is unlimited, use saturating add instead of checked one. @@ -224,7 +225,9 @@ where const IDENTIFIER: &'static str = "CheckWeight"; - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) } + fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { + Ok(()) + } fn pre_dispatch( self, @@ -287,7 +290,9 @@ impl sp_std::fmt::Debug for CheckWeight { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } } #[cfg(test)] @@ -317,12 +322,12 @@ mod tests { .unwrap_or_else(|| block_weights().max_block) } - fn block_weight_limit() -> Weight { block_weights().max_block } + fn block_weight_limit() -> Weight { + block_weights().max_block + } fn normal_length_limit() -> u32 { - *::BlockLength::get() - .max - .get(DispatchClass::Normal) + *::BlockLength::get().max.get(DispatchClass::Normal) } #[test] @@ -354,10 +359,8 @@ mod tests { fn normal_extrinsic_limited_by_maximum_extrinsic_weight() { new_test_ext().execute_with(|| { let max = DispatchInfo { - weight: block_weights() - .get(DispatchClass::Normal) - .max_extrinsic - .unwrap() + Weight::from_parts(1, 0), + weight: block_weights().get(DispatchClass::Normal).max_extrinsic.unwrap() + + Weight::from_parts(1, 0), class: DispatchClass::Normal, ..Default::default() }; @@ -380,11 +383,8 @@ mod tests { let base_weight = weights.get(DispatchClass::Operational).base_extrinsic; let weight = operational_limit - base_weight; - let okay = DispatchInfo { - weight, - class: DispatchClass::Operational, - ..Default::default() - }; + let okay = + DispatchInfo { weight, class: DispatchClass::Operational, ..Default::default() }; let max = DispatchInfo { weight: weight + Weight::from_parts(1, 0), class: DispatchClass::Operational, @@ -392,10 +392,7 @@ mod tests { }; let len = 0_usize; - assert_eq!( - CheckWeight::::do_validate(&okay, len), - Ok(Default::default()) - ); + assert_eq!(CheckWeight::::do_validate(&okay, len), Ok(Default::default())); assert_err!( CheckWeight::::do_validate(&max, len), InvalidTransaction::ExhaustsResources @@ -420,10 +417,8 @@ mod tests { // 10 is taken for block execution weight // So normal extrinsic can be 758 weight (-5 for base extrinsic weight) // And Operational can be 246 to produce a full block (-10 for base) - let max_normal = DispatchInfo { - weight: Weight::from_parts(753, 0), - ..Default::default() - }; + let max_normal = + DispatchInfo { weight: Weight::from_parts(753, 0), ..Default::default() }; let rest_operational = DispatchInfo { weight: Weight::from_parts(246, 0), class: DispatchClass::Operational, @@ -436,15 +431,9 @@ mod tests { assert_eq!(System::block_weight().total(), Weight::from_parts(768, 0)); assert_ok!(CheckWeight::::do_pre_dispatch(&rest_operational, len)); assert_eq!(block_weight_limit(), Weight::from_parts(1024, u64::MAX)); - assert_eq!( - System::block_weight().total(), - block_weight_limit().set_proof_size(0) - ); + assert_eq!(System::block_weight().total(), block_weight_limit().set_proof_size(0)); // Checking single extrinsic should not take current block weight into account. - assert_eq!( - CheckWeight::::check_extrinsic_weight(&rest_operational), - Ok(()) - ); + assert_eq!(CheckWeight::::check_extrinsic_weight(&rest_operational), Ok(())); }); } @@ -452,10 +441,8 @@ mod tests { fn dispatch_order_does_not_effect_weight_logic() { new_test_ext().execute_with(|| { // We switch the order of `full_block_with_normal_and_operational` - let max_normal = DispatchInfo { - weight: Weight::from_parts(753, 0), - ..Default::default() - }; + let max_normal = + DispatchInfo { weight: Weight::from_parts(753, 0), ..Default::default() }; let rest_operational = DispatchInfo { weight: Weight::from_parts(246, 0), class: DispatchClass::Operational, @@ -469,10 +456,7 @@ mod tests { assert_eq!(System::block_weight().total(), Weight::from_parts(266, 0)); assert_ok!(CheckWeight::::do_pre_dispatch(&max_normal, len)); assert_eq!(block_weight_limit(), Weight::from_parts(1024, u64::MAX)); - assert_eq!( - System::block_weight().total(), - block_weight_limit().set_proof_size(0) - ); + assert_eq!(System::block_weight().total(), block_weight_limit().set_proof_size(0)); }); } @@ -499,30 +483,21 @@ mod tests { ); // Thank goodness we can still do an operational transaction to possibly save the // blockchain. - assert_ok!(CheckWeight::::do_pre_dispatch( - &dispatch_operational, - len - )); + assert_ok!(CheckWeight::::do_pre_dispatch(&dispatch_operational, len)); // Not too much though assert_err!( CheckWeight::::do_pre_dispatch(&dispatch_operational, len), InvalidTransaction::ExhaustsResources ); // Even with full block, validity of single transaction should be correct. - assert_eq!( - CheckWeight::::check_extrinsic_weight(&dispatch_operational), - Ok(()) - ); + assert_eq!(CheckWeight::::check_extrinsic_weight(&dispatch_operational), Ok(())); }); } #[test] fn signed_ext_check_weight_works_operational_tx() { new_test_ext().execute_with(|| { - let normal = DispatchInfo { - weight: Weight::from_parts(100, 0), - ..Default::default() - }; + let normal = DispatchInfo { weight: Weight::from_parts(100, 0), ..Default::default() }; let op = DispatchInfo { weight: Weight::from_parts(100, 0), class: DispatchClass::Operational, @@ -592,15 +567,10 @@ mod tests { fn signed_ext_check_weight_works_normal_tx() { new_test_ext().execute_with(|| { let normal_limit = normal_weight_limit(); - let small = DispatchInfo { - weight: Weight::from_parts(100, 0), - ..Default::default() - }; + let small = DispatchInfo { weight: Weight::from_parts(100, 0), ..Default::default() }; let base_extrinsic = block_weights().get(DispatchClass::Normal).base_extrinsic; - let medium = DispatchInfo { - weight: normal_limit - base_extrinsic, - ..Default::default() - }; + let medium = + DispatchInfo { weight: normal_limit - base_extrinsic, ..Default::default() }; let big = DispatchInfo { weight: normal_limit - base_extrinsic + Weight::from_parts(1, 0), ..Default::default() @@ -629,10 +599,7 @@ mod tests { fn signed_ext_check_weight_refund_works() { new_test_ext().execute_with(|| { // This is half of the max block weight - let info = DispatchInfo { - weight: Weight::from_parts(512, 0), - ..Default::default() - }; + let info = DispatchInfo { weight: Weight::from_parts(512, 0), ..Default::default() }; let post_info = PostDispatchInfo { actual_weight: Some(Weight::from_parts(128, 0)), pays_fee: Default::default(), @@ -643,15 +610,11 @@ mod tests { // We allow 75% for normal transaction, so we put 25% - extrinsic base weight BlockWeight::::mutate(|current_weight| { current_weight.set(Weight::zero(), DispatchClass::Mandatory); - current_weight.set( - Weight::from_parts(256, 0) - base_extrinsic, - DispatchClass::Normal, - ); + current_weight + .set(Weight::from_parts(256, 0) - base_extrinsic, DispatchClass::Normal); }); - let pre = CheckWeight::(PhantomData) - .pre_dispatch(&1, CALL, &info, len) - .unwrap(); + let pre = CheckWeight::(PhantomData).pre_dispatch(&1, CALL, &info, len).unwrap(); assert_eq!( BlockWeight::::get().total(), info.weight + Weight::from_parts(256, 0) @@ -674,10 +637,7 @@ mod tests { #[test] fn signed_ext_check_weight_actual_weight_higher_than_max_is_capped() { new_test_ext().execute_with(|| { - let info = DispatchInfo { - weight: Weight::from_parts(512, 0), - ..Default::default() - }; + let info = DispatchInfo { weight: Weight::from_parts(512, 0), ..Default::default() }; let post_info = PostDispatchInfo { actual_weight: Some(Weight::from_parts(700, 0)), pays_fee: Default::default(), @@ -689,9 +649,7 @@ mod tests { current_weight.set(Weight::from_parts(128, 0), DispatchClass::Normal); }); - let pre = CheckWeight::(PhantomData) - .pre_dispatch(&1, CALL, &info, len) - .unwrap(); + let pre = CheckWeight::(PhantomData).pre_dispatch(&1, CALL, &info, len).unwrap(); assert_eq!( BlockWeight::::get().total(), info.weight @@ -719,10 +677,7 @@ mod tests { fn zero_weight_extrinsic_still_has_base_weight() { new_test_ext().execute_with(|| { let weights = block_weights(); - let free = DispatchInfo { - weight: Weight::zero(), - ..Default::default() - }; + let free = DispatchInfo { weight: Weight::zero(), ..Default::default() }; let len = 0_usize; // Initial weight from `weights.base_block` @@ -741,10 +696,8 @@ mod tests { // Max block is 1024 // Max normal is 768 (75%) // Max mandatory is unlimited - let max_normal = DispatchInfo { - weight: Weight::from_parts(753, 0), - ..Default::default() - }; + let max_normal = + DispatchInfo { weight: Weight::from_parts(753, 0), ..Default::default() }; let mandatory = DispatchInfo { weight: Weight::from_parts(1019, 0), class: DispatchClass::Mandatory, @@ -757,14 +710,8 @@ mod tests { assert_eq!(System::block_weight().total(), Weight::from_parts(768, 0)); assert_ok!(CheckWeight::::do_pre_dispatch(&mandatory, len)); assert_eq!(block_weight_limit(), Weight::from_parts(1024, u64::MAX)); - assert_eq!( - System::block_weight().total(), - Weight::from_parts(1024 + 768, 0) - ); - assert_eq!( - CheckWeight::::check_extrinsic_weight(&mandatory), - Ok(()) - ); + assert_eq!(System::block_weight().total(), Weight::from_parts(1024 + 768, 0)); + assert_eq!(CheckWeight::::check_extrinsic_weight(&mandatory), Ok(())); }); } @@ -788,10 +735,7 @@ mod tests { DispatchClass::Operational => Weight::from_parts(10, 0), DispatchClass::Mandatory => Weight::zero(), }); - assert_eq!( - maximum_weight.max_block, - all_weight.total().set_proof_size(u64::MAX) - ); + assert_eq!(maximum_weight.max_block, all_weight.total().set_proof_size(u64::MAX)); // fits into reserved let mandatory1 = DispatchInfo { diff --git a/pallets/system/src/header_builder.rs b/pallets/system/src/header_builder.rs index e683d6b30..2f62ab2d4 100644 --- a/pallets/system/src/header_builder.rs +++ b/pallets/system/src/header_builder.rs @@ -153,30 +153,18 @@ pub fn build_extension( corrupt_commitment(_block_number, &mut kate.commitment); } - v2::HeaderExtension { - commitment: kate, - app_lookup, - } - .into() + v2::HeaderExtension { commitment: kate, app_lookup }.into() } else { #[allow(unused_mut)] - let mut kate = avail_core::kate_commitment::v1::KateCommitment { - rows, - cols, - commitment, - data_root, - }; + let mut kate = + avail_core::kate_commitment::v1::KateCommitment { rows, cols, commitment, data_root }; #[cfg(feature = "header_commitment_corruption")] if _block_number > 20 { corrupt_commitment(_block_number, &mut kate.commitment); } - v1::HeaderExtension { - commitment: kate, - app_lookup, - } - .into() + v1::HeaderExtension { commitment: kate, app_lookup }.into() } } @@ -194,14 +182,7 @@ pub trait HostedHeaderBuilder { seed: Seed, ) -> HeaderExtension { let metrics = avail_base::metrics::MetricAdapter {}; - build_extension( - &app_extrinsics, - data_root, - block_length, - block_number, - seed, - &metrics, - ) + build_extension(&app_extrinsics, data_root, block_length, block_number, seed, &metrics) } /* diff --git a/pallets/system/src/lib.rs b/pallets/system/src/lib.rs index a001de04b..4aefea4ca 100644 --- a/pallets/system/src/lib.rs +++ b/pallets/system/src/lib.rs @@ -191,15 +191,23 @@ pub trait ConsumerLimits { } impl ConsumerLimits for ConstU32 { - fn max_consumers() -> RefCount { Z } + fn max_consumers() -> RefCount { + Z + } - fn max_overflow() -> RefCount { Z } + fn max_overflow() -> RefCount { + Z + } } impl, MaxOverflow: Get> ConsumerLimits for (MaxNormal, MaxOverflow) { - fn max_consumers() -> RefCount { MaxNormal::get() } + fn max_consumers() -> RefCount { + MaxNormal::get() + } - fn max_overflow() -> RefCount { MaxOverflow::get() } + fn max_overflow() -> RefCount { + MaxOverflow::get() + } } #[derive(Clone, Encode, Decode, TypeInfo, MaxEncodedLen)] pub struct ExtrinsicLen { @@ -209,10 +217,7 @@ pub struct ExtrinsicLen { impl Default for ExtrinsicLen { fn default() -> Self { - Self { - raw: <_>::default(), - padded: BLOCK_CHUNK_SIZE.get(), - } + Self { raw: <_>::default(), padded: BLOCK_CHUNK_SIZE.get() } } } @@ -396,9 +401,7 @@ pub mod pallet { #[cfg(feature = "std")] fn integrity_test() { sp_io::TestExternalities::default().execute_with(|| { - T::BlockWeights::get() - .validate() - .expect("The weights are invalid."); + T::BlockWeights::get().validate().expect("The weights are invalid."); }); } } @@ -526,10 +529,7 @@ pub mod pallet { /// An extrinsic completed successfully. ExtrinsicSuccess { dispatch_info: DispatchInfo }, /// An extrinsic failed. - ExtrinsicFailed { - dispatch_error: DispatchError, - dispatch_info: DispatchInfo, - }, + ExtrinsicFailed { dispatch_error: DispatchError, dispatch_info: DispatchInfo }, /// `:code` was updated. CodeUpdated, /// A new account was created. @@ -731,7 +731,9 @@ pub enum Phase { } impl Default for Phase { - fn default() -> Self { Self::Initialization } + fn default() -> Self { + Self::Initialization + } } /// Record of an event happening. @@ -802,10 +804,7 @@ impl LastRuntimeUpgradeInfo { impl From for LastRuntimeUpgradeInfo { fn from(version: sp_version::RuntimeVersion) -> Self { - Self { - spec_version: version.spec_version.into(), - spec_name: version.spec_name, - } + Self { spec_version: version.spec_version.into(), spec_name: version.spec_name } } } @@ -824,7 +823,9 @@ impl, O>> + From>, Acco } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { Ok(O::from(RawOrigin::Root)) } + fn try_successful_origin() -> Result { + Ok(O::from(RawOrigin::Root)) + } } impl_ensure_origin_with_arg_ignoring_arg! { @@ -853,7 +854,9 @@ impl< } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { Ok(O::from(RawOrigin::Root)) } + fn try_successful_origin() -> Result { + Ok(O::from(RawOrigin::Root)) + } } impl_ensure_origin_with_arg_ignoring_arg! { @@ -881,7 +884,9 @@ impl< } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { Ensure::try_successful_origin() } + fn try_successful_origin() -> Result { + Ensure::try_successful_origin() + } } impl_ensure_origin_with_arg_ignoring_arg! { @@ -963,7 +968,9 @@ impl, O>> + From>, Acco } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { Ok(O::from(RawOrigin::None)) } + fn try_successful_origin() -> Result { + Ok(O::from(RawOrigin::None)) + } } impl_ensure_origin_with_arg_ignoring_arg! { @@ -977,10 +984,14 @@ pub struct EnsureNever(sp_std::marker::PhantomData); impl EnsureOrigin for EnsureNever { type Success = Success; - fn try_origin(o: O) -> Result { Err(o) } + fn try_origin(o: O) -> Result { + Err(o) + } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { Err(()) } + fn try_successful_origin() -> Result { + Err(()) + } } impl_ensure_origin_with_arg_ignoring_arg! { @@ -1065,7 +1076,9 @@ pub enum DecRefStatus { } impl Pallet { - pub fn account_exists(who: &T::AccountId) -> bool { Account::::contains_key(who) } + pub fn account_exists(who: &T::AccountId) -> bool { + Account::::contains_key(who) + } /// Write code to the storage and emit related events and digest items. /// @@ -1081,20 +1094,28 @@ impl Pallet { /// Increment the reference counter on an account. #[deprecated = "Use `inc_consumers` instead"] - pub fn inc_ref(who: &T::AccountId) { let _ = Self::inc_consumers(who); } + pub fn inc_ref(who: &T::AccountId) { + let _ = Self::inc_consumers(who); + } /// Decrement the reference counter on an account. This *MUST* only be done once for every time /// you called `inc_consumers` on `who`. #[deprecated = "Use `dec_consumers` instead"] - pub fn dec_ref(who: &T::AccountId) { Self::dec_consumers(who); } + pub fn dec_ref(who: &T::AccountId) { + Self::dec_consumers(who); + } /// The number of outstanding references for the account `who`. #[deprecated = "Use `consumers` instead"] - pub fn refs(who: &T::AccountId) -> RefCount { Self::consumers(who) } + pub fn refs(who: &T::AccountId) -> RefCount { + Self::consumers(who) + } /// True if the account has no outstanding references. #[deprecated = "Use `!is_provider_required` instead"] - pub fn allow_death(who: &T::AccountId) -> bool { !Self::is_provider_required(who) } + pub fn allow_death(who: &T::AccountId) -> bool { + !Self::is_provider_required(who) + } /// Increment the provider reference counter on an account. pub fn inc_providers(who: &T::AccountId) -> IncRefStatus { @@ -1204,10 +1225,14 @@ impl Pallet { } /// The number of outstanding provider references for the account `who`. - pub fn providers(who: &T::AccountId) -> RefCount { Account::::get(who).providers } + pub fn providers(who: &T::AccountId) -> RefCount { + Account::::get(who).providers + } /// The number of outstanding sufficient references for the account `who`. - pub fn sufficients(who: &T::AccountId) -> RefCount { Account::::get(who).sufficients } + pub fn sufficients(who: &T::AccountId) -> RefCount { + Account::::get(who).sufficients + } /// The number of outstanding provider and sufficient references for the account `who`. pub fn reference_count(who: &T::AccountId) -> RefCount { @@ -1264,7 +1289,9 @@ impl Pallet { } /// The number of outstanding references for the account `who`. - pub fn consumers(who: &T::AccountId) -> RefCount { Account::::get(who).consumers } + pub fn consumers(who: &T::AccountId) -> RefCount { + Account::::get(who).consumers + } /// True if the account has some outstanding consumer references. pub fn is_provider_required(who: &T::AccountId) -> bool { @@ -1289,7 +1316,9 @@ impl Pallet { /// True if the account has at least one provider reference and fewer consumer references than /// the maximum. - pub fn can_inc_consumer(who: &T::AccountId) -> bool { Self::can_accrue_consumers(who, 1) } + pub fn can_inc_consumer(who: &T::AccountId) -> bool { + Self::can_accrue_consumers(who, 1) + } /// Deposits an event into this block's event record. /// @@ -1313,11 +1342,7 @@ impl Pallet { } let phase = ExecutionPhase::::get().unwrap_or_default(); - let event = EventRecord { - phase, - event, - topics: topics.to_vec(), - }; + let event = EventRecord { phase, event, topics: topics.to_vec() }; // Index of the to be added event. let event_idx = { @@ -1345,10 +1370,14 @@ impl Pallet { } /// Gets extrinsics count. - pub fn extrinsic_count() -> u32 { ExtrinsicCount::::get().unwrap_or_default() } + pub fn extrinsic_count() -> u32 { + ExtrinsicCount::::get().unwrap_or_default() + } /// Returns all extrinsics len in raw. - pub fn all_extrinsics_len() -> u32 { AllExtrinsicsLen::::get().unwrap_or_default().raw } + pub fn all_extrinsics_len() -> u32 { + AllExtrinsicsLen::::get().unwrap_or_default().raw + } /// Returns all extrinsics len with padding. pub fn all_padded_extrinsics_len() -> u32 { @@ -1461,9 +1490,7 @@ impl Pallet { // move block hash pruning window by one block let block_hash_count = T::BlockHashCount::get(); - let to_remove = number - .saturating_sub(block_hash_count) - .saturating_sub(One::one()); + let to_remove = number.saturating_sub(block_hash_count).saturating_sub(One::one()); // keep genesis hash if !to_remove.is_zero() { @@ -1504,14 +1531,7 @@ impl Pallet { T::Hash, generic::Digest, HeaderExtension, - >>::new( - number, - extrinsics_root, - storage_root, - parent_hash, - digest, - extension, - ); + >>::new(number, extrinsics_root, storage_root, parent_hash, digest, extension); use sp_runtime::traits::Header as _; log::trace!( @@ -1530,7 +1550,9 @@ impl Pallet { /// - `O(1)` /// - 1 storage write (codec `O(1)`) /// # - pub fn deposit_log(item: generic::DigestItem) { >::append(item); } + pub fn deposit_log(item: generic::DigestItem) { + >::append(item); + } /// Get the basic externalities for this pallet, useful for tests. #[cfg(any(feature = "std", test))] @@ -1568,9 +1590,7 @@ impl Pallet { /// Should only be called if you know what you are doing and outside of the runtime block /// execution else it can have a large impact on the PoV size of a block. pub fn event_no_consensus(index: usize) -> Option { - Self::read_events_no_consensus() - .nth(index) - .map(|e| e.event.clone()) + Self::read_events_no_consensus().nth(index).map(|e| e.event.clone()) } /// Get the current events deposited by the runtime. @@ -1585,7 +1605,9 @@ impl Pallet { /// Set the block number to something in particular. Can be used as an alternative to /// `initialize` for tests that don't need to bother with the other environment entries. #[cfg(any(feature = "std", feature = "runtime-benchmarks", test))] - pub fn set_block_number(n: BlockNumberFor) { >::put(n); } + pub fn set_block_number(n: BlockNumberFor) { + >::put(n); + } /// Sets the index of extrinsic that is currently executing. #[cfg(any(feature = "std", test))] @@ -1596,7 +1618,9 @@ impl Pallet { /// Set the parent hash number to something in particular. Can be used as an alternative to /// `initialize` for tests that don't need to bother with the other environment entries. #[cfg(any(feature = "std", test))] - pub fn set_parent_hash(n: T::Hash) { >::put(n); } + pub fn set_parent_hash(n: T::Hash) { + >::put(n); + } /// Set the current block weight. This should only be used in some integration tests. #[cfg(any(feature = "std", test))] @@ -1607,10 +1631,7 @@ impl Pallet { current_weight.set(weight, DispatchClass::Normal) }); let len: u32 = len.saturated_into(); - let all_ext_len = ExtrinsicLen { - raw: len, - padded: Self::padded_extrinsic_len(len), - }; + let all_ext_len = ExtrinsicLen { raw: len, padded: Self::padded_extrinsic_len(len) }; AllExtrinsicsLen::::put(all_ext_len); } @@ -1641,11 +1662,7 @@ impl Pallet { /// NOTE: Events not registered at the genesis block and quietly omitted. #[cfg(any(feature = "std", feature = "runtime-benchmarks", test))] pub fn assert_last_event(event: T::RuntimeEvent) { - let last_event = Self::events() - .last() - .expect("events expected") - .event - .clone(); + let last_event = Self::events().last().expect("events expected").event.clone(); assert_eq!( last_event, event, "expected event {event:?} is not equal to the last event {last_event:?}", @@ -1653,7 +1670,9 @@ impl Pallet { } /// Return the chain's current runtime version. - pub fn runtime_version() -> RuntimeVersion { T::Version::get() } + pub fn runtime_version() -> RuntimeVersion { + T::Version::get() + } /// Retrieve the account transaction counter from storage. pub fn account_nonce(who: impl EncodeLike) -> T::Nonce { @@ -1684,9 +1703,7 @@ impl Pallet { info.pays_fee = extract_actual_pays_fee(r, &info); Self::deposit_event(match r { - Ok(_) => Event::ExtrinsicSuccess { - dispatch_info: info, - }, + Ok(_) => Event::ExtrinsicSuccess { dispatch_info: info }, Err(err) => { log::trace!( target: LOG_TARGET, @@ -1694,10 +1711,7 @@ impl Pallet { Self::block_number(), err, ); - Event::ExtrinsicFailed { - dispatch_error: err.error, - dispatch_info: info, - } + Event::ExtrinsicFailed { dispatch_error: err.error, dispatch_info: info } }, }); @@ -1718,7 +1732,9 @@ impl Pallet { /// To be called immediately after finishing the initialization of the block /// (e.g., called `on_initialize` for all pallets). - pub fn note_finished_initialize() { ExecutionPhase::::put(Phase::ApplyExtrinsic(0)) } + pub fn note_finished_initialize() { + ExecutionPhase::::put(Phase::ApplyExtrinsic(0)) + } /// An account is being created. pub fn on_created_account(who: T::AccountId, _a: &mut AccountInfo) { @@ -1814,7 +1830,9 @@ impl HandleLifetime for SelfSufficient { /// Event handler which registers a consumer when created. pub struct Consumer(PhantomData); impl HandleLifetime for Consumer { - fn created(t: &T::AccountId) -> Result<(), DispatchError> { Pallet::::inc_consumers(t) } + fn created(t: &T::AccountId) -> Result<(), DispatchError> { + Pallet::::inc_consumers(t) + } fn killed(t: &T::AccountId) -> Result<(), DispatchError> { Pallet::::dec_consumers(t); @@ -1825,7 +1843,9 @@ impl HandleLifetime for Consumer { impl BlockNumberProvider for Pallet { type BlockNumber = BlockNumberFor; - fn current_block_number() -> Self::BlockNumber { Pallet::::block_number() } + fn current_block_number() -> Self::BlockNumber { + Pallet::::block_number() + } } /// Implement StoredMap for a simple single-item, provide-when-not-default system. This works fine @@ -1834,7 +1854,9 @@ impl BlockNumberProvider for Pallet { /// /// Anything more complex will need more sophisticated logic. impl StoredMap for Pallet { - fn get(k: &T::AccountId) -> T::AccountData { Account::::get(k).data } + fn get(k: &T::AccountId) -> T::AccountData { + Account::::get(k).data + } fn try_mutate_exists>( k: &T::AccountId, @@ -1869,7 +1891,9 @@ pub fn split_inner( pub struct ChainContext(PhantomData); impl Default for ChainContext { - fn default() -> Self { ChainContext(PhantomData) } + fn default() -> Self { + ChainContext(PhantomData) + } } impl Lookup for ChainContext { diff --git a/pallets/system/src/limits.rs b/pallets/system/src/limits.rs index 5254a61ba..7c778a40d 100644 --- a/pallets/system/src/limits.rs +++ b/pallets/system/src/limits.rs @@ -43,11 +43,7 @@ use sp_std::vec::Vec; use static_assertions::const_assert; /// Block length limit configuration. -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[derive(RuntimeDebug, PartialEq, Clone, PassByCodec, MaxEncodedLen)] pub struct BlockLength { /// Maximal total length in bytes for each extrinsic class. @@ -75,13 +71,12 @@ const fn is_chunk_size_valid(new_size: NonZeroU32) -> bool { impl BlockLength { #[inline] - pub fn chunk_size(&self) -> NonZeroU32 { self.chunk_size } + pub fn chunk_size(&self) -> NonZeroU32 { + self.chunk_size + } pub fn set_chunk_size(&mut self, new_size: NonZeroU32) -> Result<(), BlockLengthError> { - ensure!( - is_chunk_size_valid(new_size), - BlockLengthError::InvalidChunkSize - ); + ensure!(is_chunk_size_valid(new_size), BlockLengthError::InvalidChunkSize); self.chunk_size = new_size; Ok(()) @@ -105,15 +100,9 @@ impl TypeInfo for BlockLength { .type_name("PerDispatchClass") }) .field(|f| { - f.ty::() - .name("cols") - .type_name("BlockLengthColumns") - }) - .field(|f| { - f.ty::() - .name("rows") - .type_name("BlockLengthRows") + f.ty::().name("cols").type_name("BlockLengthColumns") }) + .field(|f| f.ty::().name("rows").type_name("BlockLengthRows")) .field(|f| f.compact::().name("chunk_size").type_name("u32")), ) } @@ -144,17 +133,9 @@ impl Decode for BlockLength { .0; let chunk_size = NonZeroU32::new(chunk_size).ok_or("Zero `BlockLength::chunk_size`")?; - ensure!( - is_chunk_size_valid(chunk_size), - Error::from("Invalid `BlockLength::chunk_size`") - ); + ensure!(is_chunk_size_valid(chunk_size), Error::from("Invalid `BlockLength::chunk_size`")); - Ok(BlockLength { - max, - cols, - rows, - chunk_size, - }) + Ok(BlockLength { max, cols, rows, chunk_size }) } } @@ -221,12 +202,7 @@ impl BlockLength { debug_assert!(is_chunk_size_valid(chunk_size)); let max = Self::max_per_class(rows, cols, chunk_size, normal)?; - Ok(Self { - cols, - rows, - chunk_size, - max, - }) + Ok(Self { cols, rows, chunk_size, max }) } /// Create new `BlockLength` with `max` for `Operational` & `Mandatory` @@ -238,12 +214,7 @@ impl BlockLength { _ => max, }); - Self { - cols: MAX_BLOCK_COLUMNS, - rows: MAX_BLOCK_ROWS, - chunk_size: BLOCK_CHUNK_SIZE, - max, - } + Self { cols: MAX_BLOCK_COLUMNS, rows: MAX_BLOCK_ROWS, chunk_size: BLOCK_CHUNK_SIZE, max } } fn max_per_class( @@ -412,11 +383,15 @@ impl Default for BlockWeights { impl BlockWeights { /// Get per-class weight settings. - pub fn get(&self, class: DispatchClass) -> &WeightsPerClass { self.per_class.get(class) } + pub fn get(&self, class: DispatchClass) -> &WeightsPerClass { + self.per_class.get(class) + } /// Verifies correctness of this `BlockWeights` object. pub fn validate(self) -> ValidationResult { - fn or_max(w: Option) -> Weight { w.unwrap_or_else(Weight::max_value) } + fn or_max(w: Option) -> Weight { + w.unwrap_or_else(Weight::max_value) + } let mut error = ValidationErrors::default(); for class in DispatchClass::all() { @@ -463,8 +438,7 @@ impl BlockWeights { ); // Make sure max block is greater than max_total if it's set. error_assert!( - self.max_block - .all_gte(weights.max_total.unwrap_or(Weight::zero())), + self.max_block.all_gte(weights.max_total.unwrap_or(Weight::zero())), &mut error, "[{:?}] {:?} (max block) has to be greater than {:?} (max for class)", class, @@ -537,11 +511,8 @@ impl BlockWeights { base_block: constants::BlockExecutionWeight::get(), max_block: Weight::zero(), per_class: PerDispatchClass::new(|class| { - let initial = if class == DispatchClass::Mandatory { - None - } else { - Some(Weight::zero()) - }; + let initial = + if class == DispatchClass::Mandatory { None } else { Some(Weight::zero()) }; WeightsPerClass { base_extrinsic: constants::ExtrinsicBaseWeight::get(), max_extrinsic: None, @@ -599,10 +570,7 @@ impl BlockWeightsBuilder { /// Construct the `BlockWeights` object. pub fn build(self) -> ValidationResult { // compute max extrinsic size - let Self { - mut weights, - init_cost, - } = self; + let Self { mut weights, init_cost } = self; // compute max block size. for class in DispatchClass::all() { @@ -643,5 +611,7 @@ mod tests { use super::*; #[test] - fn default_weights_are_valid() { BlockWeights::default().validate().unwrap(); } + fn default_weights_are_valid() { + BlockWeights::default().validate().unwrap(); + } } diff --git a/pallets/system/src/migrations/mod.rs b/pallets/system/src/migrations/mod.rs index 130d51bd5..0a13f9150 100644 --- a/pallets/system/src/migrations/mod.rs +++ b/pallets/system/src/migrations/mod.rs @@ -74,13 +74,7 @@ pub fn migrate_from_single_u8_to_triple_ref_count() -> Wei let mut translated: usize = 0; >::translate::<(V::Nonce, u8, V::AccountData), _>(|_key, (nonce, rc, data)| { translated += 1; - Some(AccountInfo { - nonce, - consumers: rc as RefCount, - providers: 1, - sufficients: 0, - data, - }) + Some(AccountInfo { nonce, consumers: rc as RefCount, providers: 1, sufficients: 0, data }) }); log::info!( target: "runtime::system", @@ -98,13 +92,7 @@ pub fn migrate_from_single_to_triple_ref_count() -> Weight >::translate::<(V::Nonce, RefCount, V::AccountData), _>( |_key, (nonce, consumers, data)| { translated += 1; - Some(AccountInfo { - nonce, - consumers, - providers: 1, - sufficients: 0, - data, - }) + Some(AccountInfo { nonce, consumers, providers: 1, sufficients: 0, data }) }, ); log::info!( @@ -122,13 +110,7 @@ pub fn migrate_from_dual_to_triple_ref_count() -> Weight { >::translate::<(V::Nonce, RefCount, RefCount, V::AccountData), _>( |_key, (nonce, consumers, providers, data)| { translated += 1; - Some(AccountInfo { - nonce, - consumers, - providers, - sufficients: 0, - data, - }) + Some(AccountInfo { nonce, consumers, providers, sufficients: 0, data }) }, ); log::info!( diff --git a/pallets/system/src/mock.rs b/pallets/system/src/mock.rs index 4b1bd5cd7..724055854 100644 --- a/pallets/system/src/mock.rs +++ b/pallets/system/src/mock.rs @@ -80,7 +80,9 @@ parameter_types! { pub struct RecordKilled; impl OnKilledAccount for RecordKilled { - fn on_killed_account(who: &u64) { Killed::mutate(|r| r.push(*who)) } + fn on_killed_account(who: &u64) { + Killed::mutate(|r| r.push(*who)) + } } impl Config for Test { diff --git a/pallets/system/src/mocking.rs b/pallets/system/src/mocking.rs index 633ac02fa..54a96ac67 100644 --- a/pallets/system/src/mocking.rs +++ b/pallets/system/src/mocking.rs @@ -121,7 +121,9 @@ impl TryFrom<&OpaqueExtrinsic> for MockUncheckedExtrinsic { } impl From> for AppExtrinsic { - fn from(xt: MockUncheckedExtrinsic) -> Self { AppExtrinsic::from(xt.0) } + fn from(xt: MockUncheckedExtrinsic) -> Self { + AppExtrinsic::from(xt.0) + } } /// An implementation of `sp_runtime::traits::Block` to be used in tests. diff --git a/pallets/system/src/offchain.rs b/pallets/system/src/offchain.rs index aa4e3e375..ec25eb921 100644 --- a/pallets/system/src/offchain.rs +++ b/pallets/system/src/offchain.rs @@ -122,19 +122,20 @@ pub struct Signer, X = Fo impl, X> Default for Signer { fn default() -> Self { - Self { - accounts: Default::default(), - _phantom: Default::default(), - } + Self { accounts: Default::default(), _phantom: Default::default() } } } impl, X> Signer { /// Use all available keys for signing. - pub fn all_accounts() -> Signer { Default::default() } + pub fn all_accounts() -> Signer { + Default::default() + } /// Use any of the available keys for signing. - pub fn any_account() -> Signer { Default::default() } + pub fn any_account() -> Signer { + Default::default() + } /// Use provided `accounts` for signing. /// @@ -147,7 +148,9 @@ impl, X> Signer } /// Check if there are any keys that could be used for signing. - pub fn can_sign(&self) -> bool { self.accounts_from_keys().count() > 0 } + pub fn can_sign(&self) -> bool { + self.accounts_from_keys().count() > 0 + } /// Return a vector of the intersection between /// all available accounts and the provided accounts @@ -175,15 +178,12 @@ impl, X> Signer } fn keystore_accounts(&self) -> impl Iterator> { - C::RuntimeAppPublic::all() - .into_iter() - .enumerate() - .map(|(index, key)| { - let generic_public = C::GenericPublic::from(key); - let public: T::Public = generic_public.into(); - let account_id = public.clone().into_account(); - Account::new(index, account_id, public) - }) + C::RuntimeAppPublic::all().into_iter().enumerate().map(|(index, key)| { + let generic_public = C::GenericPublic::from(key); + let public: T::Public = generic_public.into(); + let account_id = public.clone().into_account(); + Account::new(index, account_id, public) + }) } } @@ -360,11 +360,7 @@ where T::Public: Clone, { fn clone(&self) -> Self { - Self { - index: self.index, - id: self.id.clone(), - public: self.public.clone(), - } + Self { index: self.index, id: self.id.clone(), public: self.public.clone() } } } @@ -493,10 +489,7 @@ pub trait CreateSignedTransaction: public: Self::Public, account: Self::AccountId, nonce: Self::Nonce, - ) -> Option<( - Self::OverarchingCall, - ::SignaturePayload, - )>; + ) -> Option<(Self::OverarchingCall, ::SignaturePayload)>; } /// A message signer. @@ -651,7 +644,9 @@ mod tests { } impl SignedPayload for SimplePayload { - fn public(&self) -> UintAuthorityId { self.public.clone() } + fn public(&self) -> UintAuthorityId { + self.public.clone() + } } struct DummyAppCrypto; @@ -666,17 +661,7 @@ mod tests { } fn assert_account(next: Option<(Account, Result<(), ()>)>, index: usize, id: u64) { - assert_eq!( - next, - Some(( - Account { - index, - id, - public: id.into() - }, - Ok(()) - )) - ); + assert_eq!(next, Some((Account { index, id, public: id.into() }, Ok(())))); } #[test] @@ -693,10 +678,7 @@ mod tests { // when let result = Signer::::all_accounts() .send_unsigned_transaction( - |account| SimplePayload { - data: vec![1, 2, 3], - public: account.public.clone(), - }, + |account| SimplePayload { data: vec![1, 2, 3], public: account.public.clone() }, |_payload, _signature| CALL.clone(), ); @@ -731,10 +713,7 @@ mod tests { // when let result = Signer::::any_account() .send_unsigned_transaction( - |account| SimplePayload { - data: vec![1, 2, 3], - public: account.public.clone(), - }, + |account| SimplePayload { data: vec![1, 2, 3], public: account.public.clone() }, |_payload, _signature| CALL.clone(), ); @@ -766,10 +745,7 @@ mod tests { let result = Signer::::all_accounts() .with_filter(vec![0xf2.into(), 0xf1.into()]) .send_unsigned_transaction( - |account| SimplePayload { - data: vec![1, 2, 3], - public: account.public.clone(), - }, + |account| SimplePayload { data: vec![1, 2, 3], public: account.public.clone() }, |_payload, _signature| CALL.clone(), ); @@ -803,10 +779,7 @@ mod tests { let result = Signer::::any_account() .with_filter(vec![0xf2.into(), 0xf1.into()]) .send_unsigned_transaction( - |account| SimplePayload { - data: vec![1, 2, 3], - public: account.public.clone(), - }, + |account| SimplePayload { data: vec![1, 2, 3], public: account.public.clone() }, |_payload, _signature| CALL.clone(), ); diff --git a/pallets/system/src/submitted_data.rs b/pallets/system/src/submitted_data.rs index 81b1e3528..0558ad0c4 100644 --- a/pallets/system/src/submitted_data.rs +++ b/pallets/system/src/submitted_data.rs @@ -23,7 +23,9 @@ pub type RcMetrics = Rc>; impl Metrics { /// Creates a shared metric with internal mutability. - fn new_shared() -> RcMetrics { Rc::new(RefCell::new(Self::default())) } + fn new_shared() -> RcMetrics { + Rc::new(RefCell::new(Self::default())) + } } /// Extracts the `data` field from some types of extrinsics. @@ -43,7 +45,9 @@ pub trait Extractor { impl Extractor for () { type Error = (); - fn extract(_: &OpaqueExtrinsic, _: RcMetrics) -> Result>, ()> { Ok(vec![]) } + fn extract(_: &OpaqueExtrinsic, _: RcMetrics) -> Result>, ()> { + Ok(vec![]) + } } /// It is similar to `Extractor` but it uses `C` type for calls, instead of `AppExtrinsic`. @@ -57,9 +61,13 @@ pub trait Filter { #[cfg(any(feature = "std", test))] impl Filter for () { - fn filter(_: C, _: RcMetrics) -> Vec> { vec![] } + fn filter(_: C, _: RcMetrics) -> Vec> { + vec![] + } - fn process_calls(_: Vec, _: &RcMetrics) -> Vec> { vec![] } + fn process_calls(_: Vec, _: &RcMetrics) -> Vec> { + vec![] + } } fn extract_and_inspect(opaque: &OpaqueExtrinsic, metrics: RcMetrics) -> Vec> @@ -136,7 +144,9 @@ where impl Hasher for Keccak256Algorithm { type Hash = [u8; 32]; - fn hash(data: &[u8]) -> [u8; 32] { sp_io::hashing::keccak_256(data).into() } + fn hash(data: &[u8]) -> [u8; 32] { + sp_io::hashing::keccak_256(data).into() + } } let mut tree = MerkleTree::::new(); @@ -196,12 +206,7 @@ where let tx_max = transaction_index.checked_add(1)?; let submitted_data = calls - .map(|c| { - F::filter(c, Rc::clone(&metrics)) - .into_iter() - .flatten() - .collect::>() - }) + .map(|c| F::filter(c, Rc::clone(&metrics)).into_iter().flatten().collect::>()) .collect::>(); match submitted_data.get(transaction_index) { @@ -210,16 +215,9 @@ where _ => (), }; - let data_index = submitted_data - .iter() - .take(tx_max) - .filter(|data| !data.is_empty()) - .count() - 1; + let data_index = submitted_data.iter().take(tx_max).filter(|data| !data.is_empty()).count() - 1; - let data = submitted_data - .into_iter() - .filter(|v| !v.is_empty()) - .collect::>(); + let data = submitted_data.into_iter().filter(|v| !v.is_empty()).collect::>(); let data_index = u32::try_from(data_index).ok()?; proof(data, data_index, Rc::clone(&metrics)) @@ -298,7 +296,9 @@ mod test { } } - fn process_calls(_: Vec, _: &RcMetrics) -> Vec> { vec![] } + fn process_calls(_: Vec, _: &RcMetrics) -> Vec> { + vec![] + } } #[test] @@ -337,10 +337,7 @@ mod test { } // proof should not be generated when there is not data - assert_eq!( - None, - calls_proof::(submitted_data.clone().into_iter(), 1) - ); + assert_eq!(None, calls_proof::(submitted_data.clone().into_iter(), 1)); if let Some(da_proof) = calls_proof::(submitted_data.clone().into_iter(), 2) { assert_eq!(da_proof.leaf_index, 1); @@ -379,10 +376,7 @@ mod test { } // submit index that does not exists and proof should not be generated - assert_eq!( - None, - calls_proof::(submitted_data.clone().into_iter(), 15) - ); + assert_eq!(None, calls_proof::(submitted_data.clone().into_iter(), 15)); } } @@ -477,36 +471,23 @@ mod test { _ => return Err("Not Avail Extrinsic".into()), }; - Ok(Self { - app_id, - signature, - data, - }) + Ok(Self { app_id, signature, data }) } } } fn encoded_timestamp_call() -> AppExtrinsic { - AppExtrinsic { - app_id: 0.into(), - data: hex!("280403000BC26208378301").into(), - } + AppExtrinsic { app_id: 0.into(), data: hex!("280403000BC26208378301").into() } } fn encoded_fillblock_call>(app_id: A) -> AppExtrinsic { let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); - AppExtrinsic { - app_id: app_id.into(), - data, - } + AppExtrinsic { app_id: app_id.into(), data } } fn encoded_tx_bob() -> AppExtrinsic { let data = hex!("490284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0166de9fcb3903fa119cb6d23dd903b93a67719f76922b2b4c15a2539d11021102b75f4c452595b65b3bacef0e852430bbfa44bd38133b16cd5d48edb45962568204010000000000000600008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4802093d00").to_vec(); - AppExtrinsic { - app_id: 0.into(), - data, - } + AppExtrinsic { app_id: 0.into(), data } } fn dr_input_1() -> Vec { @@ -533,18 +514,18 @@ mod test { hex!("3262313166316464333935353666623261623432").into(), ]; - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); + let leaves = avail_data.iter().map(|xt| Sha256::hash(&xt)).collect::>(); let data_tree = MerkleTree::::from_leaves(&leaves); let proof = data_tree.proof(&[1usize]); let root_proof = proof.proof_hashes().to_vec(); - assert_eq!(root_proof, vec![ - hex!("754B9412E0ED7907BDF4B7CA5D2A22F5E129A03DEB1F4E1C1FE42D322FDEE90E"), - hex!("8D6E30E494D17D7675A94C3C614467FF8CCE35201C1056751A6E9A100515DAF9"), - ]); + assert_eq!( + root_proof, + vec![ + hex!("754B9412E0ED7907BDF4B7CA5D2A22F5E129A03DEB1F4E1C1FE42D322FDEE90E"), + hex!("8D6E30E494D17D7675A94C3C614467FF8CCE35201C1056751A6E9A100515DAF9"), + ] + ); } #[test] @@ -554,10 +535,7 @@ mod test { let avail_data: Vec> = vec![hex!("3435346666383063303838616137666162396531").to_vec()]; - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); + let leaves = avail_data.iter().map(|xt| Sha256::hash(&xt)).collect::>(); let data_tree = MerkleTree::::from_leaves(&leaves); let proof = data_tree.proof(&[0usize]); @@ -575,20 +553,14 @@ mod test { hex!("3262313166316464333935353666623261623432").into(), hex!("6433326630643762346634306264346563323665").into(), ]; - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); + let leaves = avail_data.iter().map(|xt| Sha256::hash(&xt)).collect::>(); let merkle_tree = MerkleTree::::from_leaves(&leaves); let indices_to_prove = vec![3]; let leaves_to_prove = leaves.get(3..4).ok_or("can't get leaves to prove").unwrap(); let proof = merkle_tree.proof(&indices_to_prove); - let root = merkle_tree - .root() - .ok_or("couldn't get the merkle root") - .unwrap(); + let root = merkle_tree.root().ok_or("couldn't get the merkle root").unwrap(); assert!(proof.verify(root, &indices_to_prove, leaves_to_prove, leaves.len())); } @@ -597,10 +569,7 @@ mod test { fn verify_nodata_merkle_proof() { let avail_data: Vec> = vec![]; - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); + let leaves = avail_data.iter().map(|xt| Sha256::hash(&xt)).collect::>(); let leaves_to_prove = if let Ok(leaves) = leaves.get(0).ok_or("can't get leaves to prove") { leaves } else { @@ -611,10 +580,7 @@ mod test { fn encoded_submit_call>(app_id: A) -> AppExtrinsic { let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); - AppExtrinsic { - app_id: app_id.into(), - data, - } + AppExtrinsic { app_id: app_id.into(), data } } /* diff --git a/pallets/system/src/tests.rs b/pallets/system/src/tests.rs index 5942a830d..8fb635ff2 100644 --- a/pallets/system/src/tests.rs +++ b/pallets/system/src/tests.rs @@ -79,13 +79,10 @@ fn stored_map_works() { assert_ok!(System::insert(&0, 42)); assert!(!System::is_provider_required(&0)); - assert_eq!(Account::::get(0), AccountInfo { - nonce: 0, - providers: 1, - consumers: 0, - sufficients: 0, - data: 42 - }); + assert_eq!( + Account::::get(0), + AccountInfo { nonce: 0, providers: 1, consumers: 0, sufficients: 0, data: 42 } + ); assert_ok!(System::inc_consumers(&0)); assert!(System::is_provider_required(&0)); @@ -203,11 +200,14 @@ fn deposit_event_should_work() { System::note_finished_extrinsics(); System::deposit_event(SysEvent::CodeUpdated); System::finalize(); - assert_eq!(System::events(), vec![EventRecord { - phase: Phase::Finalization, - event: SysEvent::CodeUpdated.into(), - topics: vec![], - }]); + assert_eq!( + System::events(), + vec![EventRecord { + phase: Phase::Finalization, + event: SysEvent::CodeUpdated.into(), + topics: vec![], + }] + ); let normal_base = ::BlockWeights::get() .get(DispatchClass::Normal) @@ -223,46 +223,43 @@ fn deposit_event_should_work() { System::note_finished_extrinsics(); System::deposit_event(SysEvent::NewAccount { account: 3 }); System::finalize(); - assert_eq!(System::events(), vec![ - EventRecord { - phase: Phase::Initialization, - event: SysEvent::NewAccount { account: 32 }.into(), - topics: vec![], - }, - EventRecord { - phase: Phase::ApplyExtrinsic(0), - event: SysEvent::KilledAccount { account: 42 }.into(), - topics: vec![] - }, - EventRecord { - phase: Phase::ApplyExtrinsic(0), - event: SysEvent::ExtrinsicSuccess { - dispatch_info: DispatchInfo { - weight: normal_base, - ..Default::default() + assert_eq!( + System::events(), + vec![ + EventRecord { + phase: Phase::Initialization, + event: SysEvent::NewAccount { account: 32 }.into(), + topics: vec![], + }, + EventRecord { + phase: Phase::ApplyExtrinsic(0), + event: SysEvent::KilledAccount { account: 42 }.into(), + topics: vec![] + }, + EventRecord { + phase: Phase::ApplyExtrinsic(0), + event: SysEvent::ExtrinsicSuccess { + dispatch_info: DispatchInfo { weight: normal_base, ..Default::default() } } - } - .into(), - topics: vec![] - }, - EventRecord { - phase: Phase::ApplyExtrinsic(1), - event: SysEvent::ExtrinsicFailed { - dispatch_error: DispatchError::BadOrigin.into(), - dispatch_info: DispatchInfo { - weight: normal_base, - ..Default::default() + .into(), + topics: vec![] + }, + EventRecord { + phase: Phase::ApplyExtrinsic(1), + event: SysEvent::ExtrinsicFailed { + dispatch_error: DispatchError::BadOrigin.into(), + dispatch_info: DispatchInfo { weight: normal_base, ..Default::default() } } - } - .into(), - topics: vec![] - }, - EventRecord { - phase: Phase::Finalization, - event: SysEvent::NewAccount { account: 3 }.into(), - topics: vec![] - }, - ]); + .into(), + topics: vec![] + }, + EventRecord { + phase: Phase::Finalization, + event: SysEvent::NewAccount { account: 3 }.into(), + topics: vec![] + }, + ] + ); }); } @@ -276,10 +273,7 @@ fn deposit_event_uses_actual_weight_and_pays_fee() { let normal_base = ::BlockWeights::get() .get(DispatchClass::Normal) .base_extrinsic; - let pre_info = DispatchInfo { - weight: Weight::from_parts(1000, 0), - ..Default::default() - }; + let pre_info = DispatchInfo { weight: Weight::from_parts(1000, 0), ..Default::default() }; System::note_applied_extrinsic(&Ok(from_actual_ref_time(Some(300))), pre_info); System::note_applied_extrinsic(&Ok(from_actual_ref_time(Some(1000))), pre_info); System::note_applied_extrinsic( @@ -304,10 +298,7 @@ fn deposit_event_uses_actual_weight_and_pays_fee() { System::note_applied_extrinsic( &Err(DispatchErrorWithPostInfo { - post_info: PostDispatchInfo { - actual_weight: None, - pays_fee: Pays::Yes, - }, + post_info: PostDispatchInfo { actual_weight: None, pays_fee: Pays::Yes }, error: DispatchError::BadOrigin, }), pre_info, @@ -336,10 +327,7 @@ fn deposit_event_uses_actual_weight_and_pays_fee() { let operational_base = ::BlockWeights::get() .get(DispatchClass::Operational) .base_extrinsic; - assert!( - normal_base != operational_base, - "Test pre-condition violated" - ); + assert!(normal_base != operational_base, "Test pre-condition violated"); let pre_info = DispatchInfo { weight: Weight::from_parts(1000, 0), class: DispatchClass::Operational, @@ -509,11 +497,7 @@ fn deposit_event_topics() { System::initialize(&BLOCK_NUMBER, &[0u8; 32].into(), &Default::default()); System::note_finished_extrinsics(); - let topics = vec![ - H256::repeat_byte(1), - H256::repeat_byte(2), - H256::repeat_byte(3), - ]; + let topics = vec![H256::repeat_byte(1), H256::repeat_byte(2), H256::repeat_byte(3)]; // We deposit a few events with different sets of topics. System::deposit_event_indexed(&topics[0..3], SysEvent::NewAccount { account: 1 }.into()); @@ -523,34 +507,31 @@ fn deposit_event_topics() { System::finalize(); // Check that topics are reflected in the event record. - assert_eq!(System::events(), vec![ - EventRecord { - phase: Phase::Finalization, - event: SysEvent::NewAccount { account: 1 }.into(), - topics: topics[0..3].to_vec(), - }, - EventRecord { - phase: Phase::Finalization, - event: SysEvent::NewAccount { account: 2 }.into(), - topics: topics[0..1].to_vec(), - }, - EventRecord { - phase: Phase::Finalization, - event: SysEvent::NewAccount { account: 3 }.into(), - topics: topics[1..2].to_vec(), - } - ]); + assert_eq!( + System::events(), + vec![ + EventRecord { + phase: Phase::Finalization, + event: SysEvent::NewAccount { account: 1 }.into(), + topics: topics[0..3].to_vec(), + }, + EventRecord { + phase: Phase::Finalization, + event: SysEvent::NewAccount { account: 2 }.into(), + topics: topics[0..1].to_vec(), + }, + EventRecord { + phase: Phase::Finalization, + event: SysEvent::NewAccount { account: 3 }.into(), + topics: topics[1..2].to_vec(), + } + ] + ); // Check that the topic-events mapping reflects the deposited topics. // Note that these are indexes of the events. - assert_eq!(System::event_topics(&topics[0]), vec![ - (BLOCK_NUMBER, 0), - (BLOCK_NUMBER, 1) - ]); - assert_eq!(System::event_topics(&topics[1]), vec![ - (BLOCK_NUMBER, 0), - (BLOCK_NUMBER, 2) - ]); + assert_eq!(System::event_topics(&topics[0]), vec![(BLOCK_NUMBER, 0), (BLOCK_NUMBER, 1)]); + assert_eq!(System::event_topics(&topics[1]), vec![(BLOCK_NUMBER, 0), (BLOCK_NUMBER, 2)]); assert_eq!(System::event_topics(&topics[2]), vec![(BLOCK_NUMBER, 0)]); }); } @@ -627,9 +608,7 @@ fn set_code_checks_works() { let read_runtime_version = ReadRuntimeVersion(version.encode()); let mut ext = new_test_ext(); - ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new( - read_runtime_version, - )); + ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(read_runtime_version)); ext.execute_with(|| { let res = System::set_code(RawOrigin::Root.into(), vec![1, 2, 3, 4]); @@ -738,32 +717,26 @@ fn runtime_updated_digest_emitted_when_heap_pages_changed() { fn ensure_signed_stuff_works() { struct Members; impl SortedMembers for Members { - fn sorted_members() -> Vec { (0..10).collect() } + fn sorted_members() -> Vec { + (0..10).collect() + } } let signed_origin = RuntimeOrigin::signed(0u64); - assert_ok!( as EnsureOrigin<_>>::try_origin( - signed_origin.clone() - )); - assert_ok!( as EnsureOrigin<_>>::try_origin( - signed_origin - )); + assert_ok!( as EnsureOrigin<_>>::try_origin(signed_origin.clone())); + assert_ok!( as EnsureOrigin<_>>::try_origin(signed_origin)); #[cfg(feature = "runtime-benchmarks")] { let successful_origin: RuntimeOrigin = as EnsureOrigin<_>>::try_successful_origin() .expect("EnsureSigned has no successful origin required for the test"); - assert_ok!( as EnsureOrigin<_>>::try_origin( - successful_origin - )); + assert_ok!( as EnsureOrigin<_>>::try_origin(successful_origin)); let successful_origin: RuntimeOrigin = as EnsureOrigin<_>>::try_successful_origin() .expect("EnsureSignedBy has no successful origin required for the test"); - assert_ok!( as EnsureOrigin<_>>::try_origin( - successful_origin - )); + assert_ok!( as EnsureOrigin<_>>::try_origin(successful_origin)); } } @@ -775,8 +748,5 @@ pub fn from_actual_ref_time(ref_time: Option) -> PostDispatchInfo { } pub fn from_post_weight_info(ref_time: Option, pays_fee: Pays) -> PostDispatchInfo { - PostDispatchInfo { - actual_weight: ref_time.map(|t| Weight::from_all(t)), - pays_fee, - } + PostDispatchInfo { actual_weight: ref_time.map(|t| Weight::from_all(t)), pays_fee } } diff --git a/rpc/kate-rpc/src/lib.rs b/rpc/kate-rpc/src/lib.rs index ff3c6e617..049423210 100644 --- a/rpc/kate-rpc/src/lib.rs +++ b/rpc/kate-rpc/src/lib.rs @@ -167,9 +167,7 @@ where let block_hash = signed_block.block.header().hash(); if self.client.info().finalized_number < *signed_block.block.header().number() { - return Err(internal_err!( - "Requested block {block_hash} is not finalized" - )); + return Err(internal_err!("Requested block {block_hash} is not finalized")); } let mut block_ext_cache = self @@ -235,9 +233,7 @@ where let block_hash = signed_block.block.header().hash(); if self.client.info().finalized_number < *signed_block.block.header().number() { - return Err(internal_err!( - "Requested block {block_hash} is not finalized" - )); + return Err(internal_err!("Requested block {block_hash} is not finalized")); } let mut block_ext_cache = self @@ -287,12 +283,7 @@ where let app_data_index = signed_block.block.header().extension().app_lookup(); let dimensions = non_extended_dimensions(ext_data)?; - Ok(kate::com::scalars_to_app_rows( - app_id, - app_data_index, - dimensions, - ext_data, - )) + Ok(kate::com::scalars_to_app_rows(app_id, app_data_index, dimensions, ext_data)) } //TODO allocate static thread pool, just for RPC related work, to free up resources, for the block producing processes. @@ -308,9 +299,7 @@ where let block_hash = signed_block.block.header().hash(); if self.client.info().finalized_number < *signed_block.block.header().number() { - return Err(internal_err!( - "Requested block {block_hash} is not finalized" - )); + return Err(internal_err!("Requested block {block_hash} is not finalized")); } let mut block_ext_cache = self @@ -364,11 +353,7 @@ where .ok_or_else(|| internal_err!("Block dimensions are invalid"))?; let kc_public_params_raw = self.client.runtime_api().public_params(at).map_err(|e| { - internal_err!( - "Public params cannot be fetched on block {}: {:?}", - block_hash, - e - ) + internal_err!("Public params cannot be fetched on block {}: {:?}", block_hash, e) })?; let kc_public_params = unsafe { PublicParameters::from_slice_unchecked(&kc_public_params_raw) }; diff --git a/runtime/src/data_root_tests.rs b/runtime/src/data_root_tests.rs index 4b7c39c5c..8e3ed34b7 100644 --- a/runtime/src/data_root_tests.rs +++ b/runtime/src/data_root_tests.rs @@ -30,10 +30,7 @@ fn decode_submit_call() { let expected_signature = sp_runtime::MultiSignature::Sr25519(Signature(hex!("be06880f2f6203365b508b4226fd697d3d79d3a50a5617aad714466d40ef47067225e823135b32121aa0f6f56e696f5f71107a6d44768c2fefe38cb209f7f282"))); let expected_call = AppUncheckedExtrinsic { function: RuntimeCall::DataAvailability(DaCall::submit_data { - data: hex!("54657374207375626d69742064617461") - .to_vec() - .try_into() - .unwrap(), + data: hex!("54657374207375626d69742064617461").to_vec().try_into().unwrap(), }), // signature: Option<(Address, Signature, Extra)>, diff --git a/runtime/src/impls.rs b/runtime/src/impls.rs index 14f3ced48..b2c82cc15 100644 --- a/runtime/src/impls.rs +++ b/runtime/src/impls.rs @@ -135,9 +135,13 @@ mod multiplier_tests { .unwrap_or_else(|| BlockWeights::get().max_block) } - fn min_multiplier() -> Multiplier { MinimumMultiplier::get() } + fn min_multiplier() -> Multiplier { + MinimumMultiplier::get() + } - fn target() -> Weight { TargetBlockFullness::get() * max_normal() } + fn target() -> Weight { + TargetBlockFullness::get() * max_normal() + } // update based on runtime impl. fn runtime_multiplier_update(fm: Multiplier) -> Multiplier { @@ -215,18 +219,10 @@ mod multiplier_tests { fn multiplier_can_grow_from_zero() { // if the min is too small, then this will not change, and we are doomed forever. // the weight is 1/100th bigger than target. - run_with_system_weight( - target().set_ref_time(target().ref_time() * 101 / 100), - || { - let next = runtime_multiplier_update(min_multiplier()); - assert!( - next > min_multiplier(), - "{:?} !>= {:?}", - next, - min_multiplier() - ); - }, - ) + run_with_system_weight(target().set_ref_time(target().ref_time() * 101 / 100), || { + let next = runtime_multiplier_update(min_multiplier()); + assert!(next > min_multiplier(), "{:?} !>= {:?}", next, min_multiplier()); + }) } #[test] @@ -281,11 +277,7 @@ mod multiplier_tests { let next = runtime_multiplier_update(fm); fm = next; } - assert!( - fm > Multiplier::saturating_from_rational(1234, 1000), - "Invalid fm (={})", - fm - ); + assert!(fm > Multiplier::saturating_from_rational(1234, 1000), "Invalid fm (={})", fm); }) } @@ -295,10 +287,8 @@ mod multiplier_tests { // `cargo test congested_chain_simulation -- --nocapture` to get some insight. // almost full. The entire quota of normal transactions is taken. - let block_weight = BlockWeights::get() - .get(DispatchClass::Normal) - .max_total - .unwrap() - Weight::from_parts(100, 0); + let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() + - Weight::from_parts(100, 0); // Default substrate weight. let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get(); @@ -455,14 +445,12 @@ mod multiplier_tests { // Some values that are all above the target and will cause an increase. let t = target(); - vec![t + Weight::from_parts(100, 0), t * 2, t * 4] - .into_iter() - .for_each(|i| { - run_with_system_weight(i, || { - let fm = runtime_multiplier_update(max_fm); - // won't grow. The convert saturates everything. - assert_eq!(fm, max_fm); - }) - }); + vec![t + Weight::from_parts(100, 0), t * 2, t * 4].into_iter().for_each(|i| { + run_with_system_weight(i, || { + let fm = runtime_multiplier_update(max_fm); + // won't grow. The convert saturates everything. + assert_eq!(fm, max_fm); + }) + }); } } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 69a0efb72..748e4b043 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -139,10 +139,7 @@ pub mod voter_bags; /// The version information used to identify this runtime when compiled natively. #[cfg(any(feature = "std", test))] pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } type NegativeImbalance = >::NegativeImbalance; @@ -505,10 +502,7 @@ impl Get> for OffchainRandomBalancing { }, }; - let config = BalancingConfig { - iterations, - tolerance: 0, - }; + let config = BalancingConfig { iterations, tolerance: 0 }; Some(config) } } @@ -605,11 +599,15 @@ parameter_types! { use sp_runtime::traits::Convert; pub struct BalanceToU256; impl Convert for BalanceToU256 { - fn convert(balance: Balance) -> sp_core::U256 { sp_core::U256::from(balance) } + fn convert(balance: Balance) -> sp_core::U256 { + sp_core::U256::from(balance) + } } pub struct U256ToBalance; impl Convert for U256ToBalance { - fn convert(n: sp_core::U256) -> Balance { n.try_into().unwrap_or(Balance::max_value()) } + fn convert(n: sp_core::U256) -> Balance { + n.try_into().unwrap_or(Balance::max_value()) + } } impl pallet_nomination_pools::Config for Runtime { @@ -828,19 +826,14 @@ where public: ::Signer, account: AccountId, nonce: Index, - ) -> Option<( - RuntimeCall, - ::SignaturePayload, - )> { + ) -> Option<(RuntimeCall, ::SignaturePayload)> { use codec::Encode; use sp_runtime::{traits::StaticLookup, SaturatedConversion as _}; let tip = 0; // take the biggest period possible. - let period = BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; + let period = + BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; let current_block = System::block_number() .saturated_into::() // The `System::block_number` is initialized with `n+1`, @@ -1234,9 +1227,8 @@ mod tests { ..constants::staking::MaxNominations::get()) .map(|_| >::from(OnChainAccuracy::one().deconstruct())) .collect(); - let _: UpperOf = maximum_chain_accuracy - .iter() - .fold(0, |acc, x| acc.checked_add(*x).unwrap()); + let _: UpperOf = + maximum_chain_accuracy.iter().fold(0, |acc, x| acc.checked_add(*x).unwrap()); } const RUNTIME_CALL_SIZE: usize = size_of::(); @@ -1277,9 +1269,7 @@ mod tests { const SET_TIMESTAMP_RAW: &[u8] = &hex!("280403000ba302ac318301"); // `set_timestamp` extrinsic from block 13852 on DevNet. fn set_timestamp_expected() -> RuntimeCall { - RuntimeCall::Timestamp(pallet_timestamp::Call::set { - now: 1_662_985_700_003, - }) + RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: 1_662_985_700_003 }) } #[test_case( &TRANSFER_RAW => transfer_expected(); "Transfer 1 AVL to Bob")] diff --git a/runtime/src/migration.rs b/runtime/src/migration.rs index 1bfb159d3..2208913de 100644 --- a/runtime/src/migration.rs +++ b/runtime/src/migration.rs @@ -29,7 +29,9 @@ use crate::{Bounties, NominationPools, Runtime, Weight}; struct NominationPoolsMigrationV4OldPallet; impl Get for NominationPoolsMigrationV4OldPallet { - fn get() -> Perbill { Perbill::zero() } + fn get() -> Perbill { + Perbill::zero() + } } /// Implements `OnRuntimeUpgrade` trait. @@ -154,10 +156,7 @@ mod scheduler { let valid_agendas = agendas - corrupted_agendas_blocks; let current_agendas = pallet_scheduler::Agenda::::iter().count() as u32; - ensure!( - current_agendas == valid_agendas, - "Corrupted agendas did not get cleared" - ); + ensure!(current_agendas == valid_agendas, "Corrupted agendas did not get cleared"); let encoded_data = (valid_agendas).encode(); pallet_scheduler::migration::v3::MigrateToV4::::post_upgrade(encoded_data)?; @@ -211,7 +210,9 @@ mod nomination_pools { pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); #[cfg(feature = "try-runtime")] - pub(crate) fn pre_upgrade() -> Result, &'static str> { Ok(sp_std::vec![]) } + pub(crate) fn pre_upgrade() -> Result, &'static str> { + Ok(sp_std::vec![]) + } #[cfg(feature = "try-runtime")] pub(crate) fn post_upgrade(_state: Vec) -> Result<(), &'static str> { @@ -274,10 +275,7 @@ mod nomination_pools { #[cfg(feature = "try-runtime")] pub fn pre_upgrade() -> Result, &'static str> { let storage_version = NominationPools::on_chain_storage_version(); - log::info!( - "Old nomination pools storage version: {:?}", - storage_version - ); + log::info!("Old nomination pools storage version: {:?}", storage_version); Ok(sp_std::vec![]) } @@ -294,10 +292,7 @@ mod nomination_pools { #[cfg(feature = "try-runtime")] pub fn post_upgrade(_: Vec) -> Result<(), &'static str> { let storage_version = NominationPools::on_chain_storage_version(); - log::info!( - "New nomination pools storage version: {:?}", - storage_version - ); + log::info!("New nomination pools storage version: {:?}", storage_version); Ok(()) } } diff --git a/rustfmt.toml b/rustfmt.toml index 82b712fa8..7f2050368 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,10 +1,31 @@ -binop_separator = "Back" -comment_width = 120 -imports_granularity = "Crate" -max_width = 120 -reorder_imports = true -tab_spaces = 4 -trailing_semicolon = true +# Basic +edition = "2021" +hard_tabs = true +max_width = 100 use_small_heuristics = "Max" + +# Consistency +newline_style = "Unix" +# Misc +chain_width = 80 + +match_arm_leading_pipes = "Preserve" +match_block_trailing_comma = true + use_field_init_shorthand = true -wrap_comments = true + +# Disabled because we switched from nightly to stable +# +# binop_separator = "Back" +# match_arm_blocks = false +# trailing_comma = "Vertical" +# trailing_semicolon = false +# reorder_impl_items = false +# spaces_around_ranges = false +# binop_separator = "Back" +# Format comments +# comment_width = 100 +# wrap_comments = true +# Imports +# imports_granularity = "Crate" +# reorder_imports = true \ No newline at end of file