diff --git a/core/auth/payment_signer.go b/core/auth/payment_signer.go index 17127e9e08..9905b0872e 100644 --- a/core/auth/payment_signer.go +++ b/core/auth/payment_signer.go @@ -30,8 +30,8 @@ func NewPaymentSigner(privateKeyHex string) *PaymentSigner { } } +// SignBlobPayment signs the payment header and returns the signature func (s *PaymentSigner) SignBlobPayment(header *commonpb.PaymentHeader) ([]byte, error) { - // Set the account id to the hex encoded public key of the signer header.AccountId = s.GetAccountID() pm := core.ConvertPaymentHeader(header) hash := pm.Hash() diff --git a/core/auth/payment_signer_test.go b/core/auth/payment_signer_test.go index 2d513a1eeb..4ba7c872a4 100644 --- a/core/auth/payment_signer_test.go +++ b/core/auth/payment_signer_test.go @@ -12,9 +12,7 @@ import ( ) func TestPaymentSigner(t *testing.T) { - // Generate a new private key for testing privateKey, err := crypto.GenerateKey() - // publicKey := &privateKey.PublicKey require.NoError(t, err) privateKeyHex := hex.EncodeToString(crypto.FromECDSA(privateKey)) diff --git a/core/meterer/meterer.go b/core/meterer/meterer.go index 94972b1f95..f00327565f 100644 --- a/core/meterer/meterer.go +++ b/core/meterer/meterer.go @@ -239,16 +239,13 @@ func (m *Meterer) ValidatePayment(ctx context.Context, header core.PaymentMetada // PaymentCharged returns the chargeable price for a given data length func (m *Meterer) PaymentCharged(dataLength uint) uint64 { - fmt.Println("PaymentCharged", dataLength, m.SymbolsCharged(dataLength), m.ChainPaymentState.GetPricePerSymbol()) return uint64(m.SymbolsCharged(dataLength)) * uint64(m.ChainPaymentState.GetPricePerSymbol()) } // SymbolsCharged returns the number of symbols charged for a given data length // being at least MinNumSymbols or the nearest rounded-up multiple of MinNumSymbols. func (m *Meterer) SymbolsCharged(dataLength uint) uint32 { - fmt.Println("SymbolsCharged", dataLength, m.ChainPaymentState.GetMinNumSymbols()) if dataLength <= uint(m.ChainPaymentState.GetMinNumSymbols()) { - fmt.Println("return ", m.ChainPaymentState.GetMinNumSymbols()) return m.ChainPaymentState.GetMinNumSymbols() } // Round up to the nearest multiple of MinNumSymbols diff --git a/core/meterer/onchain_state.go b/core/meterer/onchain_state.go index c1c77c2c04..1f957f8d77 100644 --- a/core/meterer/onchain_state.go +++ b/core/meterer/onchain_state.go @@ -187,7 +187,6 @@ func (pcs *OnchainPaymentState) GetOnDemandPaymentByAccount(ctx context.Context, } func (pcs *OnchainPaymentState) GetOnDemandPaymentByAccountOnChain(ctx context.Context, accountID string) (core.OnDemandPayment, error) { - // pulls the chain state blockNumber, err := pcs.tx.GetCurrentBlockNumber(ctx) if err != nil { return core.OnDemandPayment{}, err diff --git a/disperser/apiserver/server_test.go b/disperser/apiserver/server_test.go index 4b06fd1d47..43fbba993a 100644 --- a/disperser/apiserver/server_test.go +++ b/disperser/apiserver/server_test.go @@ -208,7 +208,6 @@ func TestDisperseBlobWithInvalidQuorum(t *testing.T) { } ctx := peer.NewContext(context.Background(), p) - // (*dispersalServer).tx.On("GetRequiredQuorumNumbers", tmock.Anything).Return([]uint8{0, 1}, nil).Twice() _, err = dispersalServer.DisperseBlob(ctx, &pb.DisperseBlobRequest{ Data: data, CustomQuorumNumbers: []uint32{2},