mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
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:
@@ -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};
|
||||
@@ -78,7 +79,13 @@ impl TransactionSignScheme for Rococo {
|
||||
) -> Self::SignedTransaction {
|
||||
let raw_payload = SignedPayload::new(
|
||||
unsigned.call,
|
||||
bp_rococo::SignedExtensions::new(bp_rococo::VERSION, era, genesis_hash, unsigned.nonce, unsigned.tip),
|
||||
bp_rococo::SignedExtensions::new(
|
||||
bp_rococo::VERSION,
|
||||
era,
|
||||
genesis_hash,
|
||||
unsigned.nonce,
|
||||
unsigned.tip,
|
||||
),
|
||||
)
|
||||
.expect("SignedExtension never fails.");
|
||||
|
||||
@@ -101,17 +108,15 @@ impl TransactionSignScheme for Rococo {
|
||||
fn is_signed_by(signer: &Self::AccountKeyPair, tx: &Self::SignedTransaction) -> bool {
|
||||
tx.signature
|
||||
.as_ref()
|
||||
.map(|(address, _, _)| *address == bp_rococo::AccountId::from(*signer.public().as_array_ref()).into())
|
||||
.map(|(address, _, _)| {
|
||||
*address == bp_rococo::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() })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user