Skip to content

Commit

Permalink
Merge pull request #594 from yutianwu/fix_delete_bucket
Browse files Browse the repository at this point in the history
fix: add upgrade check when deleting rate limit status
  • Loading branch information
yutianwu authored Mar 15, 2024
2 parents ad2660a + 664a6a1 commit f28b240
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import (

"cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gogoproto/proto"

"github.com/bnb-chain/greenfield/internal/sequence"
gnfdtypes "github.com/bnb-chain/greenfield/types"
types2 "github.com/bnb-chain/greenfield/types"
Expand All @@ -18,13 +26,6 @@ import (
sptypes "github.com/bnb-chain/greenfield/x/sp/types"
"github.com/bnb-chain/greenfield/x/storage/types"
virtualgroupmoduletypes "github.com/bnb-chain/greenfield/x/virtualgroup/types"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gogoproto/proto"
)

type (
Expand Down Expand Up @@ -269,8 +270,10 @@ func (k Keeper) doDeleteBucket(ctx sdk.Context, operator sdk.AccAddress, bucketI
}
}

// delete bucket flow rate limit status
k.deleteBucketFlowRateLimitStatus(ctx, bucketInfo.BucketName)
if ctx.IsUpgraded(upgradetypes.Serengeti) {
// delete bucket flow rate limit status
k.deleteBucketFlowRateLimitStatus(ctx, bucketInfo.BucketName)
}
return nil
}

Expand Down

0 comments on commit f28b240

Please sign in to comment.