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

Load dposv3 when set in the loom.yml #1000

Merged
merged 2 commits into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/loom/loom.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func newRunCommand() *cobra.Command {
fnRegistry = fnConsensus.NewInMemoryFnRegistry()
}
var loaders []plugin.Loader
for _, loader := range cfg.ContractLoaders{
for _, loader := range cfg.ContractLoaders {
if strings.EqualFold("static", loader) {
loaders = append(loaders, common.NewDefaultContractsLoader(cfg))
}
Expand Down Expand Up @@ -979,8 +979,8 @@ func loadApp(chainID string, cfg *config.Config, loader plugin.Loader, b backend
if err != nil {
return nil, err
}
// DPOSv3 can only be enabled via feature flag
if state.FeatureEnabled(loomchain.DPOSVersion3Feature, false) {
// DPOSv3 can only be enabled via feature flag or if it's enabled via the loom.yml
if cfg.DPOSVersion == 3 || state.FeatureEnabled(loomchain.DPOSVersion3Feature, false) {
return plugin.NewValidatorsManagerV3(pvm.(*plugin.PluginVM))
} else if cfg.DPOSVersion == 2 {
return plugin.NewValidatorsManager(pvm.(*plugin.PluginVM))
Expand Down