-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SignedExtension matching logic and remove SkipCheckIfFeeless bits #1283
Conversation
180d601
to
f502aca
Compare
@@ -258,22 +243,11 @@ impl<T: Config> ChargeAssetTxPayment<T> { | |||
} | |||
|
|||
/// Parameters to configure the [`ChargeAssetTxPayment`] signed extension. | |||
#[derive(Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would never have worked anyway afaik, because T: Config
doesn't impl Debug
. Maybe I was a bit overzealous in removing a bunch of derives for these things though; I did initially replace them all with working ones and then backed out of it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, it simplifies the signed extension impls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the reasons why SkipCheckIfFeeless was introduced and why we don't need it as a singed extension in subxt anymore.
AFAIU, SkipCheckIfFeeless was introduced as "wrapper signed extension" that wrapped something like "ChargeTxPayment", initially the name of the signed extension was "SkipCheckIfFeeless" but that was reverted to propagate the name of the signed extension that was wrapped. Such SkipCheckIfFeeLess, its name will be "ChargeTxPayment" and not "SkipCheckIfFeeLess" |
Yup, a couple of Substrate PRs made the name return the innet signed ext name, and the typeinfo match the inner typeinfo, so |
2777864
to
e1b2a4a
Compare
Closes #1280.
SkipCheckIfFeeless
is now transparent to the outside world in the latest polkadot-sdk, so remove logic specific to that.SignedExtension::IDENTIFIER
and replace withSignedExtension::matches(..)
function which is able to do much more custom/intelligent matching to work out which of our signed extensions to use at which point (in part, just in case we have more complex things to do later, and in part just to provide the flexibility now for anybody that wants it).EncodeAsType
/DecodeAsType
on most of the exts now.ExtrinsicParamsError
rather thantype Error: Into<ExtrinsicParamsError>
.