Skip to content

Commit

Permalink
security tall regardless of end time
Browse files Browse the repository at this point in the history
  • Loading branch information
skyargos committed Oct 21, 2024
1 parent 7dafa99 commit e6991b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/shentufoundation/shentu/v2/common"
"github.com/shentufoundation/shentu/v2/x/gov/keeper"
)

Expand Down Expand Up @@ -162,7 +163,7 @@ func processActiveProposal(ctx sdk.Context, k *keeper.Keeper, logger log.Logger)
return false, err
}
}
return true, nil
return false, nil
}
}

Expand Down Expand Up @@ -311,7 +312,9 @@ func processSecurityVote(ctx sdk.Context, k *keeper.Keeper, logger log.Logger) e
passes bool
tallyResults govtypesv1.TallyResult
)
rng := collections.NewPrefixUntilPairRange[time.Time, uint64](ctx.BlockTime())
// Iterate over all active proposals, regardless of end time, so that
// security voting can end as soon as a passing threshold is met.
rng := collections.NewPrefixUntilPairRange[time.Time, uint64](time.Unix(common.MaxTimestamp, 0))
err := k.ActiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) {
proposal, err := k.Proposals.Get(ctx, key.K2())
if err != nil {
Expand Down

0 comments on commit e6991b0

Please sign in to comment.