-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
test_env_config.go
39 lines (32 loc) · 1.07 KB
/
test_env_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
package test_env
import (
"encoding/json"
ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config"
env "github.com/smartcontractkit/chainlink/integration-tests/types/envcommon"
)
type TestEnvConfig struct {
Networks []string `json:"networks"`
Geth GethConfig `json:"geth"`
MockAdapter MockAdapterConfig `json:"mock_adapter"`
ClCluster *ClCluster `json:"clCluster"`
EthereumNetworkConfig *ctf_config.EthereumNetworkConfig `json:"private_ethereum_config"`
}
type MockAdapterConfig struct {
ContainerName string `json:"container_name"`
ImpostersPath string `json:"imposters_path"`
}
type GethConfig struct {
ContainerName string `json:"container_name"`
}
func NewTestEnvConfigFromFile(path string) (*TestEnvConfig, error) {
c := &TestEnvConfig{}
err := env.ParseJSONFile(path, c)
if err != nil {
return nil, err
}
return c, nil
}
func (c *TestEnvConfig) Json() string {
b, _ := json.Marshal(c)
return string(b)
}