mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Partial fee estimates for SubmittableExtrinsic (#910)
* add partial_fee estimation to submittable extrinsic * add integration test * make functions immune to doctest * add doc test * inline encoded_with_len, fix tests * fix test fmt * remove unused imoort * Bump h2 from 0.3.16 to 0.3.17 (#911) Bumps [h2](https://github.com/hyperium/h2) from 0.3.16 to 0.3.17. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.3.16...v0.3.17) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * call_raw returns Res: Decode * remove import * remove struct --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// see LICENSE for license details.
|
||||
|
||||
use crate::{client::OnlineClientT, error::Error, Config};
|
||||
use codec::Decode;
|
||||
use derivative::Derivative;
|
||||
use std::{future::Future, marker::PhantomData};
|
||||
|
||||
@@ -32,21 +33,21 @@ where
|
||||
Client: OnlineClientT<T>,
|
||||
{
|
||||
/// Execute a raw runtime API call.
|
||||
pub fn call_raw<'a>(
|
||||
pub fn call_raw<'a, Res: Decode>(
|
||||
&self,
|
||||
function: &'a str,
|
||||
call_parameters: Option<&'a [u8]>,
|
||||
) -> impl Future<Output = Result<Vec<u8>, Error>> + 'a {
|
||||
) -> impl Future<Output = Result<Res, Error>> + 'a {
|
||||
let client = self.client.clone();
|
||||
let block_hash = self.block_hash;
|
||||
// Ensure that the returned future doesn't have a lifetime tied to api.runtime_api(),
|
||||
// which is a temporary thing we'll be throwing away quickly:
|
||||
async move {
|
||||
let data = client
|
||||
let data: Res = client
|
||||
.rpc()
|
||||
.state_call(function, call_parameters, Some(block_hash))
|
||||
.await?;
|
||||
Ok(data.0)
|
||||
Ok(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user