mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +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:
@@ -17,7 +17,7 @@ use crate::{
|
||||
tx::TxClient,
|
||||
Config, Metadata,
|
||||
};
|
||||
use codec::{Compact, Decode};
|
||||
use codec::Compact;
|
||||
use derivative::Derivative;
|
||||
use frame_metadata::RuntimeMetadataPrefixed;
|
||||
use futures::future;
|
||||
@@ -136,10 +136,9 @@ impl<T: Config> OnlineClient<T> {
|
||||
|
||||
/// Fetch the metadata from substrate using the runtime API.
|
||||
async fn fetch_metadata(rpc: &Rpc<T>) -> Result<Metadata, Error> {
|
||||
let bytes = rpc.state_call("Metadata_metadata", None, None).await?;
|
||||
let cursor = &mut &*bytes;
|
||||
let _ = <Compact<u32>>::decode(cursor)?;
|
||||
let meta: RuntimeMetadataPrefixed = Decode::decode(cursor)?;
|
||||
let (_, meta) = rpc
|
||||
.state_call::<(Compact<u32>, RuntimeMetadataPrefixed)>("Metadata_metadata", None, None)
|
||||
.await?;
|
||||
Ok(meta.try_into()?)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user