mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 17:17:56 +00:00
Generalised Transaction Queue API (#741)
* First effort * API versioning * Introduce validate_transaction * Introduce the API plus fixes. * Docs * Typo * Add longevity parameter to transaction validity info.
This commit is contained in:
@@ -9,7 +9,7 @@ hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", default_features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
safe-mix = { version = "1.0", default_features = false}
|
||||
parity-codec = { version = "~1.0" }
|
||||
parity-codec = { version = "1.1" }
|
||||
parity-codec-derive = { version = "~1.0" }
|
||||
sr-std = { path = "../../core/sr-std" }
|
||||
sr-io = { path = "../../core/sr-io" }
|
||||
|
||||
@@ -68,7 +68,7 @@ use codec::{Encode, Decode, Input};
|
||||
use node_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature, InherentData};
|
||||
use runtime_primitives::generic;
|
||||
use runtime_primitives::traits::{Convert, BlakeTwo256, DigestItem};
|
||||
use version::RuntimeVersion;
|
||||
use version::{RuntimeVersion, ApiId};
|
||||
use council::{motions as council_motions, voting as council_voting};
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
@@ -82,6 +82,9 @@ pub use checked_block::CheckedBlock;
|
||||
const TIMESTAMP_SET_POSITION: u32 = 0;
|
||||
const NOTE_OFFLINE_POSITION: u32 = 1;
|
||||
|
||||
const INHERENT: ApiId = *b"inherent";
|
||||
const VALIDATX: ApiId = *b"validatx";
|
||||
|
||||
/// Runtime version.
|
||||
pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: ver_str!("node"),
|
||||
@@ -89,6 +92,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
authoring_version: 1,
|
||||
spec_version: 1,
|
||||
impl_version: 0,
|
||||
apis: apis_vec!([(INHERENT, 1), (VALIDATX, 1)]),
|
||||
};
|
||||
|
||||
impl system::Trait for Runtime {
|
||||
@@ -225,18 +229,19 @@ pub mod api {
|
||||
apply_extrinsic => |extrinsic| super::Executive::apply_extrinsic(extrinsic),
|
||||
execute_block => |block| super::Executive::execute_block(block),
|
||||
finalise_block => |()| super::Executive::finalise_block(),
|
||||
inherent_extrinsics => |(inherent, spec_version)| super::inherent_extrinsics(inherent, spec_version),
|
||||
inherent_extrinsics => |inherent| super::inherent_extrinsics(inherent),
|
||||
validator_count => |()| super::Session::validator_count(),
|
||||
validators => |()| super::Session::validators(),
|
||||
timestamp => |()| super::Timestamp::get(),
|
||||
random_seed => |()| super::System::random_seed(),
|
||||
account_nonce => |account| super::System::account_nonce(&account),
|
||||
lookup_address => |address| super::Balances::lookup_address(address)
|
||||
lookup_address => |address| super::Balances::lookup_address(address),
|
||||
validate_transaction => |tx| super::Executive::validate_transaction(tx)
|
||||
);
|
||||
}
|
||||
|
||||
/// Produces the list of inherent extrinsics.
|
||||
fn inherent_extrinsics(data: InherentData, _spec_version: u32) -> Vec<UncheckedExtrinsic> {
|
||||
fn inherent_extrinsics(data: InherentData) -> Vec<UncheckedExtrinsic> {
|
||||
let make_inherent = |function| UncheckedExtrinsic {
|
||||
signature: Default::default(),
|
||||
function,
|
||||
|
||||
Generated
+24
-23
@@ -270,7 +270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
name = "node-primitives"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -285,7 +285,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||
"node-primitives 0.1.0",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -340,7 +340,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec"
|
||||
version = "1.0.0"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -579,7 +579,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
@@ -595,7 +595,7 @@ dependencies = [
|
||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -608,7 +608,7 @@ dependencies = [
|
||||
name = "sr-sandbox"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
"sr-std 0.1.0",
|
||||
@@ -627,7 +627,7 @@ dependencies = [
|
||||
name = "sr-version"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -639,7 +639,7 @@ name = "srml-balances"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -658,7 +658,7 @@ name = "srml-consensus"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -674,7 +674,7 @@ dependencies = [
|
||||
name = "srml-contract"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -695,7 +695,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -717,7 +717,7 @@ name = "srml-democracy"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -737,7 +737,8 @@ name = "srml-executive"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -752,7 +753,7 @@ name = "srml-session"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -773,7 +774,7 @@ name = "srml-staking"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -798,7 +799,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mashup 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -812,7 +813,7 @@ name = "srml-system"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -829,7 +830,7 @@ name = "srml-timestamp"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -846,7 +847,7 @@ name = "srml-treasury"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -877,7 +878,7 @@ dependencies = [
|
||||
name = "substrate-metadata"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -892,7 +893,7 @@ dependencies = [
|
||||
"fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -918,7 +919,7 @@ dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1068,7 +1069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
|
||||
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
|
||||
"checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c"
|
||||
"checksum parity-codec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9260216bbb7acdbb72dfb6bcb63245ef5bde9a8fb7706fe641e1caf1e7ae460f"
|
||||
"checksum parity-codec 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bee4edfcfa19892f7178cb299a659866015dc131459865a1d808269cf7e7eb9e"
|
||||
"checksum parity-codec-derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1eda64d782c342261aea4ca047a609f9bd92d5f9dafabe6b5a396caf5c7b8827"
|
||||
"checksum parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1c91199d14bd5b78ecade323d4a891d094799749c1b9e82d9c590c2e2849a40"
|
||||
"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e"
|
||||
|
||||
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
|
||||
integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" }
|
||||
safe-mix = { version = "1.0", default_features = false}
|
||||
parity-codec-derive = { version = "~1.0" }
|
||||
parity-codec = { version = "~1.0", default-features = false }
|
||||
parity-codec = { version = "1.1", default-features = false }
|
||||
substrate-primitives = { path = "../../../core/primitives", default-features = false }
|
||||
sr-std = { path = "../../../core/sr-std", default-features = false }
|
||||
sr-io = { path = "../../../core/sr-io", default-features = false }
|
||||
|
||||
Reference in New Issue
Block a user