Skip to content

Commit

Permalink
fix: discontinued bucket can't migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryTong65 committed May 21, 2024
1 parent 1445fd1 commit b5bb0c8
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 can not migrate")
}

srcSP := k.MustGetPrimarySPForBucket(ctx, bucketInfo)

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

0 comments on commit b5bb0c8

Please sign in to comment.