-
Notifications
You must be signed in to change notification settings - Fork 330
/
setup.go
69 lines (56 loc) · 1.91 KB
/
setup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package e2e
import (
"os"
"strings"
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/ibc"
ethermintcrypto "github.com/evmos/ethermint/crypto/codec"
ethermint "github.com/evmos/ethermint/types"
)
var (
DymensionMainRepo = "ghcr.io/decentrio/dymension"
RollappMainRepo = "ghcr.io/decentrio/rollapp"
repo, version = GetDockerImageInfo()
dymensionImage = ibc.DockerImage{
Repository: repo,
Version: version,
UidGid: "1025:1025",
}
dymensionConfig = ibc.ChainConfig{
Type: "hub",
Name: "dymension",
ChainID: "dymension_100-1",
Images: []ibc.DockerImage{dymensionImage},
Bin: "dymd",
Bech32Prefix: "dym",
Denom: "udym",
CoinType: "118",
GasPrices: "0.0udym",
EncodingConfig: evmConfig(),
GasAdjustment: 1.1,
TrustingPeriod: "112h",
NoHostMount: false,
ModifyGenesis: nil,
ConfigFileOverrides: nil,
}
)
// GetDockerImageInfo returns the appropriate repo and branch version string for integration with the CI pipeline.
// The remote runner sets the BRANCH_CI env var. If present, tests will use the docker image pushed up to the repo.
// If testing locally, user should run `make docker-build-debug` and tests will use the local image.
func GetDockerImageInfo() (repo, version string) {
branchVersion, found := os.LookupEnv("BRANCH_CI")
repo = DymensionMainRepo
if !found {
branchVersion = "e2e"
}
// github converts / to - for pushed docker images
branchVersion = strings.ReplaceAll(branchVersion, "/", "-")
return repo, branchVersion
}
func evmConfig() *simappparams.EncodingConfig {
cfg := cosmos.DefaultEncoding()
ethermint.RegisterInterfaces(cfg.InterfaceRegistry)
ethermintcrypto.RegisterInterfaces(cfg.InterfaceRegistry)
return &cfg
}