-
Notifications
You must be signed in to change notification settings - Fork 338
/
priceoracle.go
48 lines (37 loc) · 935 Bytes
/
priceoracle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2021 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mock
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum/common"
)
type Service struct {
rate *big.Int
deduct *big.Int
}
func New(rate, deduct *big.Int) Service {
return Service{
rate: rate,
deduct: deduct,
}
}
func (s Service) Start() {
}
func (s Service) GetPrice(ctx context.Context) (*big.Int, *big.Int, error) {
return s.rate, s.deduct, nil
}
func (s Service) CurrentRates() (exchangeRate, deduction *big.Int, err error) {
return s.rate, s.deduct, nil
}
func (s Service) Close() error {
return nil
}
func DiscoverPriceOracleAddress(chainID int64) (priceOracleAddress common.Address, found bool) {
return common.Address{}, false
}
func (s *Service) SetValues(rate, deduct *big.Int) {
s.rate = rate
s.deduct = deduct
}