Skip to content

Commit

Permalink
fix: discontinued bucket can't be migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryTong65 committed May 23, 2024
1 parent 1445fd1 commit 7b3ce5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,10 @@ func (k Keeper) MigrateBucket(ctx sdk.Context, operator sdk.AccAddress, bucketNa
return types.ErrInvalidBucketStatus.Wrapf("The bucket already been migrating")
}

if bucketInfo.BucketStatus == types.BUCKET_STATUS_DISCONTINUED {
return types.ErrInvalidBucketStatus.Wrapf("The discontinued bucket cannot be migrated")
}

srcSP := k.MustGetPrimarySPForBucket(ctx, bucketInfo)

dstSP, found := k.spKeeper.GetStorageProvider(ctx, dstPrimarySPID)
Expand Down

0 comments on commit 7b3ce5d

Please sign in to comment.