Skip to content

Commit

Permalink
remove duplicate validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim committed Dec 11, 2024
1 parent 63d53f5 commit 3dc1bd2
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions disperser/apiserver/disperse_blob_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,19 @@ func (s *DispersalServerV2) validateDispersalRequest(ctx context.Context, req *p
// }

// handle payments and check rate limits
// if blobHeaderProto.GetPaymentHeader() != nil {
// binIndex := blobHeaderProto.GetPaymentHeader().GetBinIndex()
// cumulativePayment := new(big.Int).SetBytes(blobHeaderProto.GetPaymentHeader().GetCumulativePayment())
// accountID := blobHeaderProto.GetPaymentHeader().GetAccountId()

// paymentHeader := core.PaymentMetadata{
// AccountID: accountID,
// BinIndex: binIndex,
// CumulativePayment: cumulativePayment,
// }

// err := s.meterer.MeterRequest(ctx, paymentHeader, blobLength, blobHeader.QuorumNumbers)
// if err != nil {
// return api.NewErrorResourceExhausted(err.Error())
// }
// } else {
// return api.NewErrorInvalidArg("payment header is required")
// binIndex := blobHeaderProto.GetPaymentHeader().GetBinIndex()
// cumulativePayment := new(big.Int).SetBytes(blobHeaderProto.GetPaymentHeader().GetCumulativePayment())
// accountID := blobHeaderProto.GetPaymentHeader().GetAccountId()

// paymentHeader := core.PaymentMetadata{
// AccountID: accountID,
// BinIndex: binIndex,
// CumulativePayment: cumulativePayment,
// }

// err := s.meterer.MeterRequest(ctx, paymentHeader, blobLength, blobHeader.QuorumNumbers)
// if err != nil {
// return api.NewErrorResourceExhausted(err.Error())
// }

commitments, err := s.prover.GetCommitmentsForPaddedLength(data)
Expand Down

0 comments on commit 3dc1bd2

Please sign in to comment.