github.com/ethersphere/bee/v2@v2.2.0/pkg/accounting/export_test.go (about)

     1  // Copyright 2021 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package accounting
     6  
     7  import (
     8  	"time"
     9  
    10  	"github.com/ethersphere/bee/v2/pkg/swarm"
    11  )
    12  
    13  func (a *Accounting) SetTimeNow(f func() time.Time) {
    14  	a.timeNow = f
    15  }
    16  
    17  func (a *Accounting) SetTime(k int64) {
    18  	a.SetTimeNow(func() time.Time {
    19  		return time.Unix(k, 0)
    20  	})
    21  }
    22  
    23  func (a *Accounting) IsPaymentOngoing(peer swarm.Address) bool {
    24  	return a.getAccountingPeer(peer).paymentOngoing
    25  }