Skip to content

Commit

Permalink
chore: removed unused msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Sep 2, 2024
1 parent 88f66f4 commit 4bf9af9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 152 deletions.
8 changes: 0 additions & 8 deletions test/e2e/configurer/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
59 changes: 0 additions & 59 deletions test/e2e/configurer/chain/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
}
17 changes: 0 additions & 17 deletions test/e2e/configurer/chain/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
53 changes: 0 additions & 53 deletions test/e2e/configurer/chain/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ 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"
sdk "github.com/cosmos/cosmos-sdk/types"
"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"
Expand Down Expand Up @@ -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
}
15 changes: 0 additions & 15 deletions test/e2e/configurer/chain/queries_ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit 4bf9af9

Please sign in to comment.