Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions .github/workflows/interchaintest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,40 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-basic
env:
BRANCH_CI: "latest"
ictest-interchain-account:
ictest-interchain-account-from-orai:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-interchain-account
- run: make ictest-interchain-account-from-orai
env:
BRANCH_CI: "latest"
ictest-tf-param-change:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -87,10 +87,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -102,10 +102,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -117,10 +117,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -132,10 +132,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -147,14 +147,29 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.22.7'
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-txfees-add-fee-token
env:
BRANCH_CI: "latest"
ictest-interchain-account-from-gaia:
runs-on: ubuntu-latest
needs: build-and-push-image # This job must run after build and push image
steps:
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: "1.23.6"

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-interchain-account-from-gaia
env:
BRANCH_CI: "latest"
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ ictest-basic:
cd tests/interchaintest && go test -race -v -run TestStartOrai .

# Executes interchain account tests via interchaintest
ictest-interchain-account:
cd tests/interchaintest && go test -race -v -run TestInterchainAccount .
ictest-interchain-account-from-orai:
cd tests/interchaintest && go test -race -v -run TestInterchainAccountFromOrai .

# Executes interchain account tests via interchaintest
ictest-interchain-account-from-gaia:
cd tests/interchaintest && go test -race -v -run TestInterchainAccountFromGaia .

# Executes token factory param change tests via interchaintest
ictest-tf-param-change:
Expand Down
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ func NewWasmApp(
appCodec,
keys[icahosttypes.StoreKey],
app.GetSubspace(icahosttypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.HooksICS4Wrapper,
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
app.AccountKeeper,
Expand Down Expand Up @@ -871,7 +871,6 @@ func NewWasmApp(
var icaControllerStack porttypes.IBCModule
// integration point for custom authentication modules
// see https://medium.com/the-interchain-foundation/ibc-go-v6-changes-to-interchain-accounts-and-how-it-impacts-your-chain-806c185300d7
icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper)
icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper)

// RecvPacket, message that originates from core IBC and goes down to app, the flow is:
Expand Down
2 changes: 2 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
v0501 "github.com/CosmWasm/wasmd/app/upgrades/v0501"
v05010 "github.com/CosmWasm/wasmd/app/upgrades/v05010"
v05011 "github.com/CosmWasm/wasmd/app/upgrades/v05011"
v05012 "github.com/CosmWasm/wasmd/app/upgrades/v05012"
v0502 "github.com/CosmWasm/wasmd/app/upgrades/v0502"
v0503 "github.com/CosmWasm/wasmd/app/upgrades/v0503"
v0504 "github.com/CosmWasm/wasmd/app/upgrades/v0504"
Expand Down Expand Up @@ -57,6 +58,7 @@ var Upgrades = []upgrades.Upgrade{
v0509.Upgrade,
v05010.Upgrade,
v05011.Upgrade,
v05012.Upgrade,
}

// RegisterUpgradeHandlers registers the chain upgrade handlers
Expand Down
39 changes: 39 additions & 0 deletions app/upgrades/v05012/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package v05012

import (
"context"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"

"github.com/CosmWasm/wasmd/app/upgrades"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)

// UpgradeName defines the on-chain upgrade name
const UpgradeName = "v0.50.12"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{
Added: []string{},
Deleted: []string{},
},
}

func CreateUpgradeHandler(
mm upgrades.ModuleManager,
configurator module.Configurator,
ak *upgrades.AppKeepers,
keys map[string]*storetypes.KVStoreKey,
cdc codec.BinaryCodec,
) upgradetypes.UpgradeHandler {
return func(goCtx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
migrationRes, err := mm.RunMigrations(ctx, configurator, fromVM)
return migrationRes, err
}
}
40 changes: 39 additions & 1 deletion tests/interchaintest/helpers/ica.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ package helpers

import (
"context"
"encoding/json"
"fmt"
"path"
"testing"

"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/dockerutil"
)

// RegisterICA will attempt to register an interchain account on the counterparty chain.
Expand All @@ -24,6 +28,33 @@ func RegisterICA(t *testing.T,
)
}

func ExecuteICA(
t *testing.T,
ctx context.Context,
chain *cosmos.CosmosChain,
keyName, connectionID string,
msg []byte,
) (string, error) {
tn := chain.GetNode()

file := "msg.json"
fw := dockerutil.NewFileWriter(nil, tn.DockerClient, tn.TestName)
if err := fw.WriteFile(ctx, tn.VolumeName, file, msg); err != nil {
return "", fmt.Errorf("writing contract file to docker volume: %w", err)
}

command := []string{
"interchain-accounts",
"controller",
"send-tx",
connectionID,
path.Join(tn.HomeDir(), file),
"--gas", "auto",
}

return tn.ExecTx(ctx, keyName, command...)
}

// QueryParam returns the state and details of a subspace param.
func QueryInterchainAccount(t *testing.T,
ctx context.Context,
Expand All @@ -43,5 +74,12 @@ func QueryInterchainAccount(t *testing.T,
if err != nil {
return "", err
}
return string(stdout), nil

var icaAccount IcaAccount
err = json.Unmarshal(stdout, &icaAccount)
if err != nil {
return "", err
}

return icaAccount.Address, nil
}
4 changes: 4 additions & 0 deletions tests/interchaintest/helpers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ type HackatomExampleInitMsg struct {
type QuerySqrtPriceResponse struct {
Data string `json:"data,omitempty"`
}

type IcaAccount struct {
Address string `json:"address"`
}
Loading
Loading