Match substrate's fmt (#1148)

* Alter gitlab.

* Use substrate's rustfmt.toml

* cargo +nightly fmt --all

* Fix spellcheck.

* cargo +nightly fmt --all

* format.

* Fix spellcheck and fmt

* fmt?

* Fix spellcheck

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
hacpy
2021-09-24 19:29:31 +08:00
committed by Bastian Köcher
parent 87cbb382d9
commit bd70de8b8b
174 changed files with 6095 additions and 4962 deletions
+13 -8
View File
@@ -18,7 +18,8 @@
use codec::Encode;
use relay_substrate_client::{
Chain, ChainBase, ChainWithBalances, TransactionEraOf, TransactionSignScheme, UnsignedTransaction,
Chain, ChainBase, ChainWithBalances, TransactionEraOf, TransactionSignScheme,
UnsignedTransaction,
};
use sp_core::{storage::StorageKey, Pair};
use sp_runtime::{generic::SignedPayload, traits::IdentifyAccount};
@@ -75,7 +76,13 @@ impl TransactionSignScheme for Kusama {
) -> Self::SignedTransaction {
let raw_payload = SignedPayload::new(
unsigned.call,
bp_kusama::SignedExtensions::new(bp_kusama::VERSION, era, genesis_hash, unsigned.nonce, unsigned.tip),
bp_kusama::SignedExtensions::new(
bp_kusama::VERSION,
era,
genesis_hash,
unsigned.nonce,
unsigned.tip,
),
)
.expect("SignedExtension never fails.");
@@ -98,17 +105,15 @@ impl TransactionSignScheme for Kusama {
fn is_signed_by(signer: &Self::AccountKeyPair, tx: &Self::SignedTransaction) -> bool {
tx.signature
.as_ref()
.map(|(address, _, _)| *address == bp_kusama::AccountId::from(*signer.public().as_array_ref()).into())
.map(|(address, _, _)| {
*address == bp_kusama::AccountId::from(*signer.public().as_array_ref()).into()
})
.unwrap_or(false)
}
fn parse_transaction(tx: Self::SignedTransaction) -> Option<UnsignedTransaction<Self::Chain>> {
let extra = &tx.signature.as_ref()?.2;
Some(UnsignedTransaction {
call: tx.function,
nonce: extra.nonce(),
tip: extra.tip(),
})
Some(UnsignedTransaction { call: tx.function, nonce: extra.nonce(), tip: extra.tip() })
}
}
+5 -3
View File
@@ -29,8 +29,8 @@ pub type UncheckedExtrinsic = bp_polkadot_core::UncheckedExtrinsic<Call>;
/// Polkadot account ownership digest from Kusama.
///
/// The byte vector returned by this function should be signed with a Polkadot account private key.
/// This way, the owner of `kusama_account_id` on Kusama proves that the Polkadot account private key
/// is also under his control.
/// This way, the owner of `kusama_account_id` on Kusama proves that the Polkadot account private
/// key is also under his control.
pub fn kusama_to_polkadot_account_ownership_digest<Call, AccountId, SpecVersion>(
polkadot_call: &Call,
kusama_account_id: AccountId,
@@ -128,7 +128,9 @@ pub enum BridgePolkadotMessagesCall {
),
#[codec(index = 6)]
receive_messages_delivery_proof(
bridge_runtime_common::messages::source::FromBridgedChainMessagesDeliveryProof<bp_polkadot::Hash>,
bridge_runtime_common::messages::source::FromBridgedChainMessagesDeliveryProof<
bp_polkadot::Hash,
>,
UnrewardedRelayersState,
),
}