-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
ocr_config.go
46 lines (39 loc) · 1.35 KB
/
ocr_config.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
package configtest
import (
"time"
"github.com/smartcontractkit/chainlink/core/config"
"github.com/smartcontractkit/chainlink/core/services/keystore/keys/ethkey"
)
var _ config.OCR1Config = &TestGeneralConfig{}
// OCRKeyBundleID returns the overridden value, if one exists.
func (c *TestGeneralConfig) OCRKeyBundleID() (string, error) {
if c.Overrides.OCRKeyBundleID.Valid {
return c.Overrides.OCRKeyBundleID.String, nil
}
return c.GeneralConfig.OCRKeyBundleID()
}
// OCRDatabaseTimeout returns the overridden value, if one exists.
func (c *TestGeneralConfig) OCRDatabaseTimeout() time.Duration {
if c.Overrides.OCRDatabaseTimeout != nil {
return *c.Overrides.OCRDatabaseTimeout
}
v, ok := c.GeneralConfig.GlobalOCRDatabaseTimeout()
if !ok {
return 1 * time.Second
}
return v
}
// OCRObservationTimeout returns the overridden value, if one exists.
func (c *TestGeneralConfig) OCRObservationTimeout() time.Duration {
if c.Overrides.OCRObservationTimeout != nil {
return *c.Overrides.OCRObservationTimeout
}
return c.GeneralConfig.OCRObservationTimeout()
}
// OCRTransmitterAddress returns the overridden value, if one exists.
func (c *TestGeneralConfig) OCRTransmitterAddress() (ethkey.EIP55Address, error) {
if c.Overrides.OCRTransmitterAddress != nil {
return *c.Overrides.OCRTransmitterAddress, nil
}
return c.GeneralConfig.OCRTransmitterAddress()
}