Extract unsigned tx from the SignParam structure (#1561)

* change sign_transaction method

* clippy

* rustup update && clippy

* remove redudnant clone
This commit is contained in:
Svyatoslav Nikolsky
2022-08-30 13:58:37 +03:00
committed by Bastian Köcher
parent effe0f11c8
commit f35b4f4897
29 changed files with 434 additions and 402 deletions
@@ -101,31 +101,32 @@ impl TransactionSignScheme for RialtoParachain {
type AccountKeyPair = sp_core::sr25519::Pair;
type SignedTransaction = rialto_parachain_runtime::UncheckedExtrinsic;
fn sign_transaction(param: SignParam<Self>) -> Result<Self::SignedTransaction, SubstrateError> {
fn sign_transaction(
param: SignParam<Self>,
unsigned: UnsignedTransaction<Self::Chain>,
) -> Result<Self::SignedTransaction, SubstrateError> {
let raw_payload = SignedPayload::from_raw(
param.unsigned.call,
unsigned.call,
(
frame_system::CheckNonZeroSender::<rialto_parachain_runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<rialto_parachain_runtime::Runtime>::new(),
frame_system::CheckTxVersion::<rialto_parachain_runtime::Runtime>::new(),
frame_system::CheckGenesis::<rialto_parachain_runtime::Runtime>::new(),
frame_system::CheckEra::<rialto_parachain_runtime::Runtime>::from(
param.era.frame_era(),
),
frame_system::CheckNonce::<rialto_parachain_runtime::Runtime>::from(
param.unsigned.nonce,
unsigned.era.frame_era(),
),
frame_system::CheckNonce::<rialto_parachain_runtime::Runtime>::from(unsigned.nonce),
frame_system::CheckWeight::<rialto_parachain_runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<
rialto_parachain_runtime::Runtime,
>::from(param.unsigned.tip),
>::from(unsigned.tip),
),
(
(),
param.spec_version,
param.transaction_version,
param.genesis_hash,
param.era.signed_payload(param.genesis_hash),
unsigned.era.signed_payload(param.genesis_hash),
(),
(),
(),