-
Notifications
You must be signed in to change notification settings - Fork 254
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
Additional parameters for SignedExtra #322
Conversation
This should be an up-to-date version of #204 |
src/extrinsic/extra.rs
Outdated
@@ -230,13 +230,16 @@ impl SignedExtension for ChargeTransactionPayment { | |||
pub trait SignedExtra<T: Config>: SignedExtension { | |||
/// The type the extras. | |||
type Extra: SignedExtension + Send + Sync; | |||
/// The extra config parameters. | |||
type Config: Default + Send + Sync; |
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.
Nit: I was initially a bit confused as there is also a Config
trait above. Perhaps this should be called something more unique (and vague) like Other
, since presumably its goal is simply to allow other arbitrary data to be provided?
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.
How about "Parameters"?
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.
Parameters sounds better. Renamed.
8cb31c3
to
8169327
Compare
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.
LGTM
We need to control the transaction longevity in our application. subxt does's have an API to do so.
We can use a custom SignedExtra implementation to fill the CheckMortality parameters. However, a custom SignedExtra has no way to be passed in extra infomation to construct the CheckMortality. This PR add an associated type to allow SignedExtra to carry some custom data to construct the signed extra. Check here for more detail.