Skip to content

Commit

Permalink
chore: bump SDK to v0.45.9 and remove its own ics23 package and use c… (
Browse files Browse the repository at this point in the history
#377)

* chore: bump SDk to v0.45.9 and remove its own ics23 package and use cosmos-sdk ics23

* build: bump go version to 1.18

* chore: update version and upgrade go version in workflow actions

* build: use new SDK version that is based v0.45.9

* fix: add validation check on match

* build: use module golangci-lint and resolve lint issues

* fix: use go install instead of go get
  • Loading branch information
jaybxyz committed Oct 17, 2022
1 parent f1f34d1 commit 043c8f9
Show file tree
Hide file tree
Showing 25 changed files with 1,962 additions and 5,803 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ write a little note why.
- [ ] Appropriate labels applied
- [ ] Targeted PR against correct branch
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/v0.45.3/docs/building-modules/README.md).
- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/v0.45.9/docs/building-modules/README.md).
- [ ] Wrote unit and integration
- [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`)
- [ ] Added relevant `godoc` [comments](https://go.dev/blog/godoc).
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: Lint
# Lint runs golangci-lint over the entire cosmos-sdk repository
# This workflow is run on every pull request and push to main
# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed.
on:
pull_request:
push:
branches:
- main

jobs:
golangci:
name: golangci-lint
name: Run golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@master
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.40
args: --timeout 10m
github-token: ${{ secrets.github_token }}
go-version: 1.18
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Run golangci-lint
run: make lint
if: env.GIT_DIFF
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- run: make build
Expand All @@ -27,11 +27,11 @@ jobs:
steps:
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- name: Install runsim
run: export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v2.1.6
with:
path: ~/go/bin
Expand All @@ -44,7 +44,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
go-version: 1.18
- name: Display go version
run: go version
- uses: technote-space/get-diff-action@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- uses: technote-space/get-diff-action@v6.0.1
id: git_diff
with:
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: display go version
run: go version
- name: test & coverage report creation
Expand All @@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: display go version
run: go version
- name: test & coverage report creation
Expand All @@ -87,4 +87,4 @@ jobs:
done
- uses: codecov/codecov-action@v2.1.0
with:
file: ./coverage.txt
file: ./coverage.txt
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## v2.1.2

* [\#377](https://github.com/cosmosquad-labs/squad/pull/377) build!: bump cosmos-sdk to v0.45.9, tendermint v0.34.21, go 1.18

## v2.1.1

### Improvements
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ localnet:
###############################################################################

lint:
$(BINDIR)/golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*.pb.go" -not -path "*/statik*" | xargs gofmt -d -s
go mod verify
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m

.PHONY: lint

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ The Squad contains the following Cosmos SDK modules

If you haven't already, install Golang by following the [official docs](https://golang.org/doc/install). Make sure that your `GOPATH` and `GOBIN` environment variables are properly set up.

This project uses customized cosmos-sdk, Please check the difference on [here](https://github.com/cosmosquad-labs/cosmos-sdk/compare/v0.45.3...v1.1.0-sdk-0.45.3).
This project uses customized cosmos-sdk, Please check the difference on [here](https://github.com/cosmosquad-labs/cosmos-sdk/compare/v0.45.9...v1.1.1-sdk-0.45.9).

| Requirement | Notes |
|-----------------------|-------------------|
| Go version | Go1.17 or higher |
| Cosmos SDK (custom) | v1.1.0-sdk-0.45.3 |
| Go version | Go1.18 or higher |
| Cosmos SDK (custom) | v1.1.1-sdk-0.45.9 |

## Installation

Expand Down
6 changes: 3 additions & 3 deletions app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"time"

tmjson "github.com/tendermint/tendermint/libs/json"
Expand Down Expand Up @@ -57,7 +57,7 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty

case config.ParamsFile != "":
appParams := make(simtypes.AppParams)
bz, err := ioutil.ReadFile(config.ParamsFile)
bz, err := os.ReadFile(config.ParamsFile)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -196,7 +196,7 @@ func AppStateRandomizedFn(
// AppStateFromGenesisFileFn util function to generate the genesis AppState
// from a genesis.json file.
func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) {
bytes, err := ioutil.ReadFile(genesisFile)
bytes, err := os.ReadFile(genesisFile)
if err != nil {
panic(err)
}
Expand Down
8 changes: 4 additions & 4 deletions contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,24 @@ tools-stamp: statik runsim
touch $@

# Install the runsim binary with a temporary workaround of entering an outside
# directory as the "go get" command ignores the -mod option and will polute the
# directory as the "go install" command ignores the -mod option and will polute the
# go.{mod, sum} files.
#
# ref: https://github.com/golang/go/issues/30515
statik: $(STATIK)
$(STATIK):
@echo "Installing statik..."
@(cd /tmp && go get github.com/rakyll/statik@v0.1.6)
@(cd /tmp && go install github.com/rakyll/statik@v0.1.6)

# Install the runsim binary with a temporary workaround of entering an outside
# directory as the "go get" command ignores the -mod option and will polute the
# directory as the "go install" command ignores the -mod option and will polute the
# go.{mod, sum} files.
#
# ref: https://github.com/golang/go/issues/30515
runsim: $(RUNSIM)
$(RUNSIM):
@echo "Installing runsim..."
@(cd /tmp && go get github.com/cosmos/tools/cmd/runsim@v1.0.0)
@(cd /tmp && go install github.com/cosmos/tools/cmd/runsim@v1.0.0)

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

0 comments on commit 043c8f9

Please sign in to comment.