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

Remove pub from various fields in exported types, notably in extrinsic::extra #390

Closed
jsdw opened this issue Jan 13, 2022 · 1 comment
Closed

Comments

@jsdw
Copy link
Collaborator

jsdw commented Jan 13, 2022

Various types, notably in crate::extrinsic::extra, expose their inner workings (including PhantomData) to the world, eg:

pub struct ChargeAssetTxPayment<T: Config> {
    /// The tip for the block author.
    #[codec(compact)]
    pub tip: u128,
    /// The asset with which to pay the tip.
    pub asset_id: Option<u32>,
    /// Marker for unused type parameter.
    pub marker: PhantomData<T>,
}

and

pub struct ChargeTransactionPayment<T: Config>(
    #[codec(compact)] u128,
    pub PhantomData<T>,
);

And others. We should have a pass over the types that we export, and in cases like the above we should provide a better interface for creating/accessing fields that hides details like PhantomData.

As it stands, I'm not sure that most of the types in extra are ever even instantiated and aren't just used at the type level, but I'm not entirely clear at the mo?

@jsdw
Copy link
Collaborator Author

jsdw commented Mar 31, 2022

This is no longer relevant after #490, which reworks this stuff.

@jsdw jsdw closed this as completed Mar 31, 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

No branches or pull requests

1 participant