Skip to content

Commit dd7a5ed

Browse files
authored
Merge pull request #82 from cosmos/chore/remove-ics
chore: remove ICS
2 parents aaba808 + 9a404ca commit dd7a5ed

File tree

18 files changed

+245
-1568
lines changed

18 files changed

+245
-1568
lines changed

chain/cosmos/chain_node.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"math/rand"
1212
"os"
1313
"path"
14-
"path/filepath"
1514
"strconv"
1615
"strings"
1716
"sync"
@@ -22,13 +21,11 @@ import (
2221
"github.com/docker/go-connections/nat"
2322
dockerclient "github.com/moby/moby/client"
2423
"go.uber.org/zap"
25-
"golang.org/x/mod/semver"
2624
"golang.org/x/sync/errgroup"
2725
"google.golang.org/grpc"
2826
"google.golang.org/grpc/credentials/insecure"
2927

3028
icatypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/types"
31-
ccvclient "github.com/cosmos/interchain-security/v7/x/ccv/provider/client"
3229

3330
"github.com/cosmos/cosmos-sdk/client"
3431
"github.com/cosmos/cosmos-sdk/codec"
@@ -755,24 +752,6 @@ func (tn *ChainNode) IsAboveSDK47(ctx context.Context) bool {
755752
return tn.HasCommand(ctx, "genesis")
756753
}
757754

758-
// ICSVersion returns the version of interchain-security the binary was built with.
759-
// If it doesn't depend on interchain-security, it returns an empty string.
760-
func (tn *ChainNode) ICSVersion(ctx context.Context) string {
761-
if strings.HasPrefix(tn.Chain.Config().Bin, "interchain-security") {
762-
// This isn't super pretty, but it's the best we can do for an interchain-security binary.
763-
// It doesn't depend on itself, and the version command doesn't actually output a version.
764-
// Ideally if you have a binary called something like "v3.3.0-my-fix" you can use it as a version, since the v3.3.0 part is in it.
765-
return semver.Canonical(tn.Image.Version)
766-
}
767-
info := tn.GetBuildInformation(ctx)
768-
for _, dep := range info.BuildDeps {
769-
if strings.HasPrefix(dep.Parent, "github.com/cosmos/interchain-security") {
770-
return semver.Canonical(dep.Version)
771-
}
772-
}
773-
return ""
774-
}
775-
776755
// AddGenesisAccount adds a genesis account for each key.
777756
func (tn *ChainNode) AddGenesisAccount(ctx context.Context, address string, genesisAmount []sdk.Coin) error {
778757
amount := ""
@@ -887,27 +866,6 @@ func (tn *ChainNode) SendIBCTransfer(
887866
return tn.ExecTx(ctx, keyName, command...)
888867
}
889868

890-
func (tn *ChainNode) ConsumerAdditionProposal(ctx context.Context, keyName string, prop ccvclient.ConsumerAdditionProposalJSON) (string, error) {
891-
propBz, err := json.Marshal(prop)
892-
if err != nil {
893-
return "", err
894-
}
895-
896-
fileName := "proposal_" + dockerutil.RandLowerCaseLetterString(4) + ".json"
897-
898-
fw := dockerutil.NewFileWriter(tn.logger(), tn.DockerClient, tn.TestName)
899-
if err := fw.WriteFile(ctx, tn.VolumeName, fileName, propBz); err != nil {
900-
return "", fmt.Errorf("failure writing proposal json: %w", err)
901-
}
902-
903-
filePath := filepath.Join(tn.HomeDir(), fileName)
904-
905-
return tn.ExecTx(ctx, keyName,
906-
"gov", "submit-legacy-proposal", "consumer-addition", filePath,
907-
"--gas", "auto",
908-
)
909-
}
910-
911869
func (tn *ChainNode) GetTransaction(clientCtx client.Context, txHash string) (*sdk.TxResponse, error) {
912870
// Retry because sometimes the tx is not committed to state yet.
913871
var txResp *sdk.TxResponse

chain/cosmos/codec.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
transfer "github.com/cosmos/ibc-go/v10/modules/apps/transfer"
77
ibccore "github.com/cosmos/ibc-go/v10/modules/core"
88
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
9-
ccvprovider "github.com/cosmos/interchain-security/v7/x/ccv/provider"
109

1110
"github.com/cosmos/cosmos-sdk/codec"
1211
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -51,7 +50,6 @@ func DefaultEncoding() testutil.TestEncodingConfig {
5150
ibccore.AppModuleBasic{},
5251
ibctm.AppModuleBasic{},
5352
ibcwasm.AppModuleBasic{},
54-
ccvprovider.AppModuleBasic{},
5553
)
5654
}
5755

chain/cosmos/cosmos_chain.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
ethkeyring "github.com/cosmos/evm/crypto/keyring"
2727
clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" // nolint:staticcheck
2828
chanTypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
29-
ccvclient "github.com/cosmos/interchain-security/v7/x/ccv/provider/client"
3029

3130
"github.com/cosmos/cosmos-sdk/codec"
3231
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
@@ -54,8 +53,6 @@ type CosmosChain struct {
5453
numFullNodes int
5554
Validators ChainNodes
5655
FullNodes ChainNodes
57-
Provider *CosmosChain
58-
Consumers []*CosmosChain
5956

6057
// preStartNodes is able to mutate the node containers before
6158
// they are all started
@@ -528,15 +525,6 @@ func (c *CosmosChain) QueryBankMetadata(ctx context.Context, denom string) (*Ban
528525
return c.GetFullNode().QueryBankMetadata(ctx, denom)
529526
}
530527

531-
// ConsumerAdditionProposal submits a legacy governance proposal to add a consumer to the chain.
532-
func (c *CosmosChain) ConsumerAdditionProposal(ctx context.Context, keyName string, prop ccvclient.ConsumerAdditionProposalJSON) (tx TxProposal, _ error) {
533-
txHash, err := c.GetFullNode().ConsumerAdditionProposal(ctx, keyName, prop)
534-
if err != nil {
535-
return tx, fmt.Errorf("failed to submit consumer addition proposal: %w", err)
536-
}
537-
return c.txProposal(txHash)
538-
}
539-
540528
func (c *CosmosChain) txProposal(txHash string) (tx TxProposal, _ error) {
541529
txResp, err := c.GetTransaction(txHash)
542530
if err != nil {
@@ -856,10 +844,6 @@ type ValidatorWithIntPower struct {
856844

857845
// Bootstraps the chain and starts it from genesis.
858846
func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error {
859-
if c.cfg.InterchainSecurityConfig.ConsumerCopyProviderKey != nil && c.Provider == nil {
860-
return fmt.Errorf("don't set ConsumerCopyProviderKey if it's not a consumer chain")
861-
}
862-
863847
chainCfg := c.Config()
864848

865849
decimalPow := int64(math.Pow10(int(*chainCfg.CoinDecimals)))

0 commit comments

Comments
 (0)