-
Notifications
You must be signed in to change notification settings - Fork 224
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
Rename module generation structs for ModuleGen
consistency
#1320
Rename module generation structs for ModuleGen
consistency
#1320
Conversation
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.
Unclear on the params, otherwise LGTM. Leaving the merge to @dpc
@@ -801,14 +799,14 @@ mod tests { | |||
FakeFed::<Mint>::new( | |||
4, | |||
|cfg, _db| async move { Ok(Mint::new(cfg.to_typed().unwrap())) }, | |||
&ConfigGenParams::new().attach(MintConfigGenParams { | |||
&ConfigGenParams::new().attach(MintGenParams { |
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.
These parameters are only used to generate config, not to generate the module instance itself. So keeping the Config
part in the name might be reasonable. But I'd be ok with it for brevity.
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.
good point. Might be worth leaving as is. There is also the trait that should be renamed if we rename the struct.
impl ModuleConfigGenParams for MintGenParams { // previoulsy MintConfigGenParams
const MODULE_NAME: &'static str = "mint";
}
So, I think it's usefull to keep config
in the name then? @dpc
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.
Generating the config in a way is generating the module instance, at least from the higher level PoV.
"The module (instance)" is deterministically defined by the (type, config)
tuple. (there's env, but it's more like injecting external connectivity runtime settings, so can be ignored).
So I think it's fair to say that "when we generate config, we generate the module".
Plus it's shorter. 🤷
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.
ok.
then the trait ModuleConfigGenParams
should be renamed to ModuleGenParams
, so we have a consistent impl ModuleGenParams for MintGenParams
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.
@mxz42 👍 I leave it up to you.
@mxz42 I've just noticed that mints |
folluw up for #1314 @dpc , also ACK @elsirion ?
Renaming the
MintConfigGeneration
toMintGen
for consistency withModuleGen
.Same for
MintConfigGenerationParams
->MintGenParams
.same applies to the other modules.