diff --git a/disperser/apiserver/disperse_blob_v2.go b/disperser/apiserver/disperse_blob_v2.go index 2e76d3a45..4e3e8ca7d 100644 --- a/disperser/apiserver/disperse_blob_v2.go +++ b/disperser/apiserver/disperse_blob_v2.go @@ -118,7 +118,7 @@ func (s *DispersalServerV2) validateDispersalRequest(ctx context.Context, req *p return api.NewErrorInvalidArg("payment metadata is required") } - if len(blobHeader.PaymentMetadata.AccountID) == 0 || (blobHeader.PaymentMetadata.ReservationPeriod == 0 && blobHeader.PaymentMetadata.CumulativePayment == nil) { + if len(blobHeader.PaymentMetadata.AccountID) == 0 || (blobHeader.PaymentMetadata.ReservationPeriod == 0 && blobHeader.PaymentMetadata.CumulativePayment.Cmp(big.NewInt(0)) == 0) { return api.NewErrorInvalidArg("invalid payment metadata") } diff --git a/disperser/apiserver/server_v2_test.go b/disperser/apiserver/server_v2_test.go index 367d3c9bb..305b6bd43 100644 --- a/disperser/apiserver/server_v2_test.go +++ b/disperser/apiserver/server_v2_test.go @@ -223,7 +223,7 @@ func TestV2DisperseBlobRequestValidation(t *testing.T) { PaymentHeader: &pbcommon.PaymentHeader{ AccountId: accountID, ReservationPeriod: 0, - CumulativePayment: big.NewInt(100).Bytes(), + CumulativePayment: big.NewInt(0).Bytes(), }, } blobHeader, err := corev2.BlobHeaderFromProtobuf(invalidReqProto)