Westend Mock Runtime and Client (#874)

* Copy-Pasta Call code from mock Rococo to mock Westend runtime

* Update Westend client to include signing and call related code

* Add missing part of license header

* Move `account_info_storage_key` to `polkadot-core` crate
This commit is contained in:
Hernando Castano
2021-04-07 19:50:16 -04:00
committed by Bastian Köcher
parent c6ae74725b
commit 81d4eb9ea6
8 changed files with 143 additions and 53 deletions
@@ -29,6 +29,8 @@ pub use bp_polkadot_core::*;
/// Westend Chain
pub type Westend = PolkadotLike;
pub type UncheckedExtrinsic = bp_polkadot_core::UncheckedExtrinsic<Call>;
/// Runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: sp_version::create_runtime_str!("westend"),
@@ -40,6 +42,22 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
transaction_version: 5,
};
#[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)]
pub enum Call {
MockModule,
}
impl sp_runtime::traits::Dispatchable for Call {
type Origin = ();
type Config = ();
type Info = ();
type PostInfo = ();
fn dispatch(self, _origin: Self::Origin) -> sp_runtime::DispatchResultWithInfo<Self::PostInfo> {
unimplemented!("The Call is not expected to be dispatched.")
}
}
// We use this to get the account on Westend (target) which is derived from Rococo's (source)
// account.
pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -> AccountId {