Improve SignedExtension matching logic and remove SkipCheckIfFeeless bits (#1283)

* First pass making matching on signed exts more general and handlng SkipCheckifFeeless

* remove unneeded derives (only exts we can decode into are handled by the user)

* No SkipCheckIfFeeless in integration tests either

* Cargo fmt

* Remove SkipCheckIfFeeless specific logic

* clippy

* matches to just return bool, not result

* remove now-invalid comment

* return error from find if .iter() errors
This commit is contained in:
James Wilson
2023-11-23 15:44:35 +00:00
committed by GitHub
parent 6855b1ffd2
commit 2c528854da
8 changed files with 138 additions and 383 deletions
+2 -3
View File
@@ -1,6 +1,6 @@
use codec::Encode;
use subxt::client::OfflineClientT;
use subxt::config::{Config, ExtrinsicParams, ExtrinsicParamsEncoder};
use subxt::config::{Config, ExtrinsicParams, ExtrinsicParamsEncoder, ExtrinsicParamsError};
use subxt_signer::sr25519::dev;
#[subxt::subxt(
@@ -66,14 +66,13 @@ impl CustomExtrinsicParamsBuilder {
// Describe how to fetch and then encode the params:
impl<T: Config> ExtrinsicParams<T> for CustomExtrinsicParams<T> {
type OtherParams = CustomExtrinsicParamsBuilder;
type Error = std::convert::Infallible;
// Gather together all of the params we will need to encode:
fn new<Client: OfflineClientT<T>>(
_nonce: u64,
client: Client,
other_params: Self::OtherParams,
) -> Result<Self, Self::Error> {
) -> Result<Self, ExtrinsicParamsError> {
Ok(Self {
genesis_hash: client.genesis_hash(),
tip: other_params.tip,