github.com/ethersphere/bee/v2@v2.2.0/pkg/settlement/pseudosettle/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 pseudosettle 6 7 import ( 8 "context" 9 "time" 10 11 "github.com/ethersphere/bee/v2/pkg/p2p" 12 ) 13 14 func (s *Service) SetTimeNow(f func() time.Time) { 15 s.timeNow = f 16 } 17 18 func (s *Service) SetTime(k int64) { 19 s.SetTimeNow(func() time.Time { 20 return time.Unix(k, 0) 21 }) 22 } 23 24 func (s *Service) Init(ctx context.Context, peer p2p.Peer) error { 25 return s.init(ctx, peer) 26 } 27 28 func (s *Service) Terminate(peer p2p.Peer) error { 29 return s.terminate(peer) 30 }