Skip to content

Commit

Permalink
geneisis init fix for liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnukumavat committed Nov 9, 2022
1 parent e386730 commit 52a58d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x/liquidity/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func (genState GenesisState) Validate() error {
orderSet[order.PairId][order.Id] = struct{}{}
}
activeFarmerMap := map[string]ActiveFarmer{}
for i, activeFarmer := range appState.ActiveFarmers {
for i := len(appState.ActiveFarmers) - 1; i >= 0; i-- {
activeFarmer := appState.ActiveFarmers[i]
if activeFarmer.FarmedPoolCoin.IsPositive() {
if err := activeFarmer.Validate(); err != nil {
return fmt.Errorf("invalid active farmer at index %d: %w", i, err)
Expand All @@ -144,7 +145,8 @@ func (genState GenesisState) Validate() error {
return fmt.Errorf("active farmer at index %d has unknown pool id: %d", i, activeFarmer.PoolId)
}
if _, ok := activeFarmerMap[activeFarmer.Farmer]; ok {
return fmt.Errorf("active farmer at index %d has a duplicate farmer : %s", i, activeFarmer.Farmer)
continue
// return fmt.Errorf("active farmer at index %d has a duplicate farmer : %s", i, activeFarmer.Farmer)
}
activeFarmerMap[activeFarmer.Farmer] = activeFarmer
}
Expand Down

0 comments on commit 52a58d0

Please sign in to comment.