mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
rename
This commit is contained in:
parent
1cd1b1e259
commit
e33898cc1a
@ -99,7 +99,7 @@ func TestKavaCLIMinimumFees(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
||||||
fees := fmt.Sprintf(
|
fees := fmt.Sprintf(
|
||||||
"--minimum-gas-prices=%s,%s",
|
"--minimum-gas-prices=%s,%s",
|
||||||
@ -137,7 +137,7 @@ func TestKavaCLIGasPrices(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
||||||
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
|
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
@ -171,7 +171,7 @@ func TestKavaCLIFeesDeduction(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
minGasPrice, _ := sdk.NewDecFromStr("0.000006")
|
||||||
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
|
proc := f.GDStart(fmt.Sprintf("--minimum-gas-prices=%s", sdk.NewDecCoinFromDec(feeDenom, minGasPrice)))
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
@ -224,7 +224,7 @@ func TestKavaCLISend(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ func TestKavaCLIConfirmTx(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ func TestKavaCLIGasAuto(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ func TestKavaCLICreateValidator(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -477,13 +477,13 @@ func TestKavaCLIQueryRewards(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
genesisState[mint.ModuleName] = mintDataBz
|
genesisState[mint.ModuleName] = mintDataBz
|
||||||
|
|
||||||
genFile := filepath.Join(f.KavadHome, "config", "genesis.json")
|
genFile := filepath.Join(f.KvdHome, "config", "genesis.json")
|
||||||
genDoc, err := tmtypes.GenesisDocFromFile(genFile)
|
genDoc, err := tmtypes.GenesisDocFromFile(genFile)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
genDoc.AppState, err = cdc.MarshalJSON(genesisState)
|
genDoc.AppState, err = cdc.MarshalJSON(genesisState)
|
||||||
require.NoError(t, genDoc.SaveAs(genFile))
|
require.NoError(t, genDoc.SaveAs(genFile))
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ func TestKavaCLIQuerySupply(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -515,7 +515,7 @@ func TestKavaCLISubmitProposal(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ func TestKavaCLISubmitCommunityPoolSpendProposal(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
genesisState[mint.ModuleName] = mintDataBz
|
genesisState[mint.ModuleName] = mintDataBz
|
||||||
|
|
||||||
genFile := filepath.Join(f.KavadHome, "config", "genesis.json")
|
genFile := filepath.Join(f.KvdHome, "config", "genesis.json")
|
||||||
genDoc, err := tmtypes.GenesisDocFromFile(genFile)
|
genDoc, err := tmtypes.GenesisDocFromFile(genFile)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
genDoc.AppState, err = cdc.MarshalJSON(genesisState)
|
genDoc.AppState, err = cdc.MarshalJSON(genesisState)
|
||||||
@ -807,7 +807,7 @@ func TestKavaCLIQueryTxPagination(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -857,7 +857,7 @@ func TestKavaCLIValidateSignatures(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -907,7 +907,7 @@ func TestKavaCLISendGenerateSignAndBroadcast(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -991,7 +991,7 @@ func TestKavaCLIMultisignInsufficientCosigners(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -1044,7 +1044,7 @@ func TestKavaCLIEncode(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -1082,7 +1082,7 @@ func TestKavaCLIMultisignSortSignatures(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -1147,7 +1147,7 @@ func TestKavaCLIMultisign(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server with minimum fees
|
// start kvd server with minimum fees
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -1223,7 +1223,7 @@ func TestKavaCLIConfig(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.KavacliHome, "config", "config.toml"))
|
config, err := ioutil.ReadFile(path.Join(f.KvcliHome, "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"
|
||||||
@ -1335,7 +1335,7 @@ func TestSlashingGetParams(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
@ -1355,7 +1355,7 @@ func TestValidateGenesis(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
f := InitFixtures(t)
|
f := InitFixtures(t)
|
||||||
|
|
||||||
// start kavad server
|
// start kvd server
|
||||||
proc := f.GDStart()
|
proc := f.GDStart()
|
||||||
defer proc.Stop(false)
|
defer proc.Stop(false)
|
||||||
|
|
||||||
|
@ -74,17 +74,17 @@ func init() {
|
|||||||
|
|
||||||
// Fixtures is used to setup the testing environment
|
// Fixtures is used to setup the testing environment
|
||||||
type Fixtures struct {
|
type Fixtures struct {
|
||||||
BuildDir string
|
BuildDir string
|
||||||
RootDir string
|
RootDir string
|
||||||
KavadBinary string
|
KvdBinary string
|
||||||
KavacliBinary string
|
KvcliBinary string
|
||||||
ChainID string
|
ChainID string
|
||||||
RPCAddr string
|
RPCAddr string
|
||||||
Port string
|
Port string
|
||||||
KavadHome string
|
KvdHome string
|
||||||
KavacliHome string
|
KvcliHome string
|
||||||
P2PAddr string
|
P2PAddr string
|
||||||
T *testing.T
|
T *testing.T
|
||||||
|
|
||||||
cdc *codec.Codec
|
cdc *codec.Codec
|
||||||
}
|
}
|
||||||
@ -109,23 +109,23 @@ func NewFixtures(t *testing.T) *Fixtures {
|
|||||||
cdc := app.MakeCodec()
|
cdc := app.MakeCodec()
|
||||||
|
|
||||||
return &Fixtures{
|
return &Fixtures{
|
||||||
T: t,
|
T: t,
|
||||||
BuildDir: buildDir,
|
BuildDir: buildDir,
|
||||||
RootDir: tmpDir,
|
RootDir: tmpDir,
|
||||||
KavadBinary: filepath.Join(buildDir, "kvd"),
|
KvdBinary: filepath.Join(buildDir, "kvd"),
|
||||||
KavacliBinary: filepath.Join(buildDir, "kvcli"),
|
KvcliBinary: filepath.Join(buildDir, "kvcli"),
|
||||||
KavadHome: filepath.Join(tmpDir, ".kvd"),
|
KvdHome: filepath.Join(tmpDir, ".kvd"),
|
||||||
KavacliHome: filepath.Join(tmpDir, ".kvcli"),
|
KvcliHome: filepath.Join(tmpDir, ".kvcli"),
|
||||||
RPCAddr: servAddr,
|
RPCAddr: servAddr,
|
||||||
P2PAddr: p2pAddr,
|
P2PAddr: p2pAddr,
|
||||||
Port: port,
|
Port: port,
|
||||||
cdc: cdc,
|
cdc: cdc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.KavadHome, "config", "genesis.json")
|
return filepath.Join(f.KvdHome, "config", "genesis.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenesisState returns the application's genesis state
|
// GenesisState returns the application's genesis state
|
||||||
@ -194,7 +194,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.KavacliHome, f.RPCAddr)
|
return fmt.Sprintf("--home=%s --node=%s", f.KvcliHome, f.RPCAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
@ -202,16 +202,16 @@ func (f *Fixtures) Flags() string {
|
|||||||
|
|
||||||
// UnsafeResetAll is kavad unsafe-reset-all
|
// UnsafeResetAll is kavad unsafe-reset-all
|
||||||
func (f *Fixtures) UnsafeResetAll(flags ...string) {
|
func (f *Fixtures) UnsafeResetAll(flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s --home=%s unsafe-reset-all", f.KavadBinary, f.KavadHome)
|
cmd := fmt.Sprintf("%s --home=%s unsafe-reset-all", f.KvdBinary, f.KvdHome)
|
||||||
executeWrite(f.T, addFlags(cmd, flags))
|
executeWrite(f.T, addFlags(cmd, flags))
|
||||||
err := os.RemoveAll(filepath.Join(f.KavadHome, "config", "gentx"))
|
err := os.RemoveAll(filepath.Join(f.KvdHome, "config", "gentx"))
|
||||||
require.NoError(f.T, err)
|
require.NoError(f.T, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GDInit is kavad init
|
// GDInit is kavad 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("%s init -o --home=%s %s", f.KavadBinary, f.KavadHome, moniker)
|
cmd := fmt.Sprintf("%s init -o --home=%s %s", f.KvdBinary, f.KvdHome, moniker)
|
||||||
_, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
_, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
|
|
||||||
var chainID string
|
var chainID string
|
||||||
@ -228,25 +228,25 @@ func (f *Fixtures) GDInit(moniker string, flags ...string) {
|
|||||||
|
|
||||||
// AddGenesisAccount is kavad add-genesis-account
|
// AddGenesisAccount is kavad 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("%s add-genesis-account %s %s --home=%s --keyring-backend=test", f.KavadBinary, address, coins, f.KavadHome)
|
cmd := fmt.Sprintf("%s add-genesis-account %s %s --home=%s --keyring-backend=test", f.KvdBinary, address, coins, f.KvdHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenTx is kavad gentx
|
// GenTx is kavad gentx
|
||||||
func (f *Fixtures) GenTx(name string, flags ...string) {
|
func (f *Fixtures) GenTx(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s gentx --name=%s --home=%s --home-client=%s --keyring-backend=test", f.KavadBinary, name, f.KavadHome, f.KavacliHome)
|
cmd := fmt.Sprintf("%s gentx --name=%s --home=%s --home-client=%s --keyring-backend=test", f.KvdBinary, name, f.KvdHome, f.KvcliHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
// CollectGenTxs is kavad collect-gentxs
|
// CollectGenTxs is kavad collect-gentxs
|
||||||
func (f *Fixtures) CollectGenTxs(flags ...string) {
|
func (f *Fixtures) CollectGenTxs(flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s collect-gentxs --home=%s", f.KavadBinary, f.KavadHome)
|
cmd := fmt.Sprintf("%s collect-gentxs --home=%s", f.KvdBinary, f.KvdHome)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GDStart runs kavad start with the appropriate flags and returns a process
|
// GDStart runs kavad 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("%s start --home=%s --rpc.laddr=%v --p2p.laddr=%v", f.KavadBinary, f.KavadHome, f.RPCAddr, f.P2PAddr)
|
cmd := fmt.Sprintf("%s start --home=%s --rpc.laddr=%v --p2p.laddr=%v", f.KvdBinary, f.KvdHome, 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)
|
||||||
@ -255,7 +255,7 @@ func (f *Fixtures) GDStart(flags ...string) *tests.Process {
|
|||||||
|
|
||||||
// GDTendermint returns the results of kavad tendermint [query]
|
// GDTendermint returns the results of kavad tendermint [query]
|
||||||
func (f *Fixtures) GDTendermint(query string) string {
|
func (f *Fixtures) GDTendermint(query string) string {
|
||||||
cmd := fmt.Sprintf("%s tendermint %s --home=%s", f.KavadBinary, query, f.KavadHome)
|
cmd := fmt.Sprintf("%s tendermint %s --home=%s", f.KvdBinary, query, f.KvdHome)
|
||||||
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)
|
||||||
@ -264,45 +264,45 @@ func (f *Fixtures) GDTendermint(query string) string {
|
|||||||
|
|
||||||
// ValidateGenesis runs kavad validate-genesis
|
// ValidateGenesis runs kavad validate-genesis
|
||||||
func (f *Fixtures) ValidateGenesis() {
|
func (f *Fixtures) ValidateGenesis() {
|
||||||
cmd := fmt.Sprintf("%s validate-genesis --home=%s", f.KavadBinary, f.KavadHome)
|
cmd := fmt.Sprintf("%s validate-genesis --home=%s", f.KvdBinary, f.KvdHome)
|
||||||
executeWriteCheckErr(f.T, cmd)
|
executeWriteCheckErr(f.T, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli keys
|
// kvcli keys
|
||||||
|
|
||||||
// KeysDelete is kavacli keys delete
|
// KeysDelete is kvcli keys delete
|
||||||
func (f *Fixtures) KeysDelete(name string, flags ...string) {
|
func (f *Fixtures) KeysDelete(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s keys delete --keyring-backend=test --home=%s %s", f.KavacliBinary,
|
cmd := fmt.Sprintf("%s keys delete --keyring-backend=test --home=%s %s", f.KvcliBinary,
|
||||||
f.KavacliHome, name)
|
f.KvcliHome, name)
|
||||||
executeWrite(f.T, addFlags(cmd, append(append(flags, "-y"), "-f")))
|
executeWrite(f.T, addFlags(cmd, append(append(flags, "-y"), "-f")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAdd is kavacli keys add
|
// KeysAdd is kvcli keys add
|
||||||
func (f *Fixtures) KeysAdd(name string, flags ...string) {
|
func (f *Fixtures) KeysAdd(name string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s %s", f.KavacliBinary,
|
cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s %s", f.KvcliBinary,
|
||||||
f.KavacliHome, name)
|
f.KvcliHome, name)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAddRecover prepares kavacli keys add --recover
|
// KeysAddRecover prepares kvcli keys add --recover
|
||||||
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (exitSuccess bool, stdout, stderr string) {
|
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (exitSuccess bool, stdout, stderr string) {
|
||||||
cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s --recover %s",
|
cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s --recover %s",
|
||||||
f.KavacliBinary, f.KavacliHome, name)
|
f.KvcliBinary, f.KvcliHome, name)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), mnemonic)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), mnemonic)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysAddRecoverHDPath prepares kavacli keys add --recover --account --index
|
// KeysAddRecoverHDPath prepares kvcli 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("%s keys add --keyring-backend=test --home=%s --recover %s --account %d"+
|
cmd := fmt.Sprintf("%s keys add --keyring-backend=test --home=%s --recover %s --account %d"+
|
||||||
" --index %d", f.KavacliBinary, f.KavacliHome, name, account, index)
|
" --index %d", f.KvcliBinary, f.KvcliHome, name, account, index)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags), mnemonic)
|
executeWriteCheckErr(f.T, addFlags(cmd, flags), mnemonic)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeysShow is kavacli keys show
|
// KeysShow is kvcli 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("%s keys show --keyring-backend=test --home=%s %s", f.KavacliBinary,
|
cmd := fmt.Sprintf("%s keys show --keyring-backend=test --home=%s %s", f.KvcliBinary,
|
||||||
f.KavacliHome, name)
|
f.KvcliHome, 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)
|
||||||
@ -319,101 +319,101 @@ func (f *Fixtures) KeyAddress(name string) sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli config
|
// kvcli config
|
||||||
|
|
||||||
// CLIConfig is kavacli config
|
// CLIConfig is kvcli config
|
||||||
func (f *Fixtures) CLIConfig(key, value string, flags ...string) {
|
func (f *Fixtures) CLIConfig(key, value string, flags ...string) {
|
||||||
cmd := fmt.Sprintf("%s config --home=%s %s %s", f.KavacliBinary, f.KavacliHome, key, value)
|
cmd := fmt.Sprintf("%s config --home=%s %s %s", f.KvcliBinary, f.KvcliHome, key, value)
|
||||||
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
executeWriteCheckErr(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli tx send/sign/broadcast
|
// kvcli tx send/sign/broadcast
|
||||||
|
|
||||||
// Status is kavacli status
|
// Status is kvcli status
|
||||||
func (f *Fixtures) Status(flags ...string) (bool, string, string) {
|
func (f *Fixtures) Status(flags ...string) (bool, string, string) {
|
||||||
cmd := fmt.Sprintf("%s status %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s status %s", f.KvcliBinary, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxSend is kavacli tx send
|
// TxSend is kvcli 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("%s tx send --keyring-backend=test %s %s %s %v", f.KavacliBinary, from,
|
cmd := fmt.Sprintf("%s tx send --keyring-backend=test %s %s %s %v", f.KvcliBinary, from,
|
||||||
to, amount, f.Flags())
|
to, amount, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxSign is kavacli tx sign
|
// TxSign is kvcli 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("%s tx sign %v --keyring-backend=test --from=%s %v", f.KavacliBinary,
|
cmd := fmt.Sprintf("%s tx sign %v --keyring-backend=test --from=%s %v", f.KvcliBinary,
|
||||||
f.Flags(), signer, fileName)
|
f.Flags(), signer, fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxBroadcast is kavacli tx broadcast
|
// TxBroadcast is kvcli 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("%s tx broadcast %v %v", f.KavacliBinary, f.Flags(), fileName)
|
cmd := fmt.Sprintf("%s tx broadcast %v %v", f.KvcliBinary, f.Flags(), fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxEncode is kavacli tx encode
|
// TxEncode is kvcli 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("%s tx encode %v %v", f.KavacliBinary, f.Flags(), fileName)
|
cmd := fmt.Sprintf("%s tx encode %v %v", f.KvcliBinary, f.Flags(), fileName)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxMultisign is kavacli tx multisign
|
// TxMultisign is kvcli tx multisign
|
||||||
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("%s tx multisign --keyring-backend=test %v %s %s %s", f.KavacliBinary, f.Flags(),
|
cmd := fmt.Sprintf("%s tx multisign --keyring-backend=test %v %s %s %s", f.KvcliBinary, f.Flags(),
|
||||||
fileName, name, strings.Join(signaturesFiles, " "),
|
fileName, name, strings.Join(signaturesFiles, " "),
|
||||||
)
|
)
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags))
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags))
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli tx staking
|
// kvcli tx staking
|
||||||
|
|
||||||
// TxStakingCreateValidator is kavacli tx staking create-validator
|
// TxStakingCreateValidator is kvcli 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("%s tx staking create-validator %v --keyring-backend=test --from=%s"+
|
cmd := fmt.Sprintf("%s tx staking create-validator %v --keyring-backend=test --from=%s"+
|
||||||
" --pubkey=%s", f.KavacliBinary, f.Flags(), from, consPubKey)
|
" --pubkey=%s", f.KvcliBinary, 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")
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxStakingUnbond is kavacli tx staking unbond
|
// TxStakingUnbond is kvcli 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("%s tx staking unbond --keyring-backend=test %s %v --from=%s %v",
|
cmd := fmt.Sprintf("%s tx staking unbond --keyring-backend=test %s %v --from=%s %v",
|
||||||
f.KavacliBinary, validator, shares, from, f.Flags())
|
f.KvcliBinary, validator, shares, from, f.Flags())
|
||||||
return executeWrite(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWrite(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli tx gov
|
// kvcli tx gov
|
||||||
|
|
||||||
// TxGovSubmitProposal is kavacli tx gov submit-proposal
|
// TxGovSubmitProposal is kvcli 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("%s tx gov submit-proposal %v --keyring-backend=test --from=%s --type=%s",
|
cmd := fmt.Sprintf("%s tx gov submit-proposal %v --keyring-backend=test --from=%s --type=%s",
|
||||||
f.KavacliBinary, f.Flags(), from, typ)
|
f.KvcliBinary, 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), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxGovDeposit is kavacli tx gov deposit
|
// TxGovDeposit is kvcli 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("%s tx gov deposit %d %s --keyring-backend=test --from=%s %v",
|
cmd := fmt.Sprintf("%s tx gov deposit %d %s --keyring-backend=test --from=%s %v",
|
||||||
f.KavacliBinary, proposalID, amount, from, f.Flags())
|
f.KvcliBinary, proposalID, amount, from, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxGovVote is kavacli tx gov vote
|
// TxGovVote is kvcli 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("%s tx gov vote %d %s --keyring-backend=test --from=%s %v",
|
cmd := fmt.Sprintf("%s tx gov vote %d %s --keyring-backend=test --from=%s %v",
|
||||||
f.KavacliBinary, proposalID, option, from, f.Flags())
|
f.KvcliBinary, proposalID, option, from, f.Flags())
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ func (f *Fixtures) TxGovSubmitParamChangeProposal(
|
|||||||
|
|
||||||
cmd := fmt.Sprintf(
|
cmd := fmt.Sprintf(
|
||||||
"%s tx gov submit-proposal param-change %s --keyring-backend=test --from=%s %v",
|
"%s tx gov submit-proposal param-change %s --keyring-backend=test --from=%s %v",
|
||||||
f.KavacliBinary, proposalPath, from, f.Flags(),
|
f.KvcliBinary, proposalPath, from, f.Flags(),
|
||||||
)
|
)
|
||||||
|
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
@ -439,18 +439,18 @@ func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal(
|
|||||||
|
|
||||||
cmd := fmt.Sprintf(
|
cmd := fmt.Sprintf(
|
||||||
"%s tx gov submit-proposal community-pool-spend %s --keyring-backend=test --from=%s %v",
|
"%s tx gov submit-proposal community-pool-spend %s --keyring-backend=test --from=%s %v",
|
||||||
f.KavacliBinary, proposalPath, from, f.Flags(),
|
f.KvcliBinary, proposalPath, from, f.Flags(),
|
||||||
)
|
)
|
||||||
|
|
||||||
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
return executeWriteRetStdStreams(f.T, addFlags(cmd, flags), clientkeys.DefaultKeyPass)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli query account
|
// kvcli query account
|
||||||
|
|
||||||
// QueryAccount is kavacli query account
|
// QueryAccount is kvcli 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("%s query account %s %v", f.KavacliBinary, address, f.Flags())
|
cmd := fmt.Sprintf("%s query account %s %v", f.KvcliBinary, 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)
|
||||||
@ -465,11 +465,11 @@ func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) auth.Ba
|
|||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli query txs
|
// kvcli query txs
|
||||||
|
|
||||||
// QueryTxs is kavacli query txs
|
// QueryTxs is kvcli query txs
|
||||||
func (f *Fixtures) QueryTxs(page, limit int, events ...string) *sdk.SearchTxsResult {
|
func (f *Fixtures) QueryTxs(page, limit int, events ...string) *sdk.SearchTxsResult {
|
||||||
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --events='%s' %v", f.KavacliBinary, page, limit, queryEvents(events), f.Flags())
|
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --events='%s' %v", f.KvcliBinary, page, limit, queryEvents(events), f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var result sdk.SearchTxsResult
|
var result sdk.SearchTxsResult
|
||||||
|
|
||||||
@ -480,17 +480,17 @@ func (f *Fixtures) QueryTxs(page, limit int, events ...string) *sdk.SearchTxsRes
|
|||||||
|
|
||||||
// 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, events ...string) {
|
func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, events ...string) {
|
||||||
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --events='%s' %v", f.KavacliBinary, page, limit, queryEvents(events), f.Flags())
|
cmd := fmt.Sprintf("%s query txs --page=%d --limit=%d --events='%s' %v", f.KvcliBinary, page, limit, queryEvents(events), 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli query staking
|
// kvcli query staking
|
||||||
|
|
||||||
// QueryStakingValidator is kavacli query staking validator
|
// QueryStakingValidator is kvcli 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("%s query staking validator %s %v", f.KavacliBinary, valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking validator %s %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -499,9 +499,9 @@ func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string
|
|||||||
return validator
|
return validator
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryStakingUnbondingDelegationsFrom is kavacli query staking unbonding-delegations-from
|
// QueryStakingUnbondingDelegationsFrom is kvcli 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("%s query staking unbonding-delegations-from %s %v", f.KavacliBinary, valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking unbonding-delegations-from %s %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -510,9 +510,9 @@ func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress,
|
|||||||
return ubds
|
return ubds
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryStakingDelegationsTo is kavacli query staking delegations-to
|
// QueryStakingDelegationsTo is kvcli 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("%s query staking delegations-to %s %v", f.KavacliBinary, valAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query staking delegations-to %s %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -521,9 +521,9 @@ func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...st
|
|||||||
return delegations
|
return delegations
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryStakingPool is kavacli query staking pool
|
// QueryStakingPool is kvcli query staking pool
|
||||||
func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
||||||
cmd := fmt.Sprintf("%s query staking pool %v", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query staking pool %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -532,9 +532,9 @@ func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool {
|
|||||||
return pool
|
return pool
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryStakingParameters is kavacli query staking parameters
|
// QueryStakingParameters is kvcli query staking parameters
|
||||||
func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
||||||
cmd := fmt.Sprintf("%s query staking params %v", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query staking params %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -544,11 +544,11 @@ func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//___________________________________________________________________________________
|
//___________________________________________________________________________________
|
||||||
// kavacli query gov
|
// kvcli query gov
|
||||||
|
|
||||||
// QueryGovParamDeposit is kavacli query gov param deposit
|
// QueryGovParamDeposit is kvcli query gov param deposit
|
||||||
func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
||||||
cmd := fmt.Sprintf("%s query gov param deposit %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query gov param deposit %s", f.KvcliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var depositParam gov.DepositParams
|
var depositParam gov.DepositParams
|
||||||
|
|
||||||
@ -557,9 +557,9 @@ func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams {
|
|||||||
return depositParam
|
return depositParam
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovParamVoting is kavacli query gov param voting
|
// QueryGovParamVoting is kvcli query gov param voting
|
||||||
func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
||||||
cmd := fmt.Sprintf("%s query gov param voting %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query gov param voting %s", f.KvcliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var votingParam gov.VotingParams
|
var votingParam gov.VotingParams
|
||||||
|
|
||||||
@ -568,9 +568,9 @@ func (f *Fixtures) QueryGovParamVoting() gov.VotingParams {
|
|||||||
return votingParam
|
return votingParam
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovParamTallying is kavacli query gov param tallying
|
// QueryGovParamTallying is kvcli query gov param tallying
|
||||||
func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
||||||
cmd := fmt.Sprintf("%s query gov param tallying %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query gov param tallying %s", f.KvcliBinary, f.Flags())
|
||||||
out, _ := tests.ExecuteT(f.T, cmd, "")
|
out, _ := tests.ExecuteT(f.T, cmd, "")
|
||||||
var tallyingParam gov.TallyParams
|
var tallyingParam gov.TallyParams
|
||||||
|
|
||||||
@ -579,9 +579,9 @@ func (f *Fixtures) QueryGovParamTallying() gov.TallyParams {
|
|||||||
return tallyingParam
|
return tallyingParam
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovProposals is kavacli query gov proposals
|
// QueryGovProposals is kvcli query gov proposals
|
||||||
func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
||||||
cmd := fmt.Sprintf("%s query gov proposals %v", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query gov proposals %v", f.KvcliBinary, 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{}
|
||||||
@ -594,9 +594,9 @@ func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovProposal is kavacli query gov proposal
|
// QueryGovProposal is kvcli 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("%s query gov proposal %d %v", f.KavacliBinary, proposalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov proposal %d %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -605,9 +605,9 @@ func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposa
|
|||||||
return proposal
|
return proposal
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovVote is kavacli query gov vote
|
// QueryGovVote is kvcli 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("%s query gov vote %d %s %v", f.KavacliBinary, proposalID, voter, f.Flags())
|
cmd := fmt.Sprintf("%s query gov vote %d %s %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -616,9 +616,9 @@ func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...s
|
|||||||
return vote
|
return vote
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovVotes is kavacli query gov votes
|
// QueryGovVotes is kvcli 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("%s query gov votes %d %v", f.KavacliBinary, proposalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov votes %d %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -627,9 +627,9 @@ func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) []gov.Vote {
|
|||||||
return votes
|
return votes
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovDeposit is kavacli query gov deposit
|
// QueryGovDeposit is kvcli 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("%s query gov deposit %d %s %v", f.KavacliBinary, proposalID, depositor, f.Flags())
|
cmd := fmt.Sprintf("%s query gov deposit %d %s %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -638,9 +638,9 @@ func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, fla
|
|||||||
return deposit
|
return deposit
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGovDeposits is kavacli query gov deposits
|
// QueryGovDeposits is kvcli 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("%s query gov deposits %d %v", f.KavacliBinary, propsalID, f.Flags())
|
cmd := fmt.Sprintf("%s query gov deposits %d %v", f.KvcliBinary, 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
|
||||||
|
|
||||||
@ -654,7 +654,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("%s query slashing signing-info %s %s", f.KavacliBinary, val, f.Flags())
|
cmd := fmt.Sprintf("%s query slashing signing-info %s %s", f.KvcliBinary, 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)
|
||||||
|
|
||||||
@ -664,9 +664,9 @@ func (f *Fixtures) QuerySigningInfo(val string) slashing.ValidatorSigningInfo {
|
|||||||
return sinfo
|
return sinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySlashingParams is kavacli query slashing params
|
// QuerySlashingParams is kvcli query slashing params
|
||||||
func (f *Fixtures) QuerySlashingParams() slashing.Params {
|
func (f *Fixtures) QuerySlashingParams() slashing.Params {
|
||||||
cmd := fmt.Sprintf("%s query slashing params %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query slashing params %s", f.KvcliBinary, 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)
|
||||||
|
|
||||||
@ -681,7 +681,7 @@ func (f *Fixtures) QuerySlashingParams() slashing.Params {
|
|||||||
|
|
||||||
// QueryRewards returns the rewards of a delegator
|
// QueryRewards returns the rewards of a delegator
|
||||||
func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) distribution.QueryDelegatorTotalRewardsResponse {
|
func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) distribution.QueryDelegatorTotalRewardsResponse {
|
||||||
cmd := fmt.Sprintf("%s query distribution rewards %s %s", f.KavacliBinary, delAddr, f.Flags())
|
cmd := fmt.Sprintf("%s query distribution rewards %s %s", f.KvcliBinary, delAddr, 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)
|
||||||
|
|
||||||
@ -696,7 +696,7 @@ func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) distrib
|
|||||||
|
|
||||||
// QueryTotalSupply returns the total supply of coins
|
// QueryTotalSupply returns the total supply of coins
|
||||||
func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply sdk.Coins) {
|
func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply sdk.Coins) {
|
||||||
cmd := fmt.Sprintf("%s query bank total %s", f.KavacliBinary, f.Flags())
|
cmd := fmt.Sprintf("%s query supply total %s", f.KvcliBinary, 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)
|
||||||
|
|
||||||
@ -707,7 +707,7 @@ func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply sdk.Coins) {
|
|||||||
|
|
||||||
// QueryTotalSupplyOf returns the total supply of a given coin denom
|
// QueryTotalSupplyOf returns the total supply of a given coin denom
|
||||||
func (f *Fixtures) QueryTotalSupplyOf(denom string, flags ...string) sdk.Int {
|
func (f *Fixtures) QueryTotalSupplyOf(denom string, flags ...string) sdk.Int {
|
||||||
cmd := fmt.Sprintf("%s query bank total %s %s", f.KavacliBinary, denom, f.Flags())
|
cmd := fmt.Sprintf("%s query supply total %s %s", f.KvcliBinary, denom, 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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user