diff --git a/test/e2e/configurer/chain/chain.go b/test/e2e/configurer/chain/chain.go index 137d002e0..fbf678fc6 100644 --- a/test/e2e/configurer/chain/chain.go +++ b/test/e2e/configurer/chain/chain.go @@ -7,7 +7,6 @@ import ( "testing" "time" - govv1 "cosmossdk.io/api/cosmos/gov/v1" ibctesting "github.com/cosmos/ibc-go/v8/testing" coretypes "github.com/cometbft/cometbft/rpc/core/types" @@ -181,13 +180,6 @@ func (c *Config) GetNodeAtIndex(nodeIndex int) (*NodeConfig, error) { return c.NodeConfigs[nodeIndex], nil } -// TxGovVoteFromAllNodes votes in a gov prop from all nodes wallet. -func (c *Config) TxGovVoteFromAllNodes(propID int, option govv1.VoteOption, overallFlags ...string) { - for _, n := range c.NodeConfigs { - n.TxGovVote(n.WalletName, propID, option, overallFlags...) - } -} - // BTCHeaderBytesHexJoined join all the btc headers as byte string hex func (c *Config) BTCHeaderBytesHexJoined() string { if c.BTCHeaders == nil || len(c.BTCHeaders) == 0 { diff --git a/test/e2e/configurer/chain/commands.go b/test/e2e/configurer/chain/commands.go index feca59645..36155d45c 100644 --- a/test/e2e/configurer/chain/commands.go +++ b/test/e2e/configurer/chain/commands.go @@ -12,7 +12,6 @@ import ( "strings" "time" - govv1 "cosmossdk.io/api/cosmos/gov/v1" txformat "github.com/babylonlabs-io/babylon/btctxformatter" "github.com/babylonlabs-io/babylon/test/e2e/containers" "github.com/babylonlabs-io/babylon/test/e2e/initialization" @@ -95,10 +94,6 @@ func (n *NodeConfig) BankSendFromNode(receiveAddress, amount string) { n.BankSend(n.WalletName, receiveAddress, amount) } -func (n *NodeConfig) BankMultiSendFromNode(addresses []string, amount string) { - n.BankMultiSend(n.WalletName, addresses, amount) -} - func (n *NodeConfig) BankSend(fromWallet, to, amount string, overallFlags ...string) { fromAddr := n.GetWallet(fromWallet) n.LogActionF("bank sending %s from wallet %s to %s", amount, fromWallet, to) @@ -108,23 +103,6 @@ func (n *NodeConfig) BankSend(fromWallet, to, amount string, overallFlags ...str n.LogActionF("successfully sent bank sent %s from address %s to %s", amount, fromWallet, to) } -func (n *NodeConfig) BankMultiSend(fromWallet string, receivers []string, amount string, overallFlags ...string) { - if len(receivers) == 0 { - require.Error(n.t, fmt.Errorf("no address to send to")) - } - - fromAddr := n.GetWallet(fromWallet) - n.LogActionF("bank multi-send sending %s from wallet %s to %+v", amount, fromWallet, receivers) - - cmd := []string{"babylond", "tx", "bank", "multi-send", fromAddr} // starts the initial flags - cmd = append(cmd, receivers...) // appends all the receivers - cmd = append(cmd, amount, fmt.Sprintf("--from=%s", fromWallet)) // set amounts and overall - - _, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, append(cmd, overallFlags...)) - require.NoError(n.t, err) - n.LogActionF("successfully sent bank multi-send %s from address %s to %+v", amount, fromWallet, receivers) -} - func (n *NodeConfig) BankSendOutput(fromWallet, to, amount string, overallFlags ...string) (out bytes.Buffer, errBuff bytes.Buffer, err error) { fromAddr := n.GetWallet(fromWallet) n.LogActionF("bank sending %s from wallet %s to %s", amount, fromWallet, to) @@ -407,40 +385,3 @@ func ParseBTCHeaderInfoResponseToInfo(r *blc.BTCHeaderInfoResponse) (*blc.BTCHea Work: &r.Work, }, nil } - -// Proposal submits a governance proposal from the file inside the container, -// if the file is local, remind to add it to the mounting point in container. -func (n *NodeConfig) TxGovPropSubmitProposal(proposalJsonFilePath, from string, overallFlags ...string) int { - n.LogActionF("submitting new v1 proposal type %s", proposalJsonFilePath) - - cmd := []string{ - "babylond", "tx", "gov", "submit-proposal", proposalJsonFilePath, - fmt.Sprintf("--from=%s", from), - } - - _, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, append(cmd, overallFlags...)) - require.NoError(n.t, err) - - n.WaitForNextBlock() - - props := n.QueryProposals() - require.GreaterOrEqual(n.t, len(props.Proposals), 1) - - n.LogActionF("successfully submitted new v1 proposal type") - return int(props.Proposals[len(props.Proposals)-1].ProposalId) -} - -// TxGovVote votes in a governance proposal -func (n *NodeConfig) TxGovVote(from string, propID int, option govv1.VoteOption, overallFlags ...string) { - n.LogActionF("submitting vote %s to prop %d", option, propID) - - cmd := []string{ - "babylond", "tx", "gov", "vote", fmt.Sprintf("%d", propID), option.String(), - fmt.Sprintf("--from=%s", from), - } - - _, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, append(cmd, overallFlags...)) - require.NoError(n.t, err) - - n.LogActionF("successfully submitted vote %s to prop %d", option, propID) -} diff --git a/test/e2e/configurer/chain/node.go b/test/e2e/configurer/chain/node.go index c07288c17..f849ac5ab 100644 --- a/test/e2e/configurer/chain/node.go +++ b/test/e2e/configurer/chain/node.go @@ -9,7 +9,6 @@ import ( "testing" "time" - cmtjson "github.com/cometbft/cometbft/libs/json" rpchttp "github.com/cometbft/cometbft/rpc/client/http" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/stretchr/testify/require" @@ -186,19 +185,3 @@ func (n *NodeConfig) LogActionF(msg string, args ...interface{}) { s := fmt.Sprintf(msg, args...) n.t.Logf("[%s] %s. From container %s", timeSinceStart, s, n.Name) } - -func (n *NodeConfig) Status() (*coretypes.ResultStatus, error) { - cmd := []string{"babylond", "status", "--output=json"} - outBuf, _, err := n.containerManager.ExecCmd(n.t, n.Name, cmd, "") - if err != nil { - return nil, err - } - - var r coretypes.ResultStatus - err = cmtjson.Unmarshal(outBuf.Bytes(), &r) - if err != nil { - return nil, err - } - - return &r, nil -} diff --git a/test/e2e/configurer/chain/queries.go b/test/e2e/configurer/chain/queries.go index fbc0b9dfe..80a3d6b83 100644 --- a/test/e2e/configurer/chain/queries.go +++ b/test/e2e/configurer/chain/queries.go @@ -12,7 +12,6 @@ import ( "time" sdkmath "cosmossdk.io/math" - upgradetypes "cosmossdk.io/x/upgrade/types" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" cmtabcitypes "github.com/cometbft/cometbft/abci/types" cmttypes "github.com/cometbft/cometbft/types" @@ -20,7 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/stretchr/testify/require" "github.com/babylonlabs-io/babylon/test/e2e/util" @@ -415,54 +413,3 @@ func (n *NodeConfig) QueryWasmSmartObject(contract string, msg string) (resultOb } return resultObject, nil } - -func (n *NodeConfig) QueryProposal(proposalNumber int) govtypesv1.QueryProposalResponse { - path := fmt.Sprintf("cosmos/gov/v1beta1/proposals/%d", proposalNumber) - bz, err := n.QueryGRPCGateway(path, url.Values{}) - require.NoError(n.t, err) - - var resp govtypesv1.QueryProposalResponse - err = util.Cdc.UnmarshalJSON(bz, &resp) - require.NoError(n.t, err) - - return resp -} - -func (n *NodeConfig) QueryProposals() govtypesv1.QueryProposalsResponse { - bz, err := n.QueryGRPCGateway("cosmos/gov/v1beta1/proposals", url.Values{}) - require.NoError(n.t, err) - - var resp govtypesv1.QueryProposalsResponse - err = util.Cdc.UnmarshalJSON(bz, &resp) - require.NoError(n.t, err) - - return resp -} - -func (n *NodeConfig) QueryAppliedPlan(planName string) upgradetypes.QueryAppliedPlanResponse { - path := fmt.Sprintf("cosmos/upgrade/v1beta1/applied_plan/%s", planName) - bz, err := n.QueryGRPCGateway(path, url.Values{}) - require.NoError(n.t, err) - - var resp upgradetypes.QueryAppliedPlanResponse - err = util.Cdc.UnmarshalJSON(bz, &resp) - require.NoError(n.t, err) - - return resp -} - -func (n *NodeConfig) QueryTx(txHash string, overallFlags ...string) sdk.TxResponse { - cmd := []string{ - "babylond", "q", "tx", "--type=hash", txHash, "--output=json", - n.FlagChainID(), - } - - out, _, err := n.containerManager.ExecCmd(n.t, n.Name, append(cmd, overallFlags...), "") - require.NoError(n.t, err) - - var txResp sdk.TxResponse - err = util.Cdc.UnmarshalJSON(out.Bytes(), &txResp) - require.NoError(n.t, err) - - return txResp -} diff --git a/test/e2e/configurer/chain/queries_ibc.go b/test/e2e/configurer/chain/queries_ibc.go index 39c5cc3e7..f5889b229 100644 --- a/test/e2e/configurer/chain/queries_ibc.go +++ b/test/e2e/configurer/chain/queries_ibc.go @@ -23,21 +23,6 @@ func (n *NodeConfig) QueryIBCChannels() (*channeltypes.QueryChannelsResponse, er return &resp, nil } -func (n *NodeConfig) QueryChannelClientState(channelID, portID string) (*channeltypes.QueryChannelClientStateResponse, error) { - path := fmt.Sprintf("/ibc/core/channel/v1/channels/%s/ports/%s/client_state", channelID, portID) - bz, err := n.QueryGRPCGateway(path, url.Values{}) - if err != nil { - return nil, err - } - - var resp channeltypes.QueryChannelClientStateResponse - if err := util.Cdc.UnmarshalJSON(bz, &resp); err != nil { - return nil, err - } - - return &resp, nil -} - func (n *NodeConfig) QueryNextSequenceReceive(channelID, portID string) (*channeltypes.QueryNextSequenceReceiveResponse, error) { path := fmt.Sprintf("/ibc/core/channel/v1/channels/%s/ports/%s/next_sequence", channelID, portID) bz, err := n.QueryGRPCGateway(path, url.Values{})