-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added integration test for mint msg
- Loading branch information
1 parent
fbb36f0
commit b10b3ab
Showing
15 changed files
with
841 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package cli | ||
|
||
import ( | ||
upgradeV3 "github.com/cheqd/cheqd-node/app/upgrades/v3" | ||
integrationcli "github.com/cheqd/cheqd-node/tests/integration/cli" | ||
integrationnetwork "github.com/cheqd/cheqd-node/tests/integration/network" | ||
) | ||
|
||
const ( | ||
CliBinaryName = integrationcli.CliBinaryName | ||
Green = integrationcli.Green | ||
Purple = integrationcli.Purple | ||
) | ||
|
||
const ( | ||
KeyringBackend = integrationcli.KeyringBackend | ||
OutputFormat = integrationcli.OutputFormat | ||
Gas = integrationcli.Gas | ||
GasAdjustment = integrationcli.GasAdjustment | ||
GasPrices = integrationcli.GasPrices | ||
|
||
BootstrapPeriod = 20 | ||
BootstrapHeight = 1 | ||
VotingPeriod int64 = 10 | ||
ExpectedBlockSeconds int64 = 1 | ||
ExtraBlocks int64 = 10 | ||
UpgradeName = upgradeV3.UpgradeName | ||
DepositAmount = "10000000ncheq" | ||
NetworkConfigDir = "network-config" | ||
KeyringDir = "keyring-test" | ||
) | ||
|
||
var ( | ||
TXParams = []string{ | ||
"--keyring-backend", KeyringBackend, | ||
"--chain-id", integrationnetwork.ChainID, | ||
"-y", | ||
} | ||
GasParams = []string{ | ||
"--gas", Gas, | ||
"--gas-adjustment", GasAdjustment, | ||
"--gas-prices", GasPrices, | ||
} | ||
QueryParamsConst = []string{ | ||
"--chain-id", integrationnetwork.ChainID, | ||
"--output", OutputFormat, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
"path/filepath" | ||
|
||
errorsmod "cosmossdk.io/errors" | ||
) | ||
|
||
const ( | ||
DockerLocalnetPath = "../../../../docker/localnet" | ||
DockerComposeFile = "docker-compose.yml" | ||
DockerComposeEnvML = "mainnet-latest.env" | ||
DockerComposeEnvBL = "build-latest.env" | ||
Docker = "docker" | ||
DockerCompose = "compose" | ||
DockerHome = "/home/cheqd" | ||
DockerUser = "cheqd" | ||
DockerUserGroup = "cheqd" | ||
Operator0 = "operator-0" | ||
Operator1 = "operator-1" | ||
Operator2 = "operator-2" | ||
Operator3 = "operator-3" | ||
Validator0 = "validator-0" | ||
Validator1 = "validator-1" | ||
Validator2 = "validator-2" | ||
Validator3 = "validator-3" | ||
ValidatorsCount = 4 | ||
) | ||
|
||
type OperatorAccountType map[string]string | ||
|
||
var OperatorAccounts = OperatorAccountType{ | ||
Validator0: Operator0, | ||
Validator1: Operator1, | ||
Validator2: Operator2, | ||
Validator3: Operator3, | ||
} | ||
|
||
var ValidatorNodes = []string{Validator0, Validator1, Validator2, Validator3} | ||
|
||
var ( | ||
DockerComposeLatestArgs = []string{ | ||
"-f", filepath.Join(DockerLocalnetPath, DockerComposeFile), | ||
"--env-file", filepath.Join(DockerLocalnetPath, DockerComposeEnvML), | ||
} | ||
DockerComposeBuildArgs = []string{ | ||
"-f", filepath.Join(DockerLocalnetPath, DockerComposeFile), | ||
"--env-file", filepath.Join(DockerLocalnetPath, DockerComposeEnvBL), | ||
} | ||
) | ||
|
||
func LocalnetExec(envArgs []string, args ...string) (string, error) { | ||
args = append(append([]string{DockerCompose}, envArgs...), args...) | ||
cmd := exec.Command(Docker, args...) | ||
out, err := cmd.CombinedOutput() | ||
if err != nil { | ||
return string(out), errorsmod.Wrap(err, string(out)) | ||
} | ||
return string(out), err | ||
} | ||
|
||
func LocalnetExecExec(container string, args ...string) (string, error) { | ||
args = append([]string{"exec", container}, args...) | ||
return LocalnetExec(DockerComposeLatestArgs, args...) | ||
} | ||
|
||
func LocalnetExecUp() (string, error) { | ||
return LocalnetExec(DockerComposeLatestArgs, "up", "--detach", "--no-build") | ||
} | ||
|
||
func LocalnetExecDown() (string, error) { | ||
return LocalnetExec(DockerComposeLatestArgs, "down") | ||
} | ||
|
||
func LocalnetExecCopyAbsoluteWithPermissions(path string, destination string, container string) (string, error) { | ||
_, err := LocalnetExec(DockerComposeLatestArgs, "cp", path, container+":"+destination) | ||
if err != nil { | ||
fmt.Println("Error copying file to container: ", err) | ||
return "", err | ||
} | ||
return LocalnetExecRestorePermissions(destination, container) | ||
} | ||
|
||
func LocalnetExecRestorePermissions(path string, container string) (string, error) { | ||
return LocalnetExec(DockerComposeLatestArgs, "exec", "-it", "--user", "root", container, "chown", "-R", DockerUser+":"+DockerUserGroup, path) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cli | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
|
||
errorsmod "cosmossdk.io/errors" | ||
integrationcli "github.com/cheqd/cheqd-node/tests/integration/cli" | ||
) | ||
|
||
func Exec(args ...string) (string, error) { | ||
return integrationcli.Exec(args...) | ||
} | ||
|
||
func ExecDirect(args ...string) (string, error) { | ||
cmd := exec.Command(args[0], args[1:]...) | ||
out, err := cmd.CombinedOutput() | ||
if err != nil { | ||
return "", errorsmod.Wrap(err, string(out)) | ||
} | ||
|
||
return string(out), err | ||
} | ||
|
||
func ExecWithEnv(env []string, args ...string) (string, error) { | ||
cmd := exec.Command(args[0], args[1:]...) | ||
cmd.Env = append(os.Environ(), env...) | ||
out, err := cmd.CombinedOutput() | ||
if err != nil { | ||
return "", errorsmod.Wrap(err, string(out)) | ||
} | ||
|
||
return string(out), err | ||
} |
Oops, something went wrong.