mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 18:28:03 +00:00
RPC to query transaction fee + weight + info (#3876)
* initial version for testing * New version that compiles * optional at block parameter * Fix some more view grumbles. * Update srml/transaction-payment/src/lib.rs
This commit is contained in:
@@ -52,6 +52,7 @@ timestamp = { package = "srml-timestamp", path = "../../srml/timestamp", default
|
||||
treasury = { package = "srml-treasury", path = "../../srml/treasury", default-features = false }
|
||||
utility = { package = "srml-utility", path = "../../srml/utility", default-features = false }
|
||||
transaction-payment = { package = "srml-transaction-payment", path = "../../srml/transaction-payment", default-features = false }
|
||||
transaction-payment-rpc-runtime-api = { package = "srml-transaction-payment-rpc-runtime-api", path = "../../srml/transaction-payment/rpc/runtime-api/", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.4", path = "../../core/utils/wasm-builder-runner" }
|
||||
@@ -103,5 +104,6 @@ std = [
|
||||
"treasury/std",
|
||||
"utility/std",
|
||||
"transaction-payment/std",
|
||||
"transaction-payment-rpc-runtime-api/std",
|
||||
"version/std",
|
||||
]
|
||||
|
||||
@@ -50,6 +50,8 @@ use version::NativeVersion;
|
||||
use primitives::OpaqueMetadata;
|
||||
use grandpa::{AuthorityId as GrandpaId, AuthorityWeight as GrandpaWeight};
|
||||
use im_online::sr25519::{AuthorityId as ImOnlineId};
|
||||
use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
|
||||
use contracts_rpc_runtime_api::ContractExecResult;
|
||||
use system::offchain::TransactionSubmitter;
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
@@ -661,9 +663,7 @@ impl_runtime_apis! {
|
||||
value: Balance,
|
||||
gas_limit: u64,
|
||||
input_data: Vec<u8>,
|
||||
) -> contracts_rpc_runtime_api::ContractExecResult {
|
||||
use contracts_rpc_runtime_api::ContractExecResult;
|
||||
|
||||
) -> ContractExecResult {
|
||||
let exec_result = Contracts::bare_call(
|
||||
origin,
|
||||
dest.into(),
|
||||
@@ -681,9 +681,20 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<
|
||||
Block,
|
||||
Balance,
|
||||
UncheckedExtrinsic,
|
||||
> for Runtime {
|
||||
fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {
|
||||
TransactionPayment::query_info(uxt, len)
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_session::SessionKeys<Block> for Runtime {
|
||||
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
|
||||
let seed = seed.as_ref().map(|s| rstd::str::from_utf8(&s).expect("Seed is an utf8 string"));
|
||||
let seed = seed.as_ref().map(|s| rstd::str::from_utf8(&s)
|
||||
.expect("Seed is an utf8 string"));
|
||||
SessionKeys::generate(seed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user