Skip to content

Commit

Permalink
refactor: remove dummy structs
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 17, 2024
1 parent 6dfb53b commit b135abd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
8 changes: 7 additions & 1 deletion api/clients/v2/accountant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
16 changes: 0 additions & 16 deletions core/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b135abd

Please sign in to comment.