Skip to content

Commit

Permalink
refactor: remove DummyAccountant
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 18, 2024
1 parent 0bb7e2c commit 1519679
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
23 changes: 0 additions & 23 deletions api/clients/v2/accountant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions api/clients/v2/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1519679

Please sign in to comment.