Skip to content

Commit

Permalink
check limit status when migrate bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed May 23, 2024
1 parent 3ad0d51 commit fe94788
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/storage/keeper/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ func (k Keeper) ChargeBucketReadStoreFee(ctx sdk.Context, bucketInfo *storagetyp
}

if ctx.IsUpgraded(upgradetypes.Erdos) {
isRateLimited := k.IsBucketRateLimited(ctx, bucketInfo.BucketName)
if isRateLimited {
return fmt.Errorf("bucket is rate limited: %s", bucketInfo.BucketName)
}

err := k.isBucketFlowRateUnderLimit(ctx, sdk.MustAccAddressFromHex(bucketInfo.PaymentAddress), sdk.MustAccAddressFromHex(bucketInfo.Owner), bucketInfo.BucketName, bill)
if err != nil {
return err
Expand Down

0 comments on commit fe94788

Please sign in to comment.