Refactor: extract functions and types for creating extrinsics (#138)

* Extract extrinsic

* Extract extrinsic types to own module

* Fix compiler errors

* Fix warnings

* Fmt

* Pin wabt-sys to 0.7.1, it fails (on my machine) with 0.7.2

* Fix up tests

* Fmt

* Reexport RuntimeVersion
This commit is contained in:
Andrew Jones
2020-07-20 09:17:19 +01:00
committed by GitHub
parent 015a819759
commit cd6b8f43f1
8 changed files with 130 additions and 132 deletions
+1 -16
View File
@@ -27,7 +27,7 @@ use sp_runtime::{
};
use crate::{
extra::{
extrinsic::{
DefaultExtra,
SignedExtra,
},
@@ -40,7 +40,6 @@ use crate::{
sudo::Sudo,
system::System,
},
Encoded,
};
/// Runtime trait.
@@ -51,20 +50,6 @@ pub trait Runtime: System + Sized + Send + Sync + 'static {
type Extra: SignedExtra<Self> + Send + Sync + 'static;
}
/// Extra type.
pub type Extra<T> = <<T as Runtime>::Extra as SignedExtra<T>>::Extra;
/// UncheckedExtrinsic type.
pub type UncheckedExtrinsic<T> = sp_runtime::generic::UncheckedExtrinsic<
<T as System>::Address,
Encoded,
<T as Runtime>::Signature,
Extra<T>,
>;
/// SignedPayload type.
pub type SignedPayload<T> = sp_runtime::generic::SignedPayload<Encoded, Extra<T>>;
/// Concrete type definitions compatible with those in the default substrate `node_runtime`
///
/// # Note