From 15667634fcb556fa96fea9bf70a7666931c8195c Mon Sep 17 00:00:00 2001 From: Alexgao001 Date: Thu, 9 Nov 2023 20:10:06 +0800 Subject: [PATCH] fix bucket status causing event emitted --- x/storage/keeper/keeper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index 6e7c4f2c2..636bb3ed9 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -469,7 +469,7 @@ func (k Keeper) DiscontinueBucket(ctx sdk.Context, operator sdk.AccAddress, buck if count+1 > max { return types.ErrNoMoreDiscontinue.Wrapf("no more buckets can be requested in this window") } - + previousStatus := bucketInfo.BucketStatus bucketInfo.BucketStatus = types.BUCKET_STATUS_DISCONTINUED store := ctx.KVStore(k.storeKey) @@ -481,7 +481,7 @@ func (k Keeper) DiscontinueBucket(ctx sdk.Context, operator sdk.AccAddress, buck k.appendDiscontinueBucketIds(ctx, deleteAt, []sdkmath.Uint{bucketInfo.Id}) k.SetDiscontinueBucketCount(ctx, operator, count+1) - if bucketInfo.BucketStatus == types.BUCKET_STATUS_MIGRATING { + if previousStatus == types.BUCKET_STATUS_MIGRATING { if err := ctx.EventManager().EmitTypedEvents(&types.EventCancelMigrationBucket{ Operator: operator.String(), BucketName: bucketInfo.BucketName,