Skip to content

Commit

Permalink
Merge pull request #197 from White-Whale-Defi-Platform/nguyen/ibc-hooks
Browse files Browse the repository at this point in the history
Nguyen/ibc hooks
  • Loading branch information
faddat authored Sep 8, 2023
2 parents 7754ded + 8bd3a0c commit 4e2b7af
Show file tree
Hide file tree
Showing 55 changed files with 2,417 additions and 1,218 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Interchain Tests

on:
pull_request:
push:
branches:
- main

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build_push_image
uses: docker/build-push-action@v4
with:
file: Dockerfile
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/white-whale-defi-platform/migaloo-chain-ictest:latest
test-start-cosmos-chain:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: '1.20'

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

- run: make ictest-start-cosmos
env:
BRANCH_CI: 'latest'
test-ibc-transfer:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: '1.20'

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

- run: make ictest-ibc
env:
BRANCH_CI: 'latest'
test-ibc-hooks:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: '1.20'

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

- run: make ictest-ibc-hooks
env:
BRANCH_CI: 'latest'
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
bin
.vscode
.ash_history



go.work.sum
13 changes: 12 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ run:
linters:
disable-all: true
enable:
- depguard
- dogsled
- errcheck
- exportloopref
- gci
- goconst
- gocritic
- gofumpt
Expand Down Expand Up @@ -71,6 +71,17 @@ issues:
max-same-issues: 10000

linters-settings:
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/cometbft/cometbft)
- prefix(github.com/White-Whale-Defi-Platform/migaloo-chain)
custom-order: true
dogsled:
max-blank-identifiers: 3
maligned:
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ install: go.sum
build:
go build $(BUILD_FLAGS) -o bin/migalood ./cmd/migalood

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t migaloo:debug -f Dockerfile .

runsim: $(RUNSIM)
$(RUNSIM):
@echo "Installing runsim..."
Expand Down Expand Up @@ -125,4 +128,21 @@ test-sim-custom-genesis-fast:
@go test $(TEST_FLAGS) -mod=readonly $(SIMAPP) -run TestFullAppSimulation \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

###############################################################################
### Interchain test ###
###############################################################################

# Executes start chain tests via interchaintest
ictest-start-cosmos:
cd tests/interchaintest && go test -race -v -run TestStartMigaloo .

ictest-ibc:
cd tests/interchaintest && go test -race -v -run TestMigalooGaiaIBCTransfer .

ictest-ibc-hooks:
cd tests/interchaintest && go test -race -v -run TestIBCHooks .

# Executes all tests via interchaintest after compling a local image as migaloo:local
ictest-all: ictest-start-cosmos ictest-ibc

.PHONY: ictest-start-cosmos ictest-all ictest-ibc-hooks ictest-ibc
10 changes: 5 additions & 5 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package app

import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
Loading

0 comments on commit 4e2b7af

Please sign in to comment.