Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Don't validate rewards config if epoch reward is set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Oct 31, 2023
1 parent 210b4e2 commit ea7821a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion command/genesis/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ func (p *genesisParams) predeployStakingSC() (*chain.GenesisAccount, error) {

// validateRewardWalletAndToken validates reward wallet flag
func (p *genesisParams) validateRewardWalletAndToken() error {
if p.epochReward == 0 {
return nil
}

if p.rewardWallet == "" {
return errRewardWalletNotDefined
}
Expand All @@ -495,7 +499,7 @@ func (p *genesisParams) validateRewardWalletAndToken() error {
}

// If epoch rewards are enabled, reward wallet must have some amount of premine
if p.epochReward > 0 && premineInfo.Amount.Cmp(big.NewInt(0)) < 1 {
if premineInfo.Amount.Cmp(big.NewInt(0)) < 1 {
return errRewardWalletAmountZero
}

Expand Down
1 change: 1 addition & 0 deletions command/rootchain/supernet/supernet.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func runCommand(cmd *cobra.Command, _ []string) error {
}

genesisAccsMap := make(map[types.Address]*validator.GenesisValidator, len(genesisAccounts))

for _, genesisAcc := range genesisAccounts {
genesisBalanceInput, err := genesisBalancesABIFn.Encode(genesisAcc.Address)
if err != nil {
Expand Down

0 comments on commit ea7821a

Please sign in to comment.