From b135abd6baf639a0638174687bc6db1ad73462b5 Mon Sep 17 00:00:00 2001 From: hopeyen Date: Tue, 17 Dec 2024 13:54:19 -0800 Subject: [PATCH] refactor: remove dummy structs --- api/clients/v2/accountant.go | 8 +++++++- core/data.go | 16 ---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/api/clients/v2/accountant.go b/api/clients/v2/accountant.go index 0eb613b82b..f5e1c920fa 100644 --- a/api/clients/v2/accountant.go +++ b/api/clients/v2/accountant.go @@ -184,7 +184,13 @@ func (a *Accountant) SetPaymentState(paymentState *disperser_rpc.GetPaymentState } if paymentState.GetReservation() == nil { - a.reservation = core.DummyReservedPayment() + a.reservation = &core.ReservedPayment{ + SymbolsPerSecond: 0, + StartTimestamp: 0, + EndTimestamp: 0, + QuorumNumbers: []uint8{}, + QuorumSplits: []byte{}, + } } else { a.reservation.SymbolsPerSecond = uint64(paymentState.GetReservation().GetSymbolsPerSecond()) a.reservation.StartTimestamp = uint64(paymentState.GetReservation().GetStartTimestamp()) diff --git a/core/data.go b/core/data.go index 0308230dd2..367faad32d 100644 --- a/core/data.go +++ b/core/data.go @@ -619,27 +619,11 @@ type ReservedPayment struct { QuorumSplits []byte } -func DummyReservedPayment() *ReservedPayment { - return &ReservedPayment{ - SymbolsPerSecond: 0, - StartTimestamp: 0, - EndTimestamp: 0, - QuorumNumbers: []uint8{}, - QuorumSplits: []byte{}, - } -} - type OnDemandPayment struct { // Total amount deposited by the user CumulativePayment *big.Int } -func DummyOnDemandPayment() *OnDemandPayment { - return &OnDemandPayment{ - CumulativePayment: big.NewInt(0), - } -} - type BlobVersionParameters struct { CodingRate uint32 MaxNumOperators uint32