Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaninja committed Jul 23, 2023
1 parent 9c5f504 commit 391a41c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions polkadot-parachain/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use sc_client_api::BlockBackend;
use sp_core::{Pair, H256};
use sp_inherents::{InherentData, InherentDataProvider};
use sp_keyring::Sr25519Keyring;
use sp_runtime::{generic, traits::SignedExtension, OpaqueExtrinsic, SaturatedConversion};
use sp_runtime::{
generic, generic::UncheckedExtrinsic, traits::SignedExtension, MultiAddress, OpaqueExtrinsic,
SaturatedConversion,
};

use cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider;
use parachains_common::BlockNumber;
Expand Down Expand Up @@ -369,19 +372,20 @@ where
let genesis_hash = self.client.block_hash(0).ok().flatten().expect("Genesis block exists");
let best_hash = self.client.chain_info().best_hash;
let payload = generic::SignedPayload::<RuntimeCall, SignedExtra>::from_raw(
call.clone().into(),
call.clone(),
extra.clone(),
Extra::get_additional_signed(genesis_hash, best_hash),
);

let sender = Sr25519Keyring::Bob.pair();
let signature = payload.using_encoded(|x| sender.sign(x));
let extrinsic = generic::UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(sender.public()),
parachains_common::Signature::Sr25519(signature),
extra,
);
let extrinsic: UncheckedExtrinsic<MultiAddress<_, ()>, _, _, _> =
UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(sender.public()).into(),
parachains_common::Signature::Sr25519(signature),
extra,
);

Ok(extrinsic.into())
}
Expand Down

0 comments on commit 391a41c

Please sign in to comment.