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

Rename module generation structs for ModuleGen consistency #1320

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

mxz42
Copy link
Contributor

@mxz42 mxz42 commented Jan 13, 2023

folluw up for #1314 @dpc , also ACK @elsirion ?

Renaming the MintConfigGeneration to MintGen for consistency with ModuleGen.
Same for MintConfigGenerationParams -> MintGenParams.

same applies to the other modules.

Copy link
Contributor

@elsirion elsirion left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@dpc dpc Jan 13, 2023

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. 🤷

Copy link
Contributor Author

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

Copy link
Contributor

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.

@dpc dpc merged commit 872b7ea into fedimint:master Jan 13, 2023
@mxz42 mxz42 deleted the 202301/rename-module-configGen-structs branch January 13, 2023 22:17
@dpc
Copy link
Contributor

dpc commented Jan 15, 2023

@mxz42 I've just noticed that mints OutputOutcome is called ... OutputOutcome which creates a confusion. Seems like for all other stuff we name them LightningFoo, so at least for consistency we should fix it as well.

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.

3 participants