-
Notifications
You must be signed in to change notification settings - Fork 145
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
feat(cmd): add transport switch in flag start daemon #1681
base: main
Are you sure you want to change the base?
feat(cmd): add transport switch in flag start daemon #1681
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1681 +/- ##
==========================================
+ Coverage 75.07% 76.34% +1.26%
==========================================
Files 234 242 +8
Lines 12156 18620 +6464
==========================================
+ Hits 9126 14215 +5089
- Misses 2582 3943 +1361
- Partials 448 462 +14 |
I feel we can simplify it even further. Instead of defining a modifier per config, we could have a function like |
) { | ||
conf, gen, err := MakeConfig(workingDir) | ||
func StartNode(workingDir string, passwordFetcher func(*wallet.Wallet) (string, bool), | ||
confModifiers ...config.Modifier, |
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.
confModifiers ...config.Modifier, | |
modifier func(*config.Config) *config.Config, |
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.
@b00f Why modifier return Config
? Modifier just applied changes on loaded configuration.
@@ -498,6 +498,10 @@ func MakeConfig(workingDir string) (*config.Config, *genesis.Genesis, error) { | |||
conf.WalletManager.ChainType = chainType | |||
conf.WalletManager.WalletsDir = walletsDir | |||
|
|||
for _, modify := range confModifiers { |
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.
if modifier != nil {
conf = modifier(conf)
}
Description
Add transport switch in flag start pactus-daemon.
Related issue(s)