Skip to content

Commit

Permalink
bump cosmos-sdk to v0.46.1 & fix some bugs (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamer authored Nov 3, 2022
1 parent 5016c1b commit bf43b48
Show file tree
Hide file tree
Showing 281 changed files with 9,049 additions and 9,174 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sims.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Simulation Test
on: [pull_request]

jobs:
test-sim-nondeterminism-fast:
name: Test AppStateDeterminism
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18' # The Go version to download (if necessary) and use.
- run: make test-sim-nondeterminism-fast
test-sim-import-export:
name: Test AppImportExport
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18' # The Go version to download (if necessary) and use.
- run: make test-sim-import-export
test-sim-after-import:
name: Test AppSimulationAfterImport
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18' # The Go version to download (if necessary) and use.
- run: make test-sim-after-import
23 changes: 5 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Run unit tests
uses: cedrickring/golang-action/[email protected]
env:
GO111MODULE: "on"
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
args: make test-unit
test-sim:
name: Test Simulations
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Run simulation tests
uses: cedrickring/golang-action/[email protected]
env:
GO111MODULE: "on"
with:
args: make test-sim-nondeterminism-fast
go-version: '^1.18' # The Go version to download (if necessary) and use.
- run: make test-unit
12 changes: 12 additions & 0 deletions .github/workflows/wip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: WIP
on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
wip:
runs-on: ubuntu-latest
steps:
- uses: wip/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,23 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Bug Fixes

* [\#304](https://github.com/irisnet/irismod/pull/304) Fix nft module import error.
* [\#314](https://github.com/irisnet/irismod/pull/314) Fix `addLiquidity` panic error.

### Improvements

* [\#305](https://github.com/irisnet/irismod/pull/305) Remove ibc-go from project.
* [\#306](https://github.com/irisnet/irismod/pull/306) Bump up cosmos-sdk to v0.46.1.
* [\#307](https://github.com/irisnet/irismod/pull/307) Refactor proto-gen with docker.
* [\#308](https://github.com/irisnet/irismod/pull/308) Coinswap module adds unilateral injection liquidity function.
* [\#309](https://github.com/irisnet/irismod/pull/309) Refactor nft with cosmos-sdk nft module.

### API Breaking Changes

* [\#309](https://github.com/irisnet/irismod/pull/309) GRPC method `Owner` rename to `NFTsOfOwner`, Remove deprecated `Queries` api

## [v1.6.0] - 2022-08-08

### Improvements
Expand Down
48 changes: 36 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

SIMAPP = ./simapp
BINDIR ?= $(GOPATH)/bin
CURRENT_DIR = $(shell pwd)

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
PACKAGES_UNITTEST=$(shell go list ./... | grep -v '/simulation' | grep -v '/cli_test')
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)

ldflags = -X github.com/cosmos/cosmos-sdk/types.reDnmString=[a-zA-Z][a-zA-Z0-9/:]{2,127}

Expand Down Expand Up @@ -35,10 +39,36 @@ clean:
distclean: clean
rm -rf vendor/

proto-all: proto-tools proto-gen
###############################################################################
### Protobuf ###
###############################################################################

protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer)
containerProtoGenAny=$(PROJECT_NAME)-proto-gen-any-$(protoVer)
containerProtoGenSwagger=$(PROJECT_NAME)-proto-gen-swagger-$(protoVer)
containerProtoFmt=$(PROJECT_NAME)-proto-fmt-$(protoVer)

proto-all: proto-format proto-gen

proto-gen:
@./scripts/protocgen.sh
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protoc-swagger-gen.sh; fi

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi

proto-lint:
@$(DOCKER_BUF) lint --error-format=json

########################################
### Testing
Expand All @@ -50,27 +80,21 @@ test-unit:

test-sim-nondeterminism:
@echo "Running non-determinism test..."
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
@cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h

test-sim-nondeterminism-fast:
@echo "Running non-determinism test..."
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
@cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=10 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h

test-sim-custom-genesis-fast:
@echo "Running custom genesis simulation..."
@echo "By default, $(shell pwd)/testdata/genesis.json will be used."
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=$(shell pwd)/testdata/genesis.json \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

test-sim-import-export: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppImportExport

test-sim-after-import: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport
@cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppSimulationAfterImport

test-sim-custom-genesis-multi-seed: runsim
@echo "Running multi-seed custom genesis simulation..."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ IRISnet Modules

**Note**: This repository is meant to house modules that are created outside of the [IRIS Hub](https://github.com/irisnet/irishub) repository.

**Note**: Requires [Go 1.14+](https://golang.org/dl/)
**Note**: Requires [Go 1.18+](https://golang.org/dl/)
9 changes: 9 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
# remove this comment when you're finished.
#
# This workspace file points to the roots found in your
# previous "buf.yaml" configuration.
version: v1
directories:
- proto
- third_party/proto
2 changes: 1 addition & 1 deletion contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ buf-stamp:
runsim: $(RUNSIM)
$(RUNSIM):
@echo "Installing runsim..."
@(cd /tmp && go get github.com/cosmos/tools/cmd/[email protected])
@go install github.com/cosmos/tools/cmd/[email protected]

tools-clean:
rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM)
Expand Down
Loading

0 comments on commit bf43b48

Please sign in to comment.