diff --git a/.changelog/v0.50.3/bug-fixes/49-upgrade-cometbft-dependency.md b/.changelog/v0.50.3/bug-fixes/49-upgrade-cometbft-dependency.md new file mode 100644 index 0000000000..921dfdee73 --- /dev/null +++ b/.changelog/v0.50.3/bug-fixes/49-upgrade-cometbft-dependency.md @@ -0,0 +1,2 @@ +- Update to cometbft to v0.38.15 + ([\#49](https://github.com/oraichain/wasmd/pull/49)) \ No newline at end of file diff --git a/.github/workflows/interchaintest.yaml b/.github/workflows/interchaintest.yaml new file mode 100644 index 0000000000..7ba7ea6cc4 --- /dev/null +++ b/.github/workflows/interchaintest.yaml @@ -0,0 +1,131 @@ +name: Interchain Tests + +on: + pull_request: + push: + branches: + - release/** + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_PAT }} + + - name: Build and push + id: build_push_image + uses: docker/build-push-action@v5 + with: + file: ict.Dockerfile + context: . + push: true + platforms: linux/amd64 + tags: | + ghcr.io/oraichain/oraid-ictest:latest + test-basic: + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-basic + env: + BRANCH_CI: "latest" + ictest-interchain-account: + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-interchain-account + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-tf-param-change + env: + BRANCH_CI: "latest" + ictest-tf-set-metadata: + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-tf-set-metadata + env: + BRANCH_CI: "latest" + ictest-ibchooks: + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-ibchooks + env: + BRANCH_CI: "latest" + ictest-wasm-gasless: + 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 + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: checkout code + uses: actions/checkout@v4 + + - run: make ictest-wasm-gasless + env: + BRANCH_CI: "latest" \ No newline at end of file diff --git a/tests/interchaintest/ibc_hooks_test.go b/tests/interchaintest/ibc_hooks_test.go index ed1938b507..e90ced8ade 100644 --- a/tests/interchaintest/ibc_hooks_test.go +++ b/tests/interchaintest/ibc_hooks_test.go @@ -1,7 +1,6 @@ package interchaintest import ( - "context" "fmt" "testing" @@ -11,11 +10,8 @@ import ( "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" - "github.com/strangelove-ventures/interchaintest/v8/relayer" - "github.com/strangelove-ventures/interchaintest/v8/testreporter" "github.com/strangelove-ventures/interchaintest/v8/testutil" "github.com/stretchr/testify/require" - "go.uber.org/zap/zaptest" ) // TestStartOrai is a basic test to assert that spinning up a Orai network with 1 validator works properly. @@ -25,66 +21,9 @@ func TestIbcHooks(t *testing.T) { } t.Parallel() - - ctx := context.Background() - - numVals := 1 - numFullNodes := 1 - - cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - { - Name: "orai", - ChainConfig: oraiConfig, - NumValidators: &numVals, - NumFullNodes: &numFullNodes, - }, - { - Name: "gaia", - Version: GaiaImageVersion, - NumValidators: &numVals, - NumFullNodes: &numFullNodes, - }, - }) - - // Get chains from the chain factory - chains, err := cf.Chains(t.Name()) - require.NoError(t, err) - + chains := CreateChains(t, 1, 1) orai, gaia := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) - - // Create relayer factory to utilize the go-relayer - client, network := interchaintest.DockerSetup(t) - r := interchaintest.NewBuiltinRelayerFactory( - ibc.CosmosRly, - zaptest.NewLogger(t), - relayer.CustomDockerImage(IBCRelayerImage, IBCRelayerVersion, "100:1000"), - ).Build(t, client, network) - - ic := interchaintest.NewInterchain(). - AddChain(orai). - AddChain(gaia). - AddRelayer(r, "rly"). - AddLink(interchaintest.InterchainLink{ - Chain1: orai, - Chain2: gaia, - Relayer: r, - Path: pathOraiGaia, - }) - - rep := testreporter.NewNopReporter() - eRep := rep.RelayerExecReporter(t) - - err = ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ - TestName: t.Name(), - Client: client, - NetworkID: network, - SkipPathCreation: false, - - // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. - // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), - }) - require.NoError(t, err) - + ic, r, ctx, _, eRep, _ := BuildInitialChain(t, chains) t.Cleanup(func() { _ = ic.Close() }) diff --git a/tests/interchaintest/setup.go b/tests/interchaintest/setup.go index 5cbde51c96..7f71ea3890 100644 --- a/tests/interchaintest/setup.go +++ b/tests/interchaintest/setup.go @@ -27,6 +27,7 @@ const ( // Chain and relayer version inf IBCRelayerImage = "ghcr.io/cosmos/relayer" + OraidICTestRepo = "ghcr.io/oraichain/oraid-ictest" IBCRelayerVersion = "latest" GaiaImageVersion = "v21.0.0" OsmosisImageVersion = "v22.0.1" @@ -77,9 +78,9 @@ func oraiEncoding() *moduletestutil.TestEncodingConfig { // If testing locally, user should run `make docker-build-debug` and interchaintest will use the local image. func GetDockerImageInfo() (repo, version string) { branchVersion, found := os.LookupEnv("BRANCH_CI") + repo = OraidICTestRepo if !found { // make local-image - fmt.Println("Testing local image") repo = "orai" branchVersion = "debug" } @@ -131,8 +132,11 @@ func CreateChains(t *testing.T, numVals, numFullNodes int, opts ...func(*ibc.Cha NumFullNodes: &numFullNodes, }, { - Name: "gaia", - Version: GaiaImageVersion, + Name: "gaia", + Version: GaiaImageVersion, + ChainConfig: ibc.ChainConfig{ + GasPrices: "1uatom", + }, NumValidators: &numVals, NumFullNodes: &numFullNodes, }, @@ -185,7 +189,7 @@ func BuildInitialChainNoIbc(t *testing.T, chain ibc.Chain) (*interchaintest.Inte return ic, ctx } -func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, ibc.Relayer, context.Context, *client.Client, string) { +func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, ibc.Relayer, context.Context, *client.Client, *testreporter.RelayerExecReporter, string) { // Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use require.Equal(t, len(chains), 2) // we only initial 2 chain for now ic := interchaintest.NewInterchain() @@ -224,5 +228,5 @@ func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interc }) require.NoError(t, err) - return ic, r, ctx, client, network + return ic, r, ctx, client, eRep, network } diff --git a/tests/interchaintest/tokenfactory_test.go b/tests/interchaintest/tokenfactory_test.go index caf9c3d5db..062170b9e2 100644 --- a/tests/interchaintest/tokenfactory_test.go +++ b/tests/interchaintest/tokenfactory_test.go @@ -24,7 +24,7 @@ func TestTokenfactoryParamChange(t *testing.T) { t.Parallel() chains := CreateChains(t, 1, 1) orai := chains[0].(*cosmos.CosmosChain) - ic, _, ctx, _, _ := BuildInitialChain(t, chains) + ic, _, ctx, _, _, _ := BuildInitialChain(t, chains) t.Cleanup(func() { _ = ic.Close() })