diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 3343942cc1..d369bbb5f6 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -2473,9 +2473,11 @@ version = "2.0.0" dependencies = [ "jsonrpc-core 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives 2.0.0", + "node-runtime 2.0.0", "sr-primitives 2.0.0", "srml-contracts-rpc 2.0.0", "srml-system-rpc 2.0.0", + "srml-transaction-payment-rpc 2.0.0", "substrate-client 2.0.0", "substrate-transaction-pool 2.0.0", ] @@ -2534,6 +2536,7 @@ dependencies = [ "srml-system-rpc-runtime-api 2.0.0", "srml-timestamp 2.0.0", "srml-transaction-payment 2.0.0", + "srml-transaction-payment-rpc-runtime-api 2.0.0", "srml-treasury 2.0.0", "srml-utility 2.0.0", "substrate-client 2.0.0", @@ -4617,9 +4620,37 @@ dependencies = [ "srml-balances 2.0.0", "srml-support 2.0.0", "srml-system 2.0.0", + "srml-transaction-payment-rpc-runtime-api 2.0.0", "substrate-primitives 2.0.0", ] +[[package]] +name = "srml-transaction-payment-rpc" +version = "2.0.0" +dependencies = [ + "jsonrpc-core 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core-client 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-derive 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 2.0.0", + "srml-transaction-payment-rpc-runtime-api 2.0.0", + "substrate-client 2.0.0", + "substrate-primitives 2.0.0", + "substrate-rpc-primitives 2.0.0", +] + +[[package]] +name = "srml-transaction-payment-rpc-runtime-api" +version = "2.0.0" +dependencies = [ + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 2.0.0", + "sr-std 2.0.0", + "substrate-client 2.0.0", +] + [[package]] name = "srml-treasury" version = "2.0.0" diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml index 2c1e361fc9..2d68511b2e 100644 --- a/substrate/Cargo.toml +++ b/substrate/Cargo.toml @@ -82,6 +82,7 @@ members = [ "srml/aura", "srml/balances", "srml/contracts", + "srml/contracts/rpc", "srml/collective", "srml/democracy", "srml/elections", @@ -109,6 +110,7 @@ members = [ "srml/timestamp", "srml/treasury", "srml/transaction-payment", + "srml/transaction-payment/rpc", "srml/utility", "node/cli", "node/executor", diff --git a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs index c7bff1f4c8..befa857dff 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs @@ -23,6 +23,7 @@ use codec::{Decode, Encode, EncodeLike, Input, Error}; use crate::{ traits::{self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic, IdentifyAccount}, generic::CheckedExtrinsic, transaction_validity::{TransactionValidityError, InvalidTransaction}, + weights::{GetDispatchInfo, DispatchInfo}, }; const TRANSACTION_VERSION: u8 = 4; @@ -280,6 +281,17 @@ where } } +impl
GetDispatchInfo + for UncheckedExtrinsic +where + Call: GetDispatchInfo, + Extra: SignedExtension, +{ + fn get_dispatch_info(&self) -> DispatchInfo { + self.function.get_dispatch_info() + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/substrate/core/sr-primitives/src/weights.rs b/substrate/core/sr-primitives/src/weights.rs index 89852eb595..088f13244e 100644 --- a/substrate/core/sr-primitives/src/weights.rs +++ b/substrate/core/sr-primitives/src/weights.rs @@ -35,9 +35,13 @@ //! Note that the decl_module macro _cannot_ enforce this and will simply fail if an invalid struct //! (something that does not implement `Weighable`) is passed in. +#[cfg(feature = "std")] +use serde::{Serialize, Deserialize}; +use codec::{Encode, Decode}; use arithmetic::traits::Bounded; use crate::RuntimeDebug; +/// Re-export priority as type pub use crate::transaction_validity::TransactionPriority; /// Numeric range of a transaction weight. @@ -58,10 +62,10 @@ pub trait ClassifyDispatch,
+}
+
+impl