From 151967990f043e8e30184b5eaf7f8f24c6b29d80 Mon Sep 17 00:00:00 2001 From: hopeyen <60078528+hopeyen@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:00:02 +0000 Subject: [PATCH] refactor: remove DummyAccountant --- api/clients/v2/accountant.go | 23 ----------------------- api/clients/v2/disperser_client.go | 9 --------- 2 files changed, 32 deletions(-) diff --git a/api/clients/v2/accountant.go b/api/clients/v2/accountant.go index 1428e3ac7..4d1f80500 100644 --- a/api/clients/v2/accountant.go +++ b/api/clients/v2/accountant.go @@ -62,29 +62,6 @@ func NewAccountant(accountID string, reservation *core.ReservedPayment, onDemand return &a } -func DummyAccountant(accountID string) *Accountant { - return &Accountant{ - accountID: accountID, - reservation: &core.ReservedPayment{ - SymbolsPerSecond: 0, - StartTimestamp: 0, - EndTimestamp: 0, - QuorumNumbers: []uint8{}, - QuorumSplits: []byte{}, - }, - onDemand: &core.OnDemandPayment{ - CumulativePayment: big.NewInt(0), - }, - reservationWindow: 0, - pricePerSymbol: 0, - minNumSymbols: 0, - binRecords: make([]BinRecord, 3), - usageLock: sync.Mutex{}, - cumulativePayment: big.NewInt(0), - numBins: uint32(meterer.MinNumBins), - } -} - // BlobPaymentInfo calculates and records payment information. The accountant // will attempt to use the active reservation first and check for quorum settings, // then on-demand if the reservation is not available. The returned values are diff --git a/api/clients/v2/disperser_client.go b/api/clients/v2/disperser_client.go index 647091128..14ea0688b 100644 --- a/api/clients/v2/disperser_client.go +++ b/api/clients/v2/disperser_client.go @@ -75,15 +75,6 @@ func NewDisperserClient(config *DisperserClientConfig, signer corev2.BlobRequest return nil, api.NewErrorInvalidArg("signer must be provided") } - // Initialize the accountant if it is not provided - if accountant == nil { - accountID, err := signer.GetAccountID() - if err != nil { - return nil, fmt.Errorf("error getting signer's account ID: %w", err) - } - accountant = DummyAccountant(accountID) - } - return &disperserClient{ config: config, signer: signer,