github.com/ethersphere/bee/v2@v2.2.0/pkg/pricer/mock/pricer.go (about) 1 // Copyright 2020 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 mock 6 7 import ( 8 "github.com/ethersphere/bee/v2/pkg/swarm" 9 ) 10 11 type MockPricer struct { 12 peerPrice uint64 13 price uint64 14 } 15 16 func NewMockService(price, peerPrice uint64) *MockPricer { 17 return &MockPricer{ 18 peerPrice: peerPrice, 19 price: price, 20 } 21 } 22 23 func (pricer *MockPricer) PeerPrice(peer, chunk swarm.Address) uint64 { 24 return pricer.peerPrice 25 } 26 27 func (pricer *MockPricer) Price(chunk swarm.Address) uint64 { 28 return pricer.price 29 }