Allow user to pass a custom BUILDDIR to test_cli (#4127)
Preparation work for cli tests further parallelisation.
This commit is contained in:
parent
c4f53facd9
commit
9cdd1d3e9e
|
@ -987,7 +987,7 @@ func TestGaiaCLIConfig(t *testing.T) {
|
||||||
f.CLIConfig("trace", "false")
|
f.CLIConfig("trace", "false")
|
||||||
f.CLIConfig("indent", "true")
|
f.CLIConfig("indent", "true")
|
||||||
|
|
||||||
config, err := ioutil.ReadFile(path.Join(f.GCLIHome, "config", "config.toml"))
|
config, err := ioutil.ReadFile(path.Join(f.GaiacliHome, "config", "config.toml"))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
expectedConfig := fmt.Sprintf(`broadcast-mode = "block"
|
expectedConfig := fmt.Sprintf(`broadcast-mode = "block"
|
||||||
chain-id = "%s"
|
chain-id = "%s"
|
||||||
|
|
|
@ -60,11 +60,14 @@ var (
|
||||||
|
|
||||||
// Fixtures is used to setup the testing environment
|
// Fixtures is used to setup the testing environment
|
||||||
type Fixtures struct {
|
type Fixtures struct {
|
||||||
|
BuildDir string
|
||||||
|
GaiadBinary string
|
||||||
|
GaiacliBinary string
|
||||||
ChainID string
|
ChainID string
|
||||||
RPCAddr string
|
RPCAddr string
|
||||||
Port string
|
Port string
|
||||||
GDHome string
|
GaiadHome string
|
||||||
GCLIHome string
|
GaiacliHome string
|
||||||
P2PAddr string
|
P2PAddr string
|
||||||
T *testing.T
|
T *testing.T
|
||||||
}
|
}
|
||||||
|
@ -80,10 +83,19 @@ func NewFixtures(t *testing.T) *Fixtures {
|
||||||
p2pAddr, _, err := server.FreeTCPAddr()
|
p2pAddr, _, err := server.FreeTCPAddr()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
buildDir := os.Getenv("BUILDDIR")
|
||||||
|
if buildDir == "" {
|
||||||
|
buildDir, err = filepath.Abs("../../../build/")
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
return &Fixtures{
|
return &Fixtures{
|
||||||
T: t,
|
T: t,
|
||||||
GDHome: filepath.Join(tmpDir, ".gaiad"),
|
BuildDir: buildDir,
|
||||||
GCLIHome: filepath.Join(tmpDir, ".gaiacli"),
|
GaiadBinary: filepath.Join(buildDir, "gaiad"),
|
||||||
|
GaiacliBinary: filepath.Join(buildDir, "gaiacli"),
|
||||||
|
GaiadHome: filepath.Join(tmpDir, ".gaiad"),
|
||||||
|
GaiacliHome: filepath.Join(tmpDir, ".gaiacli"),
|
||||||
RPCAddr: servAddr,
|
RPCAddr: servAddr,
|
||||||
P2PAddr: p2pAddr,
|
P2PAddr: p2pAddr,
|
||||||
Port: port,
|
Port: port,
|
||||||
|
@ -92,7 +104,7 @@ func NewFixtures(t *testing.T) *Fixtures {
|
||||||
|
|
||||||
// GenesisFile returns the path of the genesis file
|
// GenesisFile returns the path of the genesis file
|
||||||
func (f Fixtures) GenesisFile() string {
|
func (f Fixtures) GenesisFile() string {
|
||||||
return filepath.Join(f.GDHome, "config", "genesis.json")
|
return filepath.Join(f.GaiadHome, "config", "genesis.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenesisFile returns the application's genesis state
|
// GenesisFile returns the application's genesis state
|
||||||
|
@ -152,7 +164,7 @@ func InitFixtures(t *testing.T) (f *Fixtures) {
|
||||||
|
|
||||||
// Cleanup is meant to be run at the end of a test to clean up an remaining test state
|
// Cleanup is meant to be run at the end of a test to clean up an remaining test state
|
||||||
func (f *Fixtures) Cleanup(dirs ...string) {
|
func (f *Fixtures) Cleanup(dirs ...string) {
|
||||||
clean := append(dirs, f.GDHome, f.GCLIHome)
|
clean := append(dirs, f.GaiadHome, f.GaiacliHome)
|
||||||
for _, d := range clean {
|
for _, d := range clean {
|
||||||
err := os.RemoveAll(d)
|
err := os.RemoveAll(d)
|
||||||
require.NoError(f.T, err)
|
require.NoError(f.T, err)
|
||||||
|
@ -161,7 +173,7 @@ func (f *Fixtures) Cleanup(dirs ...string) {
|
||||||
|
|
||||||
// Flags returns the flags necessary for making most CLI calls
|
// Flags returns the flags necessary for making most CLI calls
|
||||||
func (f *Fixtures) Flags() string {
|
func (f *Fixtures) Flags() string {
|
||||||
return fmt.Sprintf("--home=%s --node=%s", f.GCLIHome, f.RPCAddr)
|
return fmt.Sprintf("--home=%s --node=%s", f.GaiacliHome, f.RPCAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
|
@ -169,16 +181,16 @@ func (f *Fixtures) Flags() string {
|
||||||
|
|
||||||
// UnsafeResetAll is gaiad unsafe-reset-all
|
// UnsafeResetAll is gaiad unsafe-reset-all
|
||||||
func (f *Fixtures) UnsafeResetAll(flags ...string) {
|
func (f *Fixtures) UnsafeResetAll(flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad --home=%s unsafe-reset-all", f.GDHome)
|
cmd := fmt.Sprintf("%s --home=%s unsafe-reset-all", f.GaiadBinary, f.GaiadHome)
|
||||||
executeWrite(f.T, addFlags(cmd, flags))
|
executeWrite(f.T, addFlags(cmd, flags))
|
||||||
err := os.RemoveAll(filepath.Join(f.GDHome, "config", "gentx"))
|
err := os.RemoveAll(filepath.Join(f.GaiadHome, "config", "gentx"))
|
||||||
require.NoError(f.T, err)
|
require.NoError(f.T, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GDInit is gaiad init
|
// GDInit is gaiad init
|
||||||
// NOTE: GDInit sets the ChainID for the Fixtures instance
|
// NOTE: GDInit sets the ChainID for the Fixtures instance
|
||||||
func (f *Fixtures) GDInit(moniker string, flags ...string) {
|
func (f *Fixtures) GDInit(moniker string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad init -o --home=%s %s", f.GDHome, moniker)
|
cmd := fmt.Sprintf("%s init -o --home=%s %s", f.GaiadBinary, f.GaiadHome, moniker)
|
||||||
_, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
_, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
|
|
||||||
var chainID string
|
var chainID string
|
||||||
|
@ -195,25 +207,25 @@ func (f *Fixtures) GDInit(moniker string, flags ...string) {
|
||||||
|
|
||||||
// AddGenesisAccount is gaiad add-genesis-account
|
// AddGenesisAccount is gaiad add-genesis-account
|
||||||
func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, flags ...string) {
|
func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad add-genesis-account %s %s --home=%s", address, coins, f.GDHome)
|
cmd := fmt.Sprintf("%s add-genesis-account %s %s --home=%s", f.GaiadBinary, address, coins, f.GaiadHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenTx is gaiad gentx
|
// GenTx is gaiad gentx
|
||||||
func (f *Fixtures) GenTx(name string, flags ...string) {
|
func (f *Fixtures) GenTx(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad gentx --name=%s --home=%s --home-client=%s", name, f.GDHome, f.GCLIHome)
|
cmd := fmt.Sprintf("%s gentx --name=%s --home=%s --home-client=%s", f.GaiadBinary, name, f.GaiadHome, f.GaiacliHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CollectGenTxs is gaiad collect-gentxs
|
// CollectGenTxs is gaiad collect-gentxs
|
||||||
func (f *Fixtures) CollectGenTxs(flags ...string) {
|
func (f *Fixtures) CollectGenTxs(flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad collect-gentxs --home=%s", f.GDHome)
|
cmd := fmt.Sprintf("%s collect-gentxs --home=%s", f.GaiadBinary, f.GaiadHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GDStart runs gaiad start with the appropriate flags and returns a process
|
// GDStart runs gaiad start with the appropriate flags and returns a process
|
||||||
func (f *Fixtures) GDStart(flags ...string) *tests.Process {
|
func (f *Fixtures) GDStart(flags ...string) *tests.Process {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad start --home=%s --rpc.laddr=%v --p2p.laddr=%v", f.GDHome, f.RPCAddr, f.P2PAddr)
|
cmd := fmt.Sprintf("%s start --home=%s --rpc.laddr=%v --p2p.laddr=%v", f.GaiadBinary, f.GaiadHome, f.RPCAddr, f.P2PAddr)
|
||||||
proc := tests.GoExecuteTWithStdout(f.T, addFlags(cmd, flags))
|
proc := tests.GoExecuteTWithStdout(f.T, addFlags(cmd, flags))
|
||||||
tests.WaitForTMStart(f.Port)
|
tests.WaitForTMStart(f.Port)
|
||||||
tests.WaitForNextNBlocksTM(1, f.Port)
|
tests.WaitForNextNBlocksTM(1, f.Port)
|
||||||
|
@ -222,7 +234,7 @@ func (f *Fixtures) GDStart(flags ...string) *tests.Process {
|
||||||
|
|
||||||
// GDTendermint returns the results of gaiad tendermint [query]
|
// GDTendermint returns the results of gaiad tendermint [query]
|
||||||
func (f *Fixtures) GDTendermint(query string) string {
|
func (f *Fixtures) GDTendermint(query string) string {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad tendermint %s --home=%s", query, f.GDHome)
|
cmd := fmt.Sprintf("%s tendermint %s --home=%s", f.GaiadBinary, query, f.GaiadHome)
|
||||||
success, stdout, stderr := executeWriteRetStdStreams(f.T, cmd)
|
success, stdout, stderr := executeWriteRetStdStreams(f.T, cmd)
|
||||||
require.Empty(f.T, stderr)
|
require.Empty(f.T, stderr)
|
||||||
require.True(f.T, success)
|
require.True(f.T, success)
|
||||||
|
@ -231,7 +243,7 @@ func (f *Fixtures) GDTendermint(query string) string {
|
||||||
|
|
||||||
// ValidateGenesis runs gaiad validate-genesis
|
// ValidateGenesis runs gaiad validate-genesis
|
||||||
func (f *Fixtures) ValidateGenesis() {
|
func (f *Fixtures) ValidateGenesis() {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiad validate-genesis --home=%s", f.GDHome)
|
cmd := fmt.Sprintf("%s validate-genesis --home=%s", f.GaiadBinary, f.GaiadHome)
|
||||||
executeWriteCheckErr(f.T, cmd)
|
executeWriteCheckErr(f.T, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,31 +252,31 @@ func (f *Fixtures) ValidateGenesis() {
|
||||||
|
|
||||||
// KeysDelete is gaiacli keys delete
|
// KeysDelete is gaiacli keys delete
|
||||||
func (f *Fixtures) KeysDelete(name string, flags ...string) {
|
func (f *Fixtures) KeysDelete(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli keys delete --home=%s %s", f.GCLIHome, name)
|
cmd := fmt.Sprintf("%s keys delete --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name)
|
||||||
executeWrite(f.T, addFlags(cmd, append(append(flags, "-y"), "-f")))
|
executeWrite(f.T, addFlags(cmd, append(append(flags, "-y"), "-f")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAdd is gaiacli keys add
|
// KeysAdd is gaiacli keys add
|
||||||
func (f *Fixtures) KeysAdd(name string, flags ...string) {
|
func (f *Fixtures) KeysAdd(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s %s", f.GCLIHome, name)
|
cmd := fmt.Sprintf("%s keys add --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAddRecover prepares gaiacli keys add --recover
|
// KeysAddRecover prepares gaiacli keys add --recover
|
||||||
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) {
|
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s --recover %s", f.GCLIHome, name)
|
cmd := fmt.Sprintf("%s keys add --home=%s --recover %s", f.GaiacliBinary, f.GaiacliHome, name)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAddRecoverHDPath prepares gaiacli keys add --recover --account --index
|
// KeysAddRecoverHDPath prepares gaiacli keys add --recover --account --index
|
||||||
func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string) {
|
func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli keys add --home=%s --recover %s --account %d --index %d", f.GCLIHome, name, account, index)
|
cmd := fmt.Sprintf("%s keys add --home=%s --recover %s --account %d --index %d", f.GaiacliBinary, f.GaiacliHome, name, account, index)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), client.DefaultKeyPass, mnemonic)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysShow is gaiacli keys show
|
// KeysShow is gaiacli keys show
|
||||||
func (f *Fixtures) KeysShow(name string, flags ...string) keys.KeyOutput {
|
func (f *Fixtures) KeysShow(name string, flags ...string) keys.KeyOutput {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli keys show --home=%s %s", f.GCLIHome, name)
|
cmd := fmt.Sprintf("%s keys show --home=%s %s", f.GaiacliBinary, f.GaiacliHome, name)
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var ko keys.KeyOutput
|
var ko keys.KeyOutput
|
||||||
err := clientkeys.UnmarshalJSON([]byte(out), &ko)
|
err := clientkeys.UnmarshalJSON([]byte(out), &ko)
|
||||||
|
@ -285,7 +297,7 @@ func (f *Fixtures) KeyAddress(name string) sdk.AccAddress {
|
||||||
|
|
||||||
// CLIConfig is gaiacli config
|
// CLIConfig is gaiacli config
|
||||||
func (f *Fixtures) CLIConfig(key, value string, flags ...string) {
|
func (f *Fixtures) CLIConfig(key, value string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli config --home=%s %s %s", f.GCLIHome, key, value)
|
cmd := fmt.Sprintf("%s config --home=%s %s %s", f.GaiacliBinary, f.GaiacliHome, key, value)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +306,7 @@ func (f *Fixtures) CLIConfig(key, value string, flags ...string) {
|
||||||
|
|
||||||
// TxSend is gaiacli tx send
|
// TxSend is gaiacli tx send
|
||||||
func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx send %s %s %v --from=%s", to, amount, f.Flags(), from)
|
cmd := fmt.Sprintf("%s tx send %s %s %v --from=%s", f.GaiacliBinary, to, amount, f.Flags(), from)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,25 +314,25 @@ func (f *Fixtures) txSendWithConfirm(
|
||||||
from string, to sdk.AccAddress, amount sdk.Coin, confirm string, flags ...string,
|
from string, to sdk.AccAddress, amount sdk.Coin, confirm string, flags ...string,
|
||||||
) (bool, string, string) {
|
) (bool, string, string) {
|
||||||
|
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx send %s %s %v --from=%s", to, amount, f.Flags(), from)
|
cmd := fmt.Sprintf("%s tx send %s %s %v --from=%s", f.GaiacliBinary, to, amount, f.Flags(), from)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), confirm, client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), confirm, client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxSign is gaiacli tx sign
|
// TxSign is gaiacli tx sign
|
||||||
func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx sign %v --from=%s %v", f.Flags(), signer, fileName)
|
cmd := fmt.Sprintf("%s tx sign %v --from=%s %v", f.GaiacliBinary, f.Flags(), signer, fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxBroadcast is gaiacli tx broadcast
|
// TxBroadcast is gaiacli tx broadcast
|
||||||
func (f *Fixtures) TxBroadcast(fileName string, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxBroadcast(fileName string, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx broadcast %v %v", f.Flags(), fileName)
|
cmd := fmt.Sprintf("%s tx broadcast %v %v", f.GaiacliBinary, f.Flags(), fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxEncode is gaiacli tx encode
|
// TxEncode is gaiacli tx encode
|
||||||
func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx encode %v %v", f.Flags(), fileName)
|
cmd := fmt.Sprintf("%s tx encode %v %v", f.GaiacliBinary, f.Flags(), fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +340,7 @@ func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, str
|
||||||
func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string,
|
func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string,
|
||||||
flags ...string) (bool, string, string) {
|
flags ...string) (bool, string, string) {
|
||||||
|
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx multisign %v %s %s %s", f.Flags(),
|
cmd := fmt.Sprintf("%s tx multisign %v %s %s %s", f.GaiacliBinary, f.Flags(),
|
||||||
fileName, name, strings.Join(signaturesFiles, " "),
|
fileName, name, strings.Join(signaturesFiles, " "),
|
||||||
)
|
)
|
||||||
return executeWriteRetStdStreams(f.T, cmd)
|
return executeWriteRetStdStreams(f.T, cmd)
|
||||||
|
@ -339,7 +351,7 @@ func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string,
|
||||||
|
|
||||||
// TxStakingCreateValidator is gaiacli tx staking create-validator
|
// TxStakingCreateValidator is gaiacli tx staking create-validator
|
||||||
func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx staking create-validator %v --from=%s --pubkey=%s", f.Flags(), from, consPubKey)
|
cmd := fmt.Sprintf("%s tx staking create-validator %v --from=%s --pubkey=%s", f.GaiacliBinary, f.Flags(), from, consPubKey)
|
||||||
cmd += fmt.Sprintf(" --amount=%v --moniker=%v --commission-rate=%v", amount, from, "0.05")
|
cmd += fmt.Sprintf(" --amount=%v --moniker=%v --commission-rate=%v", amount, from, "0.05")
|
||||||
cmd += fmt.Sprintf(" --commission-max-rate=%v --commission-max-change-rate=%v", "0.20", "0.10")
|
cmd += fmt.Sprintf(" --commission-max-rate=%v --commission-max-change-rate=%v", "0.20", "0.10")
|
||||||
cmd += fmt.Sprintf(" --min-self-delegation=%v", "1")
|
cmd += fmt.Sprintf(" --min-self-delegation=%v", "1")
|
||||||
|
@ -348,7 +360,7 @@ func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.
|
||||||
|
|
||||||
// TxStakingUnbond is gaiacli tx staking unbond
|
// TxStakingUnbond is gaiacli tx staking unbond
|
||||||
func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) bool {
|
func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) bool {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx staking unbond %s %v --from=%s %v", validator, shares, from, f.Flags())
|
cmd := fmt.Sprintf("%s tx staking unbond %s %v --from=%s %v", f.GaiacliBinary, validator, shares, from, f.Flags())
|
||||||
return executeWrite(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWrite(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,20 +369,20 @@ func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress
|
||||||
|
|
||||||
// TxGovSubmitProposal is gaiacli tx gov submit-proposal
|
// TxGovSubmitProposal is gaiacli tx gov submit-proposal
|
||||||
func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx gov submit-proposal %v --from=%s --type=%s", f.Flags(), from, typ)
|
cmd := fmt.Sprintf("%s tx gov submit-proposal %v --from=%s --type=%s", f.GaiacliBinary, f.Flags(), from, typ)
|
||||||
cmd += fmt.Sprintf(" --title=%s --description=%s --deposit=%s", title, description, deposit)
|
cmd += fmt.Sprintf(" --title=%s --description=%s --deposit=%s", title, description, deposit)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxGovDeposit is gaiacli tx gov deposit
|
// TxGovDeposit is gaiacli tx gov deposit
|
||||||
func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx gov deposit %d %s --from=%s %v", proposalID, amount, from, f.Flags())
|
cmd := fmt.Sprintf("%s tx gov deposit %d %s --from=%s %v", f.GaiacliBinary, proposalID, amount, from, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxGovVote is gaiacli tx gov vote
|
// TxGovVote is gaiacli tx gov vote
|
||||||
func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (bool, string, string) {
|
func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli tx gov vote %d %s --from=%s %v", proposalID, option, from, f.Flags())
|
cmd := fmt.Sprintf("%s tx gov vote %d %s --from=%s %v", f.GaiacliBinary, proposalID, option, from, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), client.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +391,7 @@ func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string,
|
||||||
|
|
||||||
// QueryAccount is gaiacli query account
|
// QueryAccount is gaiacli query account
|
||||||
func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) auth.BaseAccount {
|
func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) auth.BaseAccount {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query account %s %v", address, f.Flags())
|
cmd := fmt.Sprintf("%s query account %s %v", f.GaiacliBinary, address, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var initRes map[string]json.RawMessage
|
var initRes map[string]json.RawMessage
|
||||||
err := json.Unmarshal([]byte(out), &initRes)
|
err := json.Unmarshal([]byte(out), &initRes)
|
||||||
|
@ -398,7 +410,7 @@ func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) auth.Ba
|
||||||
|
|
||||||
// QueryTxs is gaiacli query txs
|
// QueryTxs is gaiacli query txs
|
||||||
func (f *Fixtures) QueryTxs(page, limit int, tags ...string) []sdk.TxResponse {
|
func (f *Fixtures) QueryTxs(page, limit int, tags ...string) []sdk.TxResponse {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query txs --page=%d --limit=%d --tags='%s' %v", page, limit, queryTags(tags), f.Flags())
|
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --tags='%s' %v", f.GaiacliBinary, page, limit, queryTags(tags), f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var txs []sdk.TxResponse
|
var txs []sdk.TxResponse
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -409,7 +421,7 @@ func (f *Fixtures) QueryTxs(page, limit int, tags ...string) []sdk.TxResponse {
|
||||||
|
|
||||||
// QueryTxsInvalid query txs with wrong parameters and compare expected error
|
// QueryTxsInvalid query txs with wrong parameters and compare expected error
|
||||||
func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, tags ...string) {
|
func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, tags ...string) {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query txs --page=%d --limit=%d --tags='%s' %v", page, limit, queryTags(tags), f.Flags())
|
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --tags='%s' %v", f.GaiacliBinary, page, limit, queryTags(tags), f.Flags())
|
||||||
_, err := tests.ExecuteT(f.T, cmd, "")
|
_, err := tests.ExecuteT(f.T, cmd, "")
|
||||||
require.EqualError(f.T, expectedErr, err)
|
require.EqualError(f.T, expectedErr, err)
|
||||||
}
|
}
|
||||||
|
@ -419,7 +431,7 @@ func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, tags ...s
|
||||||
|
|
||||||
// QueryStakingValidator is gaiacli query staking validator
|
// QueryStakingValidator is gaiacli query staking validator
|
||||||
func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string) staking.Validator {
|
func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string) staking.Validator {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query staking validator %s %v", valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking validator %s %v", f.GaiacliBinary, valAddr, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var validator staking.Validator
|
var validator staking.Validator
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -430,7 +442,7 @@ func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string
|
||||||
|
|
||||||
// QueryStakingUnbondingDelegationsFrom is gaiacli query staking unbonding-delegations-from
|
// QueryStakingUnbondingDelegationsFrom is gaiacli query staking unbonding-delegations-from
|
||||||
func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress, flags ...string) []staking.UnbondingDelegation {
|
func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress, flags ...string) []staking.UnbondingDelegation {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query staking unbonding-delegations-from %s %v", valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking unbonding-delegations-from %s %v", f.GaiacliBinary, valAddr, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var ubds []staking.UnbondingDelegation
|
var ubds []staking.UnbondingDelegation
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -441,7 +453,7 @@ func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress,
|
||||||
|
|
||||||
// QueryStakingDelegationsTo is gaiacli query staking delegations-to
|
// QueryStakingDelegationsTo is gaiacli query staking delegations-to
|
||||||
func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...string) []staking.Delegation {
|
func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...string) []staking.Delegation {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query staking delegations-to %s %v", valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking delegations-to %s %v", f.GaiacliBinary, valAddr, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var delegations []staking.Delegation
|
var delegations []staking.Delegation
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -452,7 +464,7 @@ func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...st
|
||||||
|
|
||||||
// QueryStakingPool is gaiacli query staking pool
|
// QueryStakingPool is gaiacli query staking pool
|
||||||
func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query staking pool %v", f.Flags())
|
cmd := fmt.Sprintf("%s query staking pool %v", f.GaiacliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var pool staking.Pool
|
var pool staking.Pool
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -463,7 +475,7 @@ func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
||||||
|
|
||||||
// QueryStakingParameters is gaiacli query staking parameters
|
// QueryStakingParameters is gaiacli query staking parameters
|
||||||
func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query staking params %v", f.Flags())
|
cmd := fmt.Sprintf("%s query staking params %v", f.GaiacliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var params staking.Params
|
var params staking.Params
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -477,7 +489,7 @@ func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
||||||
|
|
||||||
// QueryGovParamDeposit is gaiacli query gov param deposit
|
// QueryGovParamDeposit is gaiacli query gov param deposit
|
||||||
func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov param deposit %s", f.Flags())
|
cmd := fmt.Sprintf("%s query gov param deposit %s", f.GaiacliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var depositParam gov.DepositParams
|
var depositParam gov.DepositParams
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -488,7 +500,7 @@ func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
||||||
|
|
||||||
// QueryGovParamVoting is gaiacli query gov param voting
|
// QueryGovParamVoting is gaiacli query gov param voting
|
||||||
func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov param voting %s", f.Flags())
|
cmd := fmt.Sprintf("%s query gov param voting %s", f.GaiacliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var votingParam gov.VotingParams
|
var votingParam gov.VotingParams
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -499,7 +511,7 @@ func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
||||||
|
|
||||||
// QueryGovParamTallying is gaiacli query gov param tallying
|
// QueryGovParamTallying is gaiacli query gov param tallying
|
||||||
func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov param tallying %s", f.Flags())
|
cmd := fmt.Sprintf("%s query gov param tallying %s", f.GaiacliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var tallyingParam gov.TallyParams
|
var tallyingParam gov.TallyParams
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -510,7 +522,7 @@ func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
||||||
|
|
||||||
// QueryGovProposals is gaiacli query gov proposals
|
// QueryGovProposals is gaiacli query gov proposals
|
||||||
func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov proposals %v", f.Flags())
|
cmd := fmt.Sprintf("%s query gov proposals %v", f.GaiacliBinary, f.Flags())
|
||||||
stdout, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
stdout, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
if strings.Contains(stderr, "No matching proposals found") {
|
if strings.Contains(stderr, "No matching proposals found") {
|
||||||
return gov.Proposals{}
|
return gov.Proposals{}
|
||||||
|
@ -525,7 +537,7 @@ func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
||||||
|
|
||||||
// QueryGovProposal is gaiacli query gov proposal
|
// QueryGovProposal is gaiacli query gov proposal
|
||||||
func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposal {
|
func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposal {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov proposal %d %v", proposalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov proposal %d %v", f.GaiacliBinary, proposalID, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var proposal gov.Proposal
|
var proposal gov.Proposal
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -536,7 +548,7 @@ func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposa
|
||||||
|
|
||||||
// QueryGovVote is gaiacli query gov vote
|
// QueryGovVote is gaiacli query gov vote
|
||||||
func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...string) gov.Vote {
|
func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...string) gov.Vote {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov vote %d %s %v", proposalID, voter, f.Flags())
|
cmd := fmt.Sprintf("%s query gov vote %d %s %v", f.GaiacliBinary, proposalID, voter, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var vote gov.Vote
|
var vote gov.Vote
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -547,7 +559,7 @@ func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...s
|
||||||
|
|
||||||
// QueryGovVotes is gaiacli query gov votes
|
// QueryGovVotes is gaiacli query gov votes
|
||||||
func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) []gov.Vote {
|
func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) []gov.Vote {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov votes %d %v", proposalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov votes %d %v", f.GaiacliBinary, proposalID, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var votes []gov.Vote
|
var votes []gov.Vote
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -558,7 +570,7 @@ func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) []gov.Vote {
|
||||||
|
|
||||||
// QueryGovDeposit is gaiacli query gov deposit
|
// QueryGovDeposit is gaiacli query gov deposit
|
||||||
func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, flags ...string) gov.Deposit {
|
func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, flags ...string) gov.Deposit {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov deposit %d %s %v", proposalID, depositor, f.Flags())
|
cmd := fmt.Sprintf("%s query gov deposit %d %s %v", f.GaiacliBinary, proposalID, depositor, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var deposit gov.Deposit
|
var deposit gov.Deposit
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -569,7 +581,7 @@ func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, fla
|
||||||
|
|
||||||
// QueryGovDeposits is gaiacli query gov deposits
|
// QueryGovDeposits is gaiacli query gov deposits
|
||||||
func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) []gov.Deposit {
|
func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) []gov.Deposit {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query gov deposits %d %v", propsalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov deposits %d %v", f.GaiacliBinary, propsalID, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "")
|
||||||
var deposits []gov.Deposit
|
var deposits []gov.Deposit
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -583,7 +595,7 @@ func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) []gov.Deposi
|
||||||
|
|
||||||
// QuerySigningInfo returns the signing info for a validator
|
// QuerySigningInfo returns the signing info for a validator
|
||||||
func (f *Fixtures) QuerySigningInfo(val string) slashing.ValidatorSigningInfo {
|
func (f *Fixtures) QuerySigningInfo(val string) slashing.ValidatorSigningInfo {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query slashing signing-info %s %s", val, f.Flags())
|
cmd := fmt.Sprintf("%s query slashing signing-info %s %s", f.GaiacliBinary, val, f.Flags())
|
||||||
res, errStr := tests.ExecuteT(f.T, cmd, "")
|
res, errStr := tests.ExecuteT(f.T, cmd, "")
|
||||||
require.Empty(f.T, errStr)
|
require.Empty(f.T, errStr)
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
@ -595,7 +607,7 @@ func (f *Fixtures) QuerySigningInfo(val string) slashing.ValidatorSigningInfo {
|
||||||
|
|
||||||
// QuerySlashingParams is gaiacli query slashing params
|
// QuerySlashingParams is gaiacli query slashing params
|
||||||
func (f *Fixtures) QuerySlashingParams() slashing.Params {
|
func (f *Fixtures) QuerySlashingParams() slashing.Params {
|
||||||
cmd := fmt.Sprintf("../../../build/gaiacli query slashing params %s", f.Flags())
|
cmd := fmt.Sprintf("%s query slashing params %s", f.GaiacliBinary, f.Flags())
|
||||||
res, errStr := tests.ExecuteT(f.T, cmd, "")
|
res, errStr := tests.ExecuteT(f.T, cmd, "")
|
||||||
require.Empty(f.T, errStr)
|
require.Empty(f.T, errStr)
|
||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
|
Loading…
Reference in New Issue