mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 00:28:01 +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:
@@ -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