Skip to content

Commit

Permalink
readbility
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Dec 3, 2024
1 parent b85430e commit 4f611a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/v2/appmanager/appmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ func (a appManager[T]) InitGenesis(
return nil, nil, fmt.Errorf("failed to apply block zero state changes to genesis state: %w", err)
}

// override validator updates with the ones from the genesis state
// override validator updates with the ones from the init genesis state
// this triggers only when x/staking or another module that returns validator updates in InitGenesis
// otherwise, genutil validator updates takes precedence (returned from executing the genesis txs (as it implements appmodule.GenesisDecoder) in the end block)
if len(valUpdates) > 0 && len(blockResponse.ValidatorUpdates) == 0 {
blockResponse.ValidatorUpdates = valUpdates
}

if len(valUpdates) > 0 && len(blockResponse.ValidatorUpdates) > 0 {
return nil, nil, errors.New("validator updates returned from InitGenesis and genesis transactions, only one can be used")
}

if len(valUpdates) > 0 {
blockResponse.ValidatorUpdates = valUpdates
}

return blockResponse, genesisState, err
}

Expand Down

0 comments on commit 4f611a2

Please sign in to comment.