From 8da9d2f8d25c18c8ce9c6f9c520968703dd671d8 Mon Sep 17 00:00:00 2001 From: rapha Date: Wed, 24 Apr 2024 09:31:09 +0200 Subject: [PATCH] feat: test kyve image in interchaintest --- Makefile | 5 ++++ interchaintest/upgrades/v1_5/upgrade_test.go | 25 +++++++++++++++---- .../upgrades/v1_5/upgrade_utils_test.go | 21 ++++++++++++++++ 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 03a91c35..25250654 100644 --- a/Makefile +++ b/Makefile @@ -182,12 +182,17 @@ proto-setup: ensure_heighliner: @which heighliner > /dev/null || (echo "❌ Heighliner not found. Please install it by running 'make heighliner-setup'." && exit 1) @docker inspect kaon:local > /dev/null || (echo "❌ Kaon image not found. Please build it by running 'make heighliner'." && exit 1) + @docker inspect kyve:local > /dev/null || (echo "❌ Kyve image not found. Please build it by running 'make heighliner'." && exit 1) heighliner: @echo "🤖 Building Kaon image..." @heighliner build --chain kaon --local 1> /dev/null @echo "✅ Completed build!" + @echo "🤖 Building Kyve image..." + @heighliner build --chain kyve --local 1> /dev/null + @echo "✅ Completed build!" + heighliner-setup: @echo "🤖 Installing Heighliner..." @git clone https://github.com/strangelove-ventures/heighliner.git /tmp/heighliner diff --git a/interchaintest/upgrades/v1_5/upgrade_test.go b/interchaintest/upgrades/v1_5/upgrade_test.go index eb40a804..9514852b 100644 --- a/interchaintest/upgrades/v1_5/upgrade_test.go +++ b/interchaintest/upgrades/v1_5/upgrade_test.go @@ -33,6 +33,7 @@ func TestV1P2Upgrade(t *testing.T) { var _ = Describe(fmt.Sprintf("%s Upgrade Tests", v1_5.UpgradeName), Ordered, func() { var kaon *cosmos.CosmosChain + var kyve *cosmos.CosmosChain var ctx context.Context var client *client.Client @@ -40,6 +41,7 @@ var _ = Describe(fmt.Sprintf("%s Upgrade Tests", v1_5.UpgradeName), Ordered, fun var interchain *interchaintest.Interchain var kaonWallet *cosmos.CosmosWallet + var kyveWallet *cosmos.CosmosWallet BeforeAll(func() { numFullNodes := 0 @@ -51,14 +53,21 @@ var _ = Describe(fmt.Sprintf("%s Upgrade Tests", v1_5.UpgradeName), Ordered, fun NumValidators: &numValidators, NumFullNodes: &numFullNodes, }, + { + Name: "kyve", + ChainConfig: mainnetConfig, + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + }, }) chains, err := factory.Chains(GinkgoT().Name()) Expect(err).To(BeNil()) - kaon = chains[0].(*cosmos.CosmosChain) + kaon, kyve = chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) interchain = interchaintest.NewInterchain(). - AddChain(kaon) + AddChain(kaon). + AddChain(kyve) ctx = context.Background() client, network = interchaintest.DockerSetup(GinkgoT()) @@ -72,18 +81,24 @@ var _ = Describe(fmt.Sprintf("%s Upgrade Tests", v1_5.UpgradeName), Ordered, fun Expect(err).To(BeNil()) wallets := interchaintest.GetAndFundTestUsers( - GinkgoT(), ctx, GinkgoT().Name(), math.NewInt(10_000_000_000), kaon, + GinkgoT(), ctx, GinkgoT().Name(), math.NewInt(10_000_000_000), kaon, kyve, ) - kaonWallet = wallets[0].(*cosmos.CosmosWallet) + kaonWallet, kyveWallet = wallets[0].(*cosmos.CosmosWallet), wallets[1].(*cosmos.CosmosWallet) }) AfterAll(func() { + _ = kaon.StopAllNodes(ctx) + _ = kyve.StopAllNodes(ctx) _ = interchain.Close() }) - It("", func() { + It("Kaon upgrade test", func() { PerformUpgrade(ctx, client, kaon, kaonWallet, 10, "kaon") }) + + It("Kyve upgrade test", func() { + PerformUpgrade(ctx, client, kyve, kyveWallet, 10, "kyve") + }) }) type Plan struct { diff --git a/interchaintest/upgrades/v1_5/upgrade_utils_test.go b/interchaintest/upgrades/v1_5/upgrade_utils_test.go index 2dfc360f..b11d07cd 100644 --- a/interchaintest/upgrades/v1_5/upgrade_utils_test.go +++ b/interchaintest/upgrades/v1_5/upgrade_utils_test.go @@ -37,6 +37,27 @@ var testnetConfig = ibc.ChainConfig{ EncodingConfig: nil, } +var mainnetConfig = ibc.ChainConfig{ + Type: "cosmos", + Name: "kyve", + ChainID: "kyve-1", + Images: []ibc.DockerImage{{ + Repository: "ghcr.io/strangelove-ventures/heighliner/kyve", + Version: previousVersion, + UidGid: uidGid, + }}, + Bin: "kyved", + Bech32Prefix: "kyve", + Denom: "ukyve", + GasPrices: "0.02ukyve", + GasAdjustment: 5, + TrustingPeriod: "112h", + NoHostMount: false, + ModifyGenesis: ModifyGenesis, + ConfigFileOverrides: nil, + EncodingConfig: nil, +} + func ModifyGenesis(config ibc.ChainConfig, genbz []byte) ([]byte, error) { genesis := make(map[string]interface{}) _ = json.Unmarshal(genbz, &genesis)