Skip to content
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

Merged
merged 1 commit into from
Nov 17, 2021
Merged

Conversation

kvinwang
Copy link
Contributor

@kvinwang kvinwang commented Nov 12, 2021

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.

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 12, 2021

User @kvinwang, please sign the CLA here.

@h4x3rotab
Copy link
Contributor

h4x3rotab commented Nov 12, 2021

This should be an up-to-date version of #204

@@ -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;
Copy link
Collaborator

@jsdw jsdw Nov 15, 2021

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Parameters"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters sounds better. Renamed.

@kvinwang kvinwang changed the title Add custom config for SignedExtra Additional parameters for SignedExtra Nov 16, 2021
Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsdw jsdw merged commit dcb78a2 into paritytech:master Nov 17, 2021
0623forbidden pushed a commit to DEIPworld/substrate-subxt that referenced this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants