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:
Tadeo Hepperle
2023-04-17 10:40:48 +02:00
committed by GitHub
parent e642740081
commit 2997b1bdc3
7 changed files with 138 additions and 69 deletions
+4 -5
View File
@@ -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()?)
}