From 8b5c49c9d172cb3aee831ce66f6728466d686a69 Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Thu, 8 Apr 2021 17:52:34 +0900 Subject: [PATCH] change circleci to workflow --- .circleci/config.yml | 386 ------------------ .github/workflows/docker.yml | 57 +++ .github/workflows/lint.yml | 30 ++ .github/workflows/proto.yml | 21 + .github/workflows/release-sims.yml | 49 +++ .github/workflows/sims.yml | 157 +++++++ .github/workflows/test.yml | 85 ++++ .goreleaser.yml | 82 ---- Dockerfile | 41 +- Makefile | 119 +----- app/app.go | 3 +- app/migrate.go | 9 +- app/pubkey_replacement.go | 7 +- cmd/terrad/genaccounts.go | 2 +- cmd/terrad/root.go | 13 +- cmd/terrad/testnet.go | 30 +- contrib/images/Makefile | 2 +- contrib/images/terrad-env/Dockerfile | 4 +- contrib/images/terrad-env/wrapper.sh | 14 +- custom/auth/client/utils/feeutils.go | 6 +- custom/auth/simulation/genesis.go | 7 +- custom/auth/tx/service.go | 5 +- custom/bank/client/cli/tx.go | 6 +- custom/bank/module.go | 5 +- custom/bank/simulation/genesis.go | 2 +- custom/bank/wasm/interface_test.go | 1 + custom/crisis/module.go | 13 + custom/mint/module.go | 31 ++ docker-compose.yml | 8 +- sims.mk | 70 ++++ x/market/abci_test.go | 3 +- x/market/exported/alias.go | 3 +- x/market/genesis_test.go | 3 +- x/market/keeper/alias_functions.go | 3 +- x/market/keeper/keeper_test.go | 3 +- x/market/keeper/legacy_querier.go | 5 +- x/market/keeper/params.go | 3 +- x/market/keeper/swap_test.go | 3 +- x/market/keeper/test_utils.go | 2 +- x/market/module.go | 2 +- x/market/simulation/genesis.go | 2 +- x/market/simulation/operations.go | 9 +- x/market/simulation/params.go | 2 +- x/market/types/msgs_test.go | 3 +- x/market/wasm/interface_test.go | 1 + x/msgauth/abci.go | 5 +- x/msgauth/abci_test.go | 3 +- x/msgauth/client/cli/query.go | 3 +- x/msgauth/client/rest/query.go | 3 +- x/msgauth/client/rest/rest.go | 3 +- x/msgauth/keeper/keeper.go | 3 +- x/msgauth/keeper/test_utils.go | 3 +- x/msgauth/module.go | 2 +- x/msgauth/simulation/decoder_test.go | 3 +- x/msgauth/simulation/operations.go | 2 +- x/msgauth/types/authorization.go | 5 +- x/msgauth/types/generic_authorization.go | 3 +- x/msgauth/types/generic_authorization_test.go | 3 +- x/msgauth/types/msgs_test.go | 3 +- x/msgauth/types/send_authorization.go | 3 +- x/oracle/exported/alias.go | 3 +- x/oracle/genesis_test.go | 3 +- x/oracle/handler_test.go | 3 +- x/oracle/keeper/ballot.go | 3 +- x/oracle/keeper/params.go | 3 +- x/oracle/keeper/test_utils.go | 2 +- x/oracle/keeper/vote_target_test.go | 3 +- x/oracle/module.go | 2 +- x/oracle/simulation/genesis.go | 2 +- x/oracle/simulation/operations.go | 2 +- x/oracle/simulation/params.go | 2 +- x/oracle/types/errors.go | 3 +- x/oracle/types/hash.go | 3 +- x/oracle/types/hash_test.go | 3 +- x/oracle/types/msgs_test.go | 3 +- x/oracle/types/test_utils.go | 2 +- x/oracle/types/vote.go | 3 +- x/oracle/wasm/interface_test.go | 3 +- x/treasury/client/proposal_handler.go | 3 +- x/treasury/client/rest/query.go | 3 +- x/treasury/exported/alias.go | 3 +- x/treasury/genesis_test.go | 3 +- x/treasury/keeper/burn_account.go | 3 +- x/treasury/keeper/params.go | 3 +- x/treasury/keeper/test_utils.go | 2 +- x/treasury/module.go | 2 +- x/treasury/proposal_handler_test.go | 3 +- x/treasury/simulation/genesis.go | 2 +- x/treasury/simulation/params.go | 2 +- x/treasury/types/constraint.go | 3 +- x/treasury/types/constraint_test.go | 3 +- x/vesting/types/genesis_test.go | 6 +- x/vesting/types/test_utils.go | 2 +- x/vesting/types/vesting_account_test.go | 17 +- x/wasm/client/rest/tx.go | 3 +- x/wasm/common_test.go | 1 - x/wasm/genesis.go | 3 +- x/wasm/handler_test.go | 3 +- x/wasm/keeper/api.go | 1 + x/wasm/keeper/contract.go | 5 +- x/wasm/keeper/custom_test.go | 1 + x/wasm/keeper/legacy_querier_test.go | 3 +- x/wasm/keeper/msg_server.go | 3 +- x/wasm/keeper/params.go | 3 +- x/wasm/keeper/querier.go | 5 +- x/wasm/keeper/querier_test.go | 3 +- x/wasm/keeper/recursive_test.go | 3 +- x/wasm/keeper/staking_test.go | 7 +- x/wasm/keeper/test_utils.go | 5 +- x/wasm/module.go | 2 +- x/wasm/simulation/genesis.go | 5 +- x/wasm/simulation/operations.go | 5 +- x/wasm/simulation/params.go | 2 +- x/wasm/types/msgs_test.go | 3 +- 114 files changed, 785 insertions(+), 748 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/proto.yml create mode 100644 .github/workflows/release-sims.yml create mode 100644 .github/workflows/sims.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .goreleaser.yml create mode 100644 custom/mint/module.go create mode 100644 sims.mk diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index bd54cae76..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,386 +0,0 @@ -version: 2.1 - -executors: - golang: - docker: - - image: circleci/golang:1.13.1 - working_directory: /go/src/github.com/terra-project/core - mac: - macos: - xcode: "10.3.0" - working_directory: /Users/distiller/project/src/github.com/terra-project/core - environment: - GO_VERSION: "1.13.1" - -commands: - make: - parameters: - description: - type: string - target: - type: string - steps: - - attach_workspace: - at: /tmp/bin - - checkout - - restore_cache: - name: "Restore go modules cache" - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: - name: << parameters.description >> - command: | - export BINDIR=/tmp/bin - make << parameters.target >> - mac-set-env: - steps: - - run: - name: "Set environment" - command: | - echo 'export PATH=$PATH:$HOME/go/bin' >> $BASH_ENV - echo 'export GOPATH=$HOME/project' >> $BASH_ENV - echo 'export PATH=$PATH:$HOME/go/bin:$GOPATH/bin' >> $BASH_ENV - echo 'export GO111MODULE=on' -jobs: - setup-dependencies: - executor: golang - steps: - - checkout - - restore_cache: - name: "Restore go modules cache" - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: - name: Cache go modules - command: make go-mod-cache - - run: - name: Build - command: make build - - run: - name: "Git garbage collection" - command: git gc - - run: - name: "Build tools binaries" - command: | - make tools - - save_cache: - name: "Save go modules cache" - key: go-mod-v1-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - - run: - command: | - mkdir -p /tmp/bin - cp -r /go/bin/* /tmp/bin - - persist_to_workspace: - root: "/tmp/bin" - paths: - - "." - - test-sim-nondeterminism: - executor: golang - steps: - - make: - target: test-sim-nondeterminism - description: "Test Terra non-determinism simulations" - - test-sim-fast: - executor: golang - steps: - - make: - target: test-sim-fast - description: "Test Terra fast simulations" - - test-sim-import-export: - executor: golang - steps: - - make: - target: test-sim-import-export - description: "Test Terra import/export simulation" - - test-sim-after-import: - executor: golang - steps: - - make: - target: test-sim-after-import - description: "Test Terra simulation after importing state" - - test-sim-multi-seed-short: - executor: golang - steps: - - make: - target: test-sim-multi-seed-short - description: "Test Terra multi-seed simulation (short-lived)" - - test-sim-multi-seed-long: - executor: golang - steps: - - make: - target: test-sim-multi-seed-long - description: "Test Terra multi-seed simulation (long-lived)" - - integration-tests: - executor: golang - steps: - - checkout - - restore_cache: - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: - name: Test CLI integration - command: | - export BUILDDIR=`pwd`/build - make test-build - - test-cover: - executor: golang - parallelism: 4 - steps: - - checkout - - restore_cache: - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - run: - name: Run tests with coverage - command: | - export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')" - export GO111MODULE=on - mkdir -p /tmp/logs /tmp/workspace/profiles - for pkg in $(go list ./... | grep -v '/simulation' | circleci tests split); do - id=$(echo "$pkg" | sed 's|[/.]|_|g') - go test -mod=readonly -timeout 8m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | tee "/tmp/logs/$id-$RANDOM.log" - done - - persist_to_workspace: - root: /tmp/workspace - paths: - - "profiles/*" - - store_artifacts: - path: /tmp/logs - - release: - docker: - - image: circleci/golang:1.13.1 - steps: - - checkout - - run: - name: release - command: | - export BUILD_TAGS="netgo ledger" - export GOSUM=$(sha256sum go.sum | cut -d ' ' -f1) - curl -sL https://git.io/goreleaser | bash - - upload-coverage: - executor: golang - steps: - - attach_workspace: - at: /tmp/workspace - - checkout - - run: - name: gather - command: | - set -ex - - echo "--> Concatenating profiles:" - ls /tmp/workspace/profiles/ - echo "mode: atomic" > coverage.txt - for prof in $(ls /tmp/workspace/profiles/); do - tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt - done - - run: - name: filter out DONTCOVER - command: | - excludelist="$(find . -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/cosmos\/gaia/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - - run: - name: upload - command: bash <(curl -s https://codecov.io/bash) -f coverage.txt - - localnet: - working_directory: /home/circleci/.go_workspace/src/github.com/terra-project/core - machine: - image: circleci/classic:latest - environment: - GOPATH: /home/circleci/.go_workspace/ - GOOS: linux - GOARCH: amd64 - GO_VERSION: "1.13.1" - parallelism: 1 - steps: - - checkout - - run: - name: run localnet and exit on failure - command: | - pushd /tmp - wget https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz - sudo tar -xvf go$GO_VERSION.linux-amd64.tar.gz - sudo rm -rf /usr/local/go - sudo mv go /usr/local - popd - set -x - make clean build-docker-terradnode localnet-start - ./contrib/localnet-blocks-test.sh 40 5 10 localhost - - macos-ci: - executor: mac - steps: - - mac-set-env - - run: - name: Install go - command: | - source $BASH_ENV - curl -L -O https://dl.google.com/go/go$GO_VERSION.darwin-amd64.tar.gz - tar -C $HOME -xzf go$GO_VERSION.darwin-amd64.tar.gz - rm go$GO_VERSION.darwin-amd64.tar.gz - go version - - checkout - - run: - name: Install SDK - command: | - source $BASH_ENV - make tools - make install - - run: - name: Integration tests - command: | - source $BASH_ENV - make test-build - - run: - name: Test full terra simulation - command: | - source $BASH_ENV - make test-sim-fast - - docker-image: - executor: golang - steps: - - attach_workspace: - at: /tmp/workspace - - checkout - - setup_remote_docker: - docker_layer_caching: true - - run: | - TERRAD_VERSION='' - if [ "${CIRCLE_BRANCH}" = "master" ]; then - TERRAD_VERSION="stable" - elif [ "${CIRCLE_BRANCH}" = "develop" ]; then - TERRAD_VERSION="develop" - fi - if [ -z "${TERRAD_VERSION}" ]; then - docker build . - else - docker build -t terramoney/core:$TERRAD_VERSION . - docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS - docker push terramoney/core:$TERRAD_VERSION - fi - - docker-tagged: - executor: golang - steps: - - attach_workspace: - at: /tmp/workspace - - checkout - - setup_remote_docker: - docker_layer_caching: true - - run: | - docker build -t terramoney/core:$CIRCLE_TAG . - docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS - docker push terramoney/core:$CIRCLE_TAG - - reproducible-builds: - executor: golang - steps: - - attach_workspace: - at: /tmp/workspace - - checkout - - setup_remote_docker: - docker_layer_caching: true - - run: - name: Build terra - no_output_timeout: 20m - command: | - sudo apt-get install -y ruby - bash -x ./contrib/gitian-build.sh multi - cp gitian-build-multi/result/terra-multi-res.yml . - rm -rf gitian-build-multi/ - - store_artifacts: - path: /go/src/github.com/terra-project/core/terra-multi-res.yml - -workflows: - version: 2 - test-suite: - jobs: - - docker-image: - requires: - - setup-dependencies - - docker-tagged: - filters: - tags: - only: - - /^v.*/ - branches: - ignore: - - /.*/ - requires: - - setup-dependencies - - macos-ci: - filters: - branches: - only: - - master - - develop - - setup-dependencies: - # filters here are needed to enable this job also for tags - filters: - tags: - only: - - /^v.*/ - - integration-tests: - requires: - - setup-dependencies - - test-sim-nondeterminism: - requires: - - setup-dependencies - - test-sim-fast: - requires: - - setup-dependencies - - test-sim-import-export: - requires: - - setup-dependencies - - test-sim-multi-seed-short: - requires: - - setup-dependencies - - test-sim-multi-seed-long: - requires: - - setup-dependencies - # These filters ensure that the long sim only runs during release - filters: - branches: - ignore: /.*/ - tags: - only: - - /^v.*/ - - test-cover: - requires: - - setup-dependencies - - localnet - - upload-coverage: - requires: - - test-cover - - reproducible-builds: - filters: - branches: - only: - - master - requires: - - setup-dependencies - # - release: - # # Only run this job on git tag pushes - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /v[0-9]+(\.[0-9]+)*(-.*)*/ diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..1f388ce43 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,57 @@ +name: Build & Push +# Build & Push builds the simapp docker image on every push to master and +# and pushes the image to https://hub.docker.com/r/interchainio/simapp/tags +on: + pull_request: + push: + branches: + - main + - master + - "release/*" + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=terramoney/core + VERSION=noop + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + elif [[ $GITHUB_REF == refs/heads/* ]]; then + VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') + if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then + VERSION=latest + fi + fi + TAGS="${DOCKER_IMAGE}:${VERSION}" + if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" + fi + echo ::set-output name=version::${VERSION} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Publish to Docker Hub + uses: docker/build-push-action@v2 + with: + push: ${{ github.event_name != 'pull_request' && !contains(github.ref, "release") }} + tags: ${{ steps.prep.outputs.tags }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..3245ae9e5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Lint +# Lint runs golangci-lint over the entire Gaia repository +# This workflow is run on every pull request and push to main +# The `golangci` job will pass without running if no *.{go, mod, sum} files have been modified. +on: + pull_request: + push: + branches: + - main + - master + - "release/*" +jobs: + golangci: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v4 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - uses: golangci/golangci-lint-action@v2 + 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.34.1 + args: --timeout 10m + github-token: ${{ secrets.github_token }} + if: "env.GIT_DIFF != ''" diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 000000000..13f05c131 --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,21 @@ +name: Protobuf +# Protobuf runs buf (https://buf.build/) lint and check-breakage +# This workflow is only run when a .proto file has been changed +on: + pull_request: + paths: + - "**.proto" +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@master + - name: lint + run: make proto-lint + breakage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check-breakage + run: make proto-check-breaking diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml new file mode 100644 index 000000000..68ca31051 --- /dev/null +++ b/.github/workflows/release-sims.yml @@ -0,0 +1,49 @@ +name: Release Sims +# Release Sims workflow runs long-lived (multi-seed & large block size) simulations +# This workflow only runs on a pull request when the branch contains rc** (rc1/vX.X.x) +on: + pull_request: + branches: + - "rc**" + +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" + + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/checkout@v2 + - run: | + make build + + install-runsim: + runs-on: ubuntu-latest + needs: build + steps: + - name: install runsim + run: | + export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + + test-sim-multi-seed-long: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-multi-seed-long + run: | + make test-sim-multi-seed-long diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml new file mode 100644 index 000000000..925c38658 --- /dev/null +++ b/.github/workflows/sims.yml @@ -0,0 +1,157 @@ +name: Sims +# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) +# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed +on: + pull_request: + push: + branches: + - main + - master + - "release/*" + +jobs: + cleanup-runs: + runs-on: ubuntu-latest + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - name: Display go version + run: go version + - run: make build + + install-runsim: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - 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 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + + test-sim-nondeterminism: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - name: Display go version + run: go version + - uses: technote-space/get-diff-action@v4 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + - name: test-sim-nondeterminism + run: | + make test-sim-nondeterminism + if: env.GIT_DIFF + + test-sim-import-export: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - name: Display go version + run: go version + - uses: technote-space/get-diff-action@v4 + with: + SUFFIX_FILTER: | + **/**.go + go.mod + go.sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + - name: test-sim-import-export + run: | + make test-sim-import-export + if: env.GIT_DIFF + + test-sim-after-import: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - name: Display go version + run: go version + - uses: technote-space/get-diff-action@v4 + with: + SUFFIX_FILTER: | + **/**.go + go.mod + go.sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + - name: test-sim-after-import + run: | + make test-sim-after-import + if: env.GIT_DIFF + + test-sim-multi-seed-short: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - name: Display go version + run: go version + - uses: technote-space/get-diff-action@v4 + with: + SUFFIX_FILTER: | + **/**.go + go.mod + go.sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 + - uses: actions/cache@v2.1.3 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + if: env.GIT_DIFF + - name: test-sim-multi-seed-short + run: | + make test-sim-multi-seed-short + if: env.GIT_DIFF diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..6ec87b726 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,85 @@ +name: Build & Test +on: + pull_request: + push: + branches: + - main + - master + - "release/*" +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" + + test-coverage-upload: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v4 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - name: build + run: | + make build + - name: test & coverage report creation + run: | + go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' + if: "env.GIT_DIFF != ''" + - name: filter out DONTCOVER + run: | + excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" + excludelist+=" $(find ./ -type f -name '*.pb.go')" + for filename in ${excludelist}; do + filename=$(echo $filename | sed 's/^./github.com\/terra-project\/core/g') + echo "Excluding ${filename} from coverage report..." + sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt + done + if: "env.GIT_DIFF != ''" + - uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt # optional + fail_ci_if_error: true + if: "env.GIT_DIFF != ''" + + liveness-test: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - uses: technote-space/get-diff-action@v4 + id: git_diff + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - name: start localnet + run: | + make clean localnet-start + if: env.GIT_DIFF + - name: test liveness + run: | + ./contrib/localnet_liveness.sh 100 5 50 localhost + if: env.GIT_DIFF + + docker-build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + - name: build docker image + run: | + docker build --pull --rm -f "Dockerfile" -t terraapp:latest "." \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 94327bd26..000000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,82 +0,0 @@ -project_name: terra - -before: - hooks: - - make tools - - make go-mod-cache - -builds: - - - id: 'terracli' - main: cmd/terracli/main.go - binary: terracli - flags: - - -tags="netgo ledger" - asmflags: - - all=-trimpath={{.Env.GOPATH}} - gcflags: - - all=-trimpath={{.Env.GOPATH}} - ldflags: | - -X github.com/cosmos/cosmos-sdk/version.Name=terra - -X github.com/cosmos/cosmos-sdk/version.ServerName=terrad - -X github.com/cosmos/cosmos-sdk/version.ClientName=terracli - -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} - -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" - env: - - GO111MODULE=on - - CGO_ENABLED=0 - goos: - - darwin - - linux - goarch: - - amd64 - ignore: - - goos: darwin - goarch: 386 - - - - id: 'terrad' - main: ./cmd/terrad - binary: terrad - flags: - - -tags="netgo ledger" - asmflags: - - all=-trimpath={{.Env.GOPATH}} - gcflags: - - all=-trimpath={{.Env.GOPATH}} - ldflags: | - -X github.com/cosmos/cosmos-sdk/version.Name=terra - -X github.com/cosmos/cosmos-sdk/version.ServerName=terrad - -X github.com/cosmos/cosmos-sdk/version.ClientName=terracli - -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} - -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" - env: - - GO111MODULE=on - - CGO_ENABLED=0 - goos: - - darwin - - linux - goarch: - - amd64 - ignore: - - goos: darwin - goarch: 386 - -archives: - - - replacements: - darwin: Darwin - linux: Linux - amd64: x86_64 -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' diff --git a/Dockerfile b/Dockerfile index 384ec4dde..1f5beccde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,30 @@ -FROM cosmwasm/go-ext-builder:0001-alpine AS rust-builder +# docker build . -t cosmwasm/wasmd:latest +# docker run --rm -it cosmwasm/wasmd:latest /bin/sh +FROM golang:1.15-alpine3.12 AS go-builder -WORKDIR /go/src/github.com/terra-project/core +# this comes from standard alpine nightly file +# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile +# with some changes to support our toolchain, etc +RUN set -eux; apk add --no-cache ca-certificates build-base; -COPY go.* /go/src/github.com/terra-project/core/ +RUN apk add git +# NOTE: add these to run with LEDGER_ENABLED=true +# RUN apk add libusb-dev linux-headers -RUN apk add --no-cache git \ - && go mod download github.com/CosmWasm/go-cosmwasm \ - && export GO_WASM_DIR=$(go list -f "{{ .Dir }}" -m github.com/CosmWasm/go-cosmwasm) \ - && cd ${GO_WASM_DIR} \ - && cargo build --release --features backtraces --example muslc \ - && mv ${GO_WASM_DIR}/target/release/examples/libmuslc.a /lib/libgo_cosmwasm_muslc.a +WORKDIR /code +COPY . /code/ - -FROM cosmwasm/go-ext-builder:0001-alpine AS go-builder - -WORKDIR /go/src/github.com/terra-project/core - -RUN apk add --no-cache git libusb-dev linux-headers - -COPY . . -COPY --from=rust-builder /lib/libgo_cosmwasm_muslc.a /lib/libgo_cosmwasm_muslc.a +# See https://github.com/terra-project/go-cosmwasm/releases +ADD https://github.com/terra-project/go-cosmwasm/releases/download/v0.10.4/libgo_cosmwasm_muslc.a /lib/libgo_cosmwasm_muslc.a +RUN sha256sum /lib/libgo_cosmwasm_muslc.a | grep 2aa7b034b9340fecaa928adf3e8c093893fd6a3986a569ce7cae7528845a0951 # force it to use static lib (from above) not standard libgo_cosmwasm.so file -RUN BUILD_TAGS=muslc make update-swagger-docs build - +RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make update-swagger-docs build FROM alpine:3.12 WORKDIR /root -COPY --from=go-builder /go/src/github.com/terra-project/core/build/terrad /usr/local/bin/terrad -COPY --from=go-builder /go/src/github.com/terra-project/core/build/terracli /usr/local/bin/terracli +COPY --from=go-builder /code/build/terrad /usr/local/bin/terrad -CMD [ "terrad", "--help" ] +CMD ["/usr/local/bin/terrad", "version"] \ No newline at end of file diff --git a/Makefile b/Makefile index 4bf30be8d..029488ea9 100755 --- a/Makefile +++ b/Makefile @@ -109,7 +109,6 @@ build-linux: docker build --tag terramoney/core ./ docker create --name temp terramoney/core:latest docker cp temp:/usr/local/bin/terrad $(BUILDDIR)/ - docker cp temp:/usr/local/bin/terracli $(BUILDDIR)/ docker rm temp install: go.sum @@ -155,111 +154,25 @@ clean: ### Tests & Simulation ### ############################################################################### +include sims.mk + test: test-unit -test-all: test-unit test-ledger-mock test-race test-cover - -TEST_PACKAGES=./... -TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test-race test-ledger test-race - -# Test runs-specific rules. To add a new test target, just add -# a new rule, customise ARGS or TEST_PACKAGES ad libitum, and -# append the new rule to the TEST_TARGETS list. -test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace' -test-unit-amino: ARGS=-tags='ledger test_ledger_mock test_amino norace' -test-ledger: ARGS=-tags='cgo ledger norace' -test-ledger-mock: ARGS=-tags='ledger test_ledger_mock norace' -test-race: ARGS=-race -tags='cgo ledger test_ledger_mock' -test-race: TEST_PACKAGES=$(PACKAGES_NOSIMULATION) -$(TEST_TARGETS): run-tests - -# check-* compiles and collects tests without running them -# note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513) -CHECK_TEST_TARGETS := check-test-unit check-test-unit-amino -check-test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace' -check-test-unit-amino: ARGS=-tags='ledger test_ledger_mock test_amino norace' -$(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none -$(CHECK_TEST_TARGETS): run-tests - -run-tests: -ifneq (,$(shell which tparse 2>/dev/null)) - go test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse -else - go test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) -endif -.PHONY: run-tests test test-all $(TEST_TARGETS) - -test-sim-nondeterminism: - @echo "Running non-determinism test..." - @go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \ - -NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h - -test-sim-custom-genesis-fast: - @echo "Running custom genesis simulation..." - @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." - @go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=${HOME}/.gaiad/config/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 - -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 - -test-sim-custom-genesis-multi-seed: runsim - @echo "Running multi-seed custom genesis simulation..." - @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." - @$(BINDIR)/runsim -Genesis=${HOME}/.gaiad/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation - -test-sim-multi-seed-long: runsim - @echo "Running long multi-seed application simulation. This may take awhile!" - @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation - -test-sim-multi-seed-short: runsim - @echo "Running short multi-seed application simulation. This may take awhile!" - @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation - -test-sim-benchmark-invariants: - @echo "Running simulation invariant benchmarks..." - @go test -mod=readonly $(SIMAPP) -benchmem -bench=BenchmarkInvariants -run=^$ \ - -Enabled=true -NumBlocks=1000 -BlockSize=200 \ - -Period=1 -Commit=true -Seed=57 -v -timeout 24h - -.PHONY: \ -test-sim-nondeterminism \ -test-sim-custom-genesis-fast \ -test-sim-import-export \ -test-sim-after-import \ -test-sim-custom-genesis-multi-seed \ -test-sim-multi-seed-short \ -test-sim-multi-seed-long \ -test-sim-benchmark-invariants - -SIM_NUM_BLOCKS ?= 500 -SIM_BLOCK_SIZE ?= 200 -SIM_COMMIT ?= true - -test-sim-benchmark: - @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" - @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ - -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h - -test-sim-profile: - @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" - @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ - -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out - -.PHONY: test-sim-profile test-sim-benchmark +test-all: test-unit test-race test-cover + +test-unit: + @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./... + +test-race: + @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./... test-cover: - @export VERSION=$(VERSION); bash -x contrib/test_cover.sh -.PHONY: test-cover + @go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./... benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) -.PHONY: benchmark + @go test -mod=readonly -bench=. ./... + +.PHONY: test test-all test-cover test-unit test-race ############################################################################### ### Linting ### @@ -301,7 +214,7 @@ proto-lint: @$(DOCKER_BUF) lint --error-format=json proto-check-breaking: - @$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master + @$(DOCKER_BUF) breaking --against-input $(HTTPS_GIT)#branch=master .PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking @@ -311,14 +224,14 @@ proto-check-breaking: # Run a 4-node testnet locally localnet-start: build-linux localnet-stop - $(if $(shell $(DOCKER) inspect -f '{{ .Id }}' terraproject/terrad-env 2>/dev/null),$(info found image terraproject/terrad-env),$(MAKE) -C contrib/images terrad-env) + $(if $(shell $(DOCKER) inspect -f '{{ .Id }}' terramoney/terrad-env 2>/dev/null),$(info found image terramoney/terrad-env),$(MAKE) -C contrib/images terrad-env) if ! [ -f build/node0/terrad/config/genesis.json ]; then $(DOCKER) run --rm \ --user $(shell id -u):$(shell id -g) \ -v $(BUILDDIR):/terrad:Z \ -v /etc/group:/etc/group:ro \ -v /etc/passwd:/etc/passwd:ro \ -v /etc/shadow:/etc/shadow:ro \ - terraproject/terrad-env testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi + terramoney/terrad-env testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi docker-compose up -d localnet-stop: diff --git a/app/app.go b/app/app.go index e1577146a..da4e0e60d 100644 --- a/app/app.go +++ b/app/app.go @@ -96,6 +96,7 @@ import ( customdistr "github.com/terra-project/core/custom/distribution" customevidence "github.com/terra-project/core/custom/evidence" customgov "github.com/terra-project/core/custom/gov" + custommint "github.com/terra-project/core/custom/mint" customparams "github.com/terra-project/core/custom/params" customslashing "github.com/terra-project/core/custom/slashing" customstaking "github.com/terra-project/core/custom/staking" @@ -145,7 +146,7 @@ var ( custombank.AppModuleBasic{}, capability.AppModuleBasic{}, customstaking.AppModuleBasic{}, - mint.AppModuleBasic{}, + custommint.AppModuleBasic{}, customdistr.AppModuleBasic{}, customgov.NewAppModuleBasic( paramsclient.ProposalHandler, diff --git a/app/migrate.go b/app/migrate.go index f8dc132e1..ae1306682 100644 --- a/app/migrate.go +++ b/app/migrate.go @@ -10,6 +10,11 @@ import ( "io/ioutil" "time" + "github.com/pkg/errors" + "github.com/spf13/cobra" + tmjson "github.com/tendermint/tendermint/libs/json" + tmtypes "github.com/tendermint/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,10 +28,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" ibccoretypes "github.com/cosmos/cosmos-sdk/x/ibc/core/types" staking "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/pkg/errors" - "github.com/spf13/cobra" - tmjson "github.com/tendermint/tendermint/libs/json" - tmtypes "github.com/tendermint/tendermint/types" ) const ( diff --git a/app/pubkey_replacement.go b/app/pubkey_replacement.go index 630e0f6a1..0d573a5ae 100644 --- a/app/pubkey_replacement.go +++ b/app/pubkey_replacement.go @@ -6,15 +6,16 @@ import ( "io/ioutil" "log" + "github.com/pkg/errors" + cryptocodec "github.com/tendermint/tendermint/crypto/encoding" + tmtypes "github.com/tendermint/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil/types" slashing "github.com/cosmos/cosmos-sdk/x/slashing/types" staking "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/pkg/errors" - cryptocodec "github.com/tendermint/tendermint/crypto/encoding" - tmtypes "github.com/tendermint/tendermint/types" ) type replacementConfigs []replacementConfig diff --git a/cmd/terrad/genaccounts.go b/cmd/terrad/genaccounts.go index 645e6ecfc..3f8bb41f0 100644 --- a/cmd/terrad/genaccounts.go +++ b/cmd/terrad/genaccounts.go @@ -240,7 +240,7 @@ $ terrad add-genesis-account acc1 '10000000000uluna,1000000ukrw' cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") - cmd.Flags().String(flagVestingSchedules, "", "comma seperated vesting schedules [denom|start|end|ratio][,[denom|start|end|ratio]], where 'start' and 'end' is day unit") + cmd.Flags().String(flagVestingSchedules, "", "comma separated vesting schedules [denom|start|end|ratio][,[denom|start|end|ratio]], where 'start' and 'end' is day unit") flags.AddQueryFlagsToCmd(cmd) return cmd } diff --git a/cmd/terrad/root.go b/cmd/terrad/root.go index 0d3144b46..73bdf862a 100644 --- a/cmd/terrad/root.go +++ b/cmd/terrad/root.go @@ -8,6 +8,12 @@ import ( "github.com/spf13/viper" + "github.com/spf13/cast" + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/debug" @@ -26,11 +32,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/spf13/cast" - "github.com/spf13/cobra" - tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" terraapp "github.com/terra-project/core/app" "github.com/terra-project/core/app/params" @@ -44,6 +45,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { encodingConfig := terraapp.MakeEncodingConfig() config := sdk.GetConfig() + config.SetCoinType(core.CoinType) + config.SetFullFundraiserPath(core.FullFundraiserPath) config.SetBech32PrefixForAccount(core.Bech32PrefixAccAddr, core.Bech32PrefixAccPub) config.SetBech32PrefixForValidator(core.Bech32PrefixValAddr, core.Bech32PrefixValPub) config.SetBech32PrefixForConsensusNode(core.Bech32PrefixConsAddr, core.Bech32PrefixConsPub) diff --git a/cmd/terrad/testnet.go b/cmd/terrad/testnet.go index ec7ccfc67..8a2b4fb7e 100644 --- a/cmd/terrad/testnet.go +++ b/cmd/terrad/testnet.go @@ -1,6 +1,6 @@ package main -// DONTCOVER +//DONTCOVER import ( "bufio" @@ -32,6 +32,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + core "github.com/terra-project/core/types" ) var ( @@ -46,7 +48,7 @@ var ( func testnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ Use: "testnet", - Short: "Initialize files for a simapp testnet", + Short: "Initialize files for a terrad testnet", Long: `testnet will create "v" number of directories and populate each with necessary files (private validator, genesis, config, etc.). @@ -86,7 +88,7 @@ Example: cmd.Flags().String(flagNodeDaemonHome, "terrad", "Home directory of the node's daemon configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") + cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", core.MicroLunaDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") @@ -95,7 +97,7 @@ Example: const nodeDirPerm = 0755 -// Initialize the testnet +// InitTestnet initialize the testnet func InitTestnet( clientCtx client.Context, cmd *cobra.Command, @@ -120,13 +122,13 @@ func InitTestnet( nodeIDs := make([]string, numValidators) valPubKeys := make([]cryptotypes.PubKey, numValidators) - simappConfig := srvconfig.DefaultConfig() - simappConfig.MinGasPrices = minGasPrices - simappConfig.API.Enable = true - simappConfig.Telemetry.Enabled = true - simappConfig.Telemetry.PrometheusRetentionTime = 60 - simappConfig.Telemetry.EnableHostnameLabel = false - simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", chainID}} + terraappConfig := srvconfig.DefaultConfig() + terraappConfig.MinGasPrices = minGasPrices + terraappConfig.API.Enable = true + terraappConfig.Telemetry.Enabled = true + terraappConfig.Telemetry.PrometheusRetentionTime = 60 + terraappConfig.Telemetry.EnableHostnameLabel = false + terraappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", chainID}} var ( genAccounts []authtypes.GenesisAccount @@ -199,7 +201,7 @@ func InitTestnet( accStakingTokens := sdk.TokensFromConsensusPower(500) coins := sdk.Coins{ sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), accTokens), - sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens), + sdk.NewCoin(core.MicroLunaDenom, accStakingTokens), } genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}) @@ -209,7 +211,7 @@ func InitTestnet( createValMsg, err := stakingtypes.NewMsgCreateValidator( sdk.ValAddress(addr), valPubKeys[i], - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), + sdk.NewCoin(core.MicroLunaDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), sdk.OneInt(), @@ -245,7 +247,7 @@ func InitTestnet( return err } - srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), simappConfig) + srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), terraappConfig) } if err := initGenFiles(clientCtx, mbm, chainID, genAccounts, genBalances, genFiles, numValidators); err != nil { diff --git a/contrib/images/Makefile b/contrib/images/Makefile index 9534d3b8f..98db172c4 100644 --- a/contrib/images/Makefile +++ b/contrib/images/Makefile @@ -1,6 +1,6 @@ all: terrad-env terrad-env: - docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag terraproject/terrad-env terrad-env + docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag terramoney/terrad-env terrad-env .PHONY: all terrad-env diff --git a/contrib/images/terrad-env/Dockerfile b/contrib/images/terrad-env/Dockerfile index 1ccaeac65..2477aea94 100644 --- a/contrib/images/terrad-env/Dockerfile +++ b/contrib/images/terrad-env/Dockerfile @@ -8,8 +8,8 @@ ARG UID=1000 ARG GID=1000 USER ${UID}:${GID} -VOLUME [ /simd ] -WORKDIR /simd +VOLUME [ /terrad ] +WORKDIR /terrad EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/wrapper.sh"] CMD ["start", "--log_format", "plain"] diff --git a/contrib/images/terrad-env/wrapper.sh b/contrib/images/terrad-env/wrapper.sh index a22500985..ec2a32ee8 100755 --- a/contrib/images/terrad-env/wrapper.sh +++ b/contrib/images/terrad-env/wrapper.sh @@ -1,11 +1,11 @@ #!/usr/bin/env sh -BINARY=/simd/${BINARY:-simd} +BINARY=/terrad/${BINARY:-terrad} ID=${ID:-0} -LOG=${LOG:-simd.log} +LOG=${LOG:-terrad.log} if ! [ -f "${BINARY}" ]; then - echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'simd'" + echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'terrad'" exit 1 fi @@ -16,10 +16,10 @@ if [ -z "${BINARY_CHECK}" ]; then exit 1 fi -export SIMDHOME="/simd/node${ID}/simd" +export TERRADHOME="/terrad/node${ID}/terrad" -if [ -d "$(dirname "${SIMDHOME}"/"${LOG}")" ]; then - "${BINARY}" --home "${SIMDHOME}" "$@" | tee "${SIMDHOME}/${LOG}" +if [ -d "$(dirname "${TERRADHOME}"/"${LOG}")" ]; then + "${BINARY}" --home "${TERRADHOME}" "$@" | tee "${TERRADHOME}/${LOG}" else - "${BINARY}" --home "${SIMDHOME}" "$@" + "${BINARY}" --home "${TERRADHOME}" "$@" fi diff --git a/custom/auth/client/utils/feeutils.go b/custom/auth/client/utils/feeutils.go index c44b4605a..0d123ed3e 100644 --- a/custom/auth/client/utils/feeutils.go +++ b/custom/auth/client/utils/feeutils.go @@ -4,17 +4,19 @@ import ( "context" "strconv" + "github.com/spf13/pflag" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" - "github.com/spf13/pflag" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" core "github.com/terra-project/core/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + marketexported "github.com/terra-project/core/x/market/exported" msgauthexported "github.com/terra-project/core/x/msgauth/exported" treasuryexported "github.com/terra-project/core/x/treasury/exported" diff --git a/custom/auth/simulation/genesis.go b/custom/auth/simulation/genesis.go index 84f91abc8..49fab3034 100644 --- a/custom/auth/simulation/genesis.go +++ b/custom/auth/simulation/genesis.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/auth/types" + core "github.com/terra-project/core/types" customvestingtypes "github.com/terra-project/core/x/vesting/types" ) @@ -37,7 +38,7 @@ func RandomGenesisAccounts(simState *module.SimulationState) types.GenesisAccoun continue } - initialVesting := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, simState.Rand.Int63n(simState.InitialStake))) + initialVesting := sdk.NewCoins(sdk.NewInt64Coin(core.MicroLunaDenom, simState.Rand.Int63n(simState.InitialStake))) var gacc types.GenesisAccount = bacc @@ -68,7 +69,7 @@ func RandomGenesisAccounts(simState *module.SimulationState) types.GenesisAccoun } gacc = customvestingtypes.NewLazyGradedVestingAccount(bacc, initialVesting, customvestingtypes.VestingSchedules{ - customvestingtypes.NewVestingSchedule(sdk.DefaultBondDenom, lazySchedules), + customvestingtypes.NewVestingSchedule(core.MicroLunaDenom, lazySchedules), }) } genesisAccs = append(genesisAccs, gacc) diff --git a/custom/auth/tx/service.go b/custom/auth/tx/service.go index 8a62e19dd..efe1960ab 100644 --- a/custom/auth/tx/service.go +++ b/custom/auth/tx/service.go @@ -8,9 +8,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + feeutils "github.com/terra-project/core/custom/auth/client/utils" + "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - feeutils "github.com/terra-project/core/custom/auth/client/utils" ) var _ ServiceServer = txServer{} @@ -60,5 +61,5 @@ func RegisterTxService( // RegisterGRPCGatewayRoutes mounts the tx service's GRPC-gateway routes on the // given Mux. func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux) { - RegisterServiceHandlerClient(context.Background(), mux, NewServiceClient(clientConn)) + _ = RegisterServiceHandlerClient(context.Background(), mux, NewServiceClient(clientConn)) } diff --git a/custom/bank/client/cli/tx.go b/custom/bank/client/cli/tx.go index 986cc06f5..69be9878a 100644 --- a/custom/bank/client/cli/tx.go +++ b/custom/bank/client/cli/tx.go @@ -35,7 +35,11 @@ func sendTxCmd() *cobra.Command { ignored as it is implied from [from_key_or_address].`, Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { - cmd.Flags().Set(flags.FlagFrom, args[0]) + err := cmd.Flags().Set(flags.FlagFrom, args[0]) + if err != nil { + return err + } + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err diff --git a/custom/bank/module.go b/custom/bank/module.go index 47e5e579a..1dcf461c5 100644 --- a/custom/bank/module.go +++ b/custom/bank/module.go @@ -1,6 +1,9 @@ package bank import ( + "github.com/gorilla/mux" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" @@ -8,8 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/gorilla/mux" - "github.com/spf13/cobra" customcli "github.com/terra-project/core/custom/bank/client/cli" customrest "github.com/terra-project/core/custom/bank/client/rest" diff --git a/custom/bank/simulation/genesis.go b/custom/bank/simulation/genesis.go index 18de52b15..02fea55f4 100644 --- a/custom/bank/simulation/genesis.go +++ b/custom/bank/simulation/genesis.go @@ -14,7 +14,7 @@ import ( ) // RandomGenesisBalances returns a slice of account balances. Each account has -// a balance of simState.InitialStake for sdk.DefaultBondDenom. +// a balance of simState.InitialStake for sdk.DefaultBondDenom and core.MicroLunaDenom. func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { genesisBalances := []types.Balance{} diff --git a/custom/bank/wasm/interface_test.go b/custom/bank/wasm/interface_test.go index c79aed573..33891c747 100644 --- a/custom/bank/wasm/interface_test.go +++ b/custom/bank/wasm/interface_test.go @@ -8,6 +8,7 @@ import ( "github.com/tendermint/tendermint/crypto/secp256k1" wasmTypes "github.com/CosmWasm/go-cosmwasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) diff --git a/custom/crisis/module.go b/custom/crisis/module.go index 70b2b15f7..834033daf 100644 --- a/custom/crisis/module.go +++ b/custom/crisis/module.go @@ -1,12 +1,15 @@ package crisis import ( + "encoding/json" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/crisis" "github.com/cosmos/cosmos-sdk/x/crisis/types" customtypes "github.com/terra-project/core/custom/crisis/types" + core "github.com/terra-project/core/types" ) var ( @@ -23,3 +26,13 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { customtypes.RegisterLegacyAminoCodec(cdc) *types.ModuleCdc = *customtypes.ModuleCdc // nolint } + +// DefaultGenesis returns default genesis state as raw bytes for the gov +// module. +func (am AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { + // customize to set default genesis state deposit denom to uluna + defaultGenesisState := types.DefaultGenesisState() + defaultGenesisState.ConstantFee.Denom = core.MicroLunaDenom + + return cdc.MustMarshalJSON(defaultGenesisState) +} diff --git a/custom/mint/module.go b/custom/mint/module.go new file mode 100644 index 000000000..36f15b243 --- /dev/null +++ b/custom/mint/module.go @@ -0,0 +1,31 @@ +package mint + +import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/mint" + "github.com/cosmos/cosmos-sdk/x/mint/types" + + core "github.com/terra-project/core/types" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} +) + +// AppModuleBasic defines the basic application module used by the staking module. +type AppModuleBasic struct { + mint.AppModuleBasic +} + +// DefaultGenesis returns default genesis state as raw bytes for the gov +// module. +func (am AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { + // customize to set default genesis state deposit denom to uluna + defaultGenesisState := types.DefaultGenesisState() + defaultGenesisState.Params.MintDenom = core.MicroLunaDenom + + return cdc.MustMarshalJSON(defaultGenesisState) +} diff --git a/docker-compose.yml b/docker-compose.yml index 8dbad75e2..9b59ef291 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: terradnode0: container_name: terradnode0 - image: "terramoney/core" + image: "terramoney/terrad-env" ports: - "26656-26657:26656-26657" environment: @@ -17,7 +17,7 @@ services: terradnode1: container_name: terradnode1 - image: "terramoney/core" + image: "terramoney/terrad-env" ports: - "26659-26660:26656-26657" environment: @@ -31,7 +31,7 @@ services: terradnode2: container_name: terradnode2 - image: "terramoney/core" + image: "terramoney/terrad-env" environment: - ID=2 - LOG=$${LOG:-terrad.log} @@ -45,7 +45,7 @@ services: terradnode3: container_name: terradnode3 - image: "terramoney/core" + image: "terramoney/terrad-env" environment: - ID=3 - LOG=$${LOG:-terrad.log} diff --git a/sims.mk b/sims.mk new file mode 100644 index 000000000..b38afdef9 --- /dev/null +++ b/sims.mk @@ -0,0 +1,70 @@ +#!/usr/bin/make -f + +######################################## +### Simulations + +BINDIR ?= $(GOPATH)/bin +SIMAPP = ./app +test-sim-nondeterminism: + @echo "Running non-determinism test..." + @go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \ + -NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h + +test-sim-custom-genesis-fast: + @echo "Running custom genesis simulation..." + @echo "By default, ${HOME}/.terra/config/genesis.json will be used." + @go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation -Genesis=${HOME}/.terra/config/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 + +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 + +test-sim-custom-genesis-multi-seed: runsim + @echo "Running multi-seed custom genesis simulation..." + @echo "By default, ${HOME}/.terra/config/genesis.json will be used." + @$(BINDIR)/runsim -Genesis=${HOME}/.terra/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation + +test-sim-multi-seed-long: runsim + @echo "Running long multi-seed application simulation. This may take awhile!" + @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation + +test-sim-multi-seed-short: runsim + @echo "Running short multi-seed application simulation. This may take awhile!" + @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation + +test-sim-benchmark-invariants: + @echo "Running simulation invariant benchmarks..." + @go test -mod=readonly $(SIMAPP) -benchmem -bench=BenchmarkInvariants -run=^$ \ + -Enabled=true -NumBlocks=1000 -BlockSize=200 \ + -Period=1 -Commit=true -Seed=57 -v -timeout 24h + +.PHONY: \ +test-sim-nondeterminism \ +test-sim-custom-genesis-fast \ +test-sim-import-export \ +test-sim-after-import \ +test-sim-custom-genesis-multi-seed \ +test-sim-multi-seed-short \ +test-sim-multi-seed-long \ +test-sim-benchmark-invariants + +SIM_NUM_BLOCKS ?= 500 +SIM_BLOCK_SIZE ?= 200 +SIM_COMMIT ?= true + +test-sim-benchmark: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h + +test-sim-profile: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out + +.PHONY: test-sim-profile test-sim-benchmark \ No newline at end of file diff --git a/x/market/abci_test.go b/x/market/abci_test.go index 71f978056..8548ac67b 100644 --- a/x/market/abci_test.go +++ b/x/market/abci_test.go @@ -3,9 +3,10 @@ package market import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/terra-project/core/x/market/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestReplenishPools(t *testing.T) { diff --git a/x/market/exported/alias.go b/x/market/exported/alias.go index 68b1f7998..ab8ef44b4 100644 --- a/x/market/exported/alias.go +++ b/x/market/exported/alias.go @@ -1,4 +1,5 @@ -// nolint:deadcode unused DONTCOVER +//nolint:deadcode,unused +//DONTCOVER package exported import "github.com/terra-project/core/x/market/types" diff --git a/x/market/genesis_test.go b/x/market/genesis_test.go index 19d500041..a377b1287 100644 --- a/x/market/genesis_test.go +++ b/x/market/genesis_test.go @@ -3,9 +3,10 @@ package market import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/terra-project/core/x/market/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestExportInitGenesis(t *testing.T) { diff --git a/x/market/keeper/alias_functions.go b/x/market/keeper/alias_functions.go index fba0c2066..4cf799cf9 100644 --- a/x/market/keeper/alias_functions.go +++ b/x/market/keeper/alias_functions.go @@ -1,9 +1,10 @@ package keeper import ( + "github.com/terra-project/core/x/market/types" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/terra-project/core/x/market/types" ) // GetMarketAccount returns market ModuleAccount diff --git a/x/market/keeper/keeper_test.go b/x/market/keeper/keeper_test.go index 38d8982d4..c6ff5d83e 100644 --- a/x/market/keeper/keeper_test.go +++ b/x/market/keeper/keeper_test.go @@ -5,8 +5,9 @@ import ( "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" core "github.com/terra-project/core/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestTerraPoolDeltaUpdate(t *testing.T) { diff --git a/x/market/keeper/legacy_querier.go b/x/market/keeper/legacy_querier.go index a52aaf114..2fd69b892 100644 --- a/x/market/keeper/legacy_querier.go +++ b/x/market/keeper/legacy_querier.go @@ -1,11 +1,12 @@ package keeper import ( + abci "github.com/tendermint/tendermint/abci/types" + "github.com/terra-project/core/x/market/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/terra-project/core/x/market/types" ) // NewLegacyQuerier is the module level router for state queries diff --git a/x/market/keeper/params.go b/x/market/keeper/params.go index afbb36f7c..7bea76906 100644 --- a/x/market/keeper/params.go +++ b/x/market/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/market/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BasePool is Terra liquidity pool(usdr unit) which will be made available per PoolRecoveryPeriod diff --git a/x/market/keeper/swap_test.go b/x/market/keeper/swap_test.go index 66edd28d3..6906725c4 100644 --- a/x/market/keeper/swap_test.go +++ b/x/market/keeper/swap_test.go @@ -6,8 +6,9 @@ import ( "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" core "github.com/terra-project/core/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestApplySwapToPool(t *testing.T) { diff --git a/x/market/keeper/test_utils.go b/x/market/keeper/test_utils.go index f23456267..d814a53a9 100644 --- a/x/market/keeper/test_utils.go +++ b/x/market/keeper/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package keeper import ( diff --git a/x/market/module.go b/x/market/module.go index a7ee1accf..e9b817c5e 100644 --- a/x/market/module.go +++ b/x/market/module.go @@ -76,7 +76,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the oracle module. diff --git a/x/market/simulation/genesis.go b/x/market/simulation/genesis.go index 3b63543c8..8a36aab17 100644 --- a/x/market/simulation/genesis.go +++ b/x/market/simulation/genesis.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" diff --git a/x/market/simulation/operations.go b/x/market/simulation/operations.go index eb0037ed3..894f66c61 100644 --- a/x/market/simulation/operations.go +++ b/x/market/simulation/operations.go @@ -1,11 +1,13 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "math/rand" "strings" + core "github.com/terra-project/core/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp/helpers" @@ -13,7 +15,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - core "github.com/terra-project/core/types" "github.com/terra-project/core/x/market/types" ) @@ -75,7 +76,7 @@ func SimulateMsgSwap( var askDenom string whitelistLen := len(whitelist) if whitelistLen == 0 { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSwap, "no avaliable exchange rates"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSwap, "no available exchange rates"), nil, nil } if randVal := simtypes.RandIntBetween(r, 0, whitelistLen*2); randVal < whitelistLen { @@ -148,7 +149,7 @@ func SimulateMsgSwapSend( var askDenom string whitelistLen := len(whitelist) if whitelistLen == 0 { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSwapSend, "no avaliable exchange rates"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSwapSend, "no available exchange rates"), nil, nil } if randVal := simtypes.RandIntBetween(r, 0, whitelistLen*2); randVal < whitelistLen { diff --git a/x/market/simulation/params.go b/x/market/simulation/params.go index 4513e546e..63afd4e0d 100644 --- a/x/market/simulation/params.go +++ b/x/market/simulation/params.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "fmt" diff --git a/x/market/types/msgs_test.go b/x/market/types/msgs_test.go index f885fc2c2..7df650027 100644 --- a/x/market/types/msgs_test.go +++ b/x/market/types/msgs_test.go @@ -5,8 +5,9 @@ import ( core "github.com/terra-project/core/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMsgSwap(t *testing.T) { diff --git a/x/market/wasm/interface_test.go b/x/market/wasm/interface_test.go index 4272c900e..95a28fed6 100644 --- a/x/market/wasm/interface_test.go +++ b/x/market/wasm/interface_test.go @@ -11,6 +11,7 @@ import ( "github.com/tendermint/tendermint/crypto/secp256k1" wasmTypes "github.com/CosmWasm/go-cosmwasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" core "github.com/terra-project/core/types" diff --git a/x/msgauth/abci.go b/x/msgauth/abci.go index 91d962222..fcf7e9291 100644 --- a/x/msgauth/abci.go +++ b/x/msgauth/abci.go @@ -4,10 +4,11 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/msgauth/keeper" "github.com/terra-project/core/x/msgauth/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" ) // EndBlocker is called at the end of every block diff --git a/x/msgauth/abci_test.go b/x/msgauth/abci_test.go index 027a07420..bc6f81fd8 100644 --- a/x/msgauth/abci_test.go +++ b/x/msgauth/abci_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/terra-project/core/x/msgauth/keeper" "github.com/terra-project/core/x/msgauth/types" ) diff --git a/x/msgauth/client/cli/query.go b/x/msgauth/client/cli/query.go index a4ae9098c..c329e7994 100644 --- a/x/msgauth/client/cli/query.go +++ b/x/msgauth/client/cli/query.go @@ -4,10 +4,11 @@ import ( "context" "strings" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" "github.com/terra-project/core/x/msgauth/types" ) diff --git a/x/msgauth/client/rest/query.go b/x/msgauth/client/rest/query.go index 78cf059ed..f87272e00 100644 --- a/x/msgauth/client/rest/query.go +++ b/x/msgauth/client/rest/query.go @@ -6,9 +6,10 @@ import ( "github.com/terra-project/core/x/msgauth/types" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/gorilla/mux" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/msgauth/client/rest/rest.go b/x/msgauth/client/rest/rest.go index 1a3d11532..54d9cab34 100644 --- a/x/msgauth/client/rest/rest.go +++ b/x/msgauth/client/rest/rest.go @@ -3,10 +3,11 @@ package rest import ( "time" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/gorilla/mux" ) //nolint diff --git a/x/msgauth/keeper/keeper.go b/x/msgauth/keeper/keeper.go index f7a4707ff..cfc550bc1 100644 --- a/x/msgauth/keeper/keeper.go +++ b/x/msgauth/keeper/keeper.go @@ -5,11 +5,12 @@ import ( "fmt" "time" + "github.com/gogo/protobuf/proto" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/gogo/protobuf/proto" "github.com/terra-project/core/x/msgauth/types" ) diff --git a/x/msgauth/keeper/test_utils.go b/x/msgauth/keeper/test_utils.go index 37ae7d580..670f122db 100644 --- a/x/msgauth/keeper/test_utils.go +++ b/x/msgauth/keeper/test_utils.go @@ -1,4 +1,5 @@ -// nolint:deadcode unused DONTCOVER +//nolint:deadcode,unused +//DONTCOVER package keeper import ( diff --git a/x/msgauth/module.go b/x/msgauth/module.go index 084fa4c3b..b6bba2abf 100644 --- a/x/msgauth/module.go +++ b/x/msgauth/module.go @@ -74,7 +74,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the oracle module. diff --git a/x/msgauth/simulation/decoder_test.go b/x/msgauth/simulation/decoder_test.go index bde40ca15..c7592dc0e 100644 --- a/x/msgauth/simulation/decoder_test.go +++ b/x/msgauth/simulation/decoder_test.go @@ -9,9 +9,10 @@ import ( "github.com/cosmos/cosmos-sdk/types/kv" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/msgauth/keeper" "github.com/terra-project/core/x/msgauth/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestDecodeMsgAuthStore(t *testing.T) { diff --git a/x/msgauth/simulation/operations.go b/x/msgauth/simulation/operations.go index 94c1edfe4..e3f527bb8 100644 --- a/x/msgauth/simulation/operations.go +++ b/x/msgauth/simulation/operations.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "math/rand" diff --git a/x/msgauth/types/authorization.go b/x/msgauth/types/authorization.go index 035232a48..6ba38166f 100644 --- a/x/msgauth/types/authorization.go +++ b/x/msgauth/types/authorization.go @@ -4,10 +4,11 @@ import ( fmt "fmt" "time" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" proto "github.com/gogo/protobuf/proto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ codectypes.UnpackInterfacesMessage = AuthorizationGrant{} diff --git a/x/msgauth/types/generic_authorization.go b/x/msgauth/types/generic_authorization.go index d31de7953..ced10f20a 100644 --- a/x/msgauth/types/generic_authorization.go +++ b/x/msgauth/types/generic_authorization.go @@ -1,8 +1,9 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // NewGenericAuthorization returns new GenericAuthorization instance diff --git a/x/msgauth/types/generic_authorization_test.go b/x/msgauth/types/generic_authorization_test.go index 2b0b409e6..b450ced3a 100644 --- a/x/msgauth/types/generic_authorization_test.go +++ b/x/msgauth/types/generic_authorization_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/testutil/testdata" ) func TestGenericAuthorization(t *testing.T) { diff --git a/x/msgauth/types/msgs_test.go b/x/msgauth/types/msgs_test.go index bb5d8fe85..ac3535cfa 100644 --- a/x/msgauth/types/msgs_test.go +++ b/x/msgauth/types/msgs_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) func TestMsgGrantAuthorization(t *testing.T) { diff --git a/x/msgauth/types/send_authorization.go b/x/msgauth/types/send_authorization.go index 7b8b19e5b..7532da27e 100644 --- a/x/msgauth/types/send_authorization.go +++ b/x/msgauth/types/send_authorization.go @@ -1,9 +1,10 @@ package types import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) // NewSendAuthorization return new SendAuthorization instance diff --git a/x/oracle/exported/alias.go b/x/oracle/exported/alias.go index a6e62ff36..f6526e6bd 100644 --- a/x/oracle/exported/alias.go +++ b/x/oracle/exported/alias.go @@ -1,4 +1,5 @@ -// nolint:deadcode unused DONTCOVER +//nolint:deadcode,unused +//DONTCOVER package exported import "github.com/terra-project/core/x/oracle/types" diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 6784c46a7..3da721421 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -5,10 +5,11 @@ import ( "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/oracle" "github.com/terra-project/core/x/oracle/keeper" "github.com/terra-project/core/x/oracle/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestExportInitGenesis(t *testing.T) { diff --git a/x/oracle/handler_test.go b/x/oracle/handler_test.go index 071110ee8..8d88d0f57 100644 --- a/x/oracle/handler_test.go +++ b/x/oracle/handler_test.go @@ -6,9 +6,10 @@ import ( "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/tendermint/tendermint/crypto/secp256k1" core "github.com/terra-project/core/types" "github.com/terra-project/core/x/oracle/keeper" diff --git a/x/oracle/keeper/ballot.go b/x/oracle/keeper/ballot.go index 309516869..504559b2d 100644 --- a/x/oracle/keeper/ballot.go +++ b/x/oracle/keeper/ballot.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/oracle/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // OrganizeBallotByDenom collects all oracle votes for the period, categorized by the votes' denom parameter diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index 62ccb5dee..8d72093f4 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/oracle/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // VotePeriod returns the number of blocks during which voting takes place. diff --git a/x/oracle/keeper/test_utils.go b/x/oracle/keeper/test_utils.go index ec92cd008..8a580aae5 100644 --- a/x/oracle/keeper/test_utils.go +++ b/x/oracle/keeper/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package keeper import ( diff --git a/x/oracle/keeper/vote_target_test.go b/x/oracle/keeper/vote_target_test.go index 09b3a258c..252323c09 100644 --- a/x/oracle/keeper/vote_target_test.go +++ b/x/oracle/keeper/vote_target_test.go @@ -3,8 +3,9 @@ package keeper import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestKeeper_GetVoteTargets(t *testing.T) { diff --git a/x/oracle/module.go b/x/oracle/module.go index f25ac02d1..ceba15882 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -76,7 +76,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the oracle module. diff --git a/x/oracle/simulation/genesis.go b/x/oracle/simulation/genesis.go index c48cdd0f2..48b1f3abb 100644 --- a/x/oracle/simulation/genesis.go +++ b/x/oracle/simulation/genesis.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" diff --git a/x/oracle/simulation/operations.go b/x/oracle/simulation/operations.go index 6a3a1b27a..0c65c2a93 100644 --- a/x/oracle/simulation/operations.go +++ b/x/oracle/simulation/operations.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "math/rand" diff --git a/x/oracle/simulation/params.go b/x/oracle/simulation/params.go index f870741de..a4fc9883e 100644 --- a/x/oracle/simulation/params.go +++ b/x/oracle/simulation/params.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "fmt" diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go index 59b65a175..c795cbb57 100644 --- a/x/oracle/types/errors.go +++ b/x/oracle/types/errors.go @@ -3,8 +3,9 @@ package types import ( "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tendermint/tendermint/crypto/tmhash" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // Oracle Errors diff --git a/x/oracle/types/hash.go b/x/oracle/types/hash.go index 863921a99..ce5fc8cdc 100644 --- a/x/oracle/types/hash.go +++ b/x/oracle/types/hash.go @@ -8,8 +8,9 @@ import ( "gopkg.in/yaml.v2" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tendermint/tendermint/crypto/tmhash" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ yaml.Marshaler = AggregateVoteHash{} diff --git a/x/oracle/types/hash_test.go b/x/oracle/types/hash_test.go index e1b062167..8e3995d22 100644 --- a/x/oracle/types/hash_test.go +++ b/x/oracle/types/hash_test.go @@ -3,10 +3,11 @@ package types import ( "encoding/hex" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" + "testing" ) diff --git a/x/oracle/types/msgs_test.go b/x/oracle/types/msgs_test.go index a0f3c78ed..23d2b9af0 100644 --- a/x/oracle/types/msgs_test.go +++ b/x/oracle/types/msgs_test.go @@ -5,8 +5,9 @@ import ( core "github.com/terra-project/core/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMsgFeederDelegation(t *testing.T) { diff --git a/x/oracle/types/test_utils.go b/x/oracle/types/test_utils.go index 552eabacb..87f60a124 100644 --- a/x/oracle/types/test_utils.go +++ b/x/oracle/types/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package types import ( diff --git a/x/oracle/types/vote.go b/x/oracle/types/vote.go index f9fd180a8..6e4bdf36a 100644 --- a/x/oracle/types/vote.go +++ b/x/oracle/types/vote.go @@ -4,8 +4,9 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "gopkg.in/yaml.v2" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // NewAggregateExchangeRatePrevote returns AggregateExchangeRatePrevote object diff --git a/x/oracle/wasm/interface_test.go b/x/oracle/wasm/interface_test.go index e1b2d9f06..0d4934ea8 100644 --- a/x/oracle/wasm/interface_test.go +++ b/x/oracle/wasm/interface_test.go @@ -4,9 +4,10 @@ import ( "encoding/json" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + core "github.com/terra-project/core/types" "github.com/terra-project/core/x/oracle/keeper" "github.com/terra-project/core/x/oracle/wasm" diff --git a/x/treasury/client/proposal_handler.go b/x/treasury/client/proposal_handler.go index ecd9f0c28..60f33d7f9 100644 --- a/x/treasury/client/proposal_handler.go +++ b/x/treasury/client/proposal_handler.go @@ -1,9 +1,10 @@ package client import ( - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" "github.com/terra-project/core/x/treasury/client/cli" "github.com/terra-project/core/x/treasury/client/rest" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" ) // param change proposal handler diff --git a/x/treasury/client/rest/query.go b/x/treasury/client/rest/query.go index d96c3a6b3..050178e99 100644 --- a/x/treasury/client/rest/query.go +++ b/x/treasury/client/rest/query.go @@ -6,9 +6,10 @@ import ( "github.com/terra-project/core/x/treasury/types" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/gorilla/mux" ) func registerQueryRoute(clientCtx client.Context, r *mux.Router) { diff --git a/x/treasury/exported/alias.go b/x/treasury/exported/alias.go index 61fe2d871..dd49366db 100644 --- a/x/treasury/exported/alias.go +++ b/x/treasury/exported/alias.go @@ -1,4 +1,5 @@ -// nolint:deadcode unused DONTCOVER +//nolint:deadcode,unused +//DONTCOVER package exported import ( diff --git a/x/treasury/genesis_test.go b/x/treasury/genesis_test.go index 63277d81a..1313982e5 100644 --- a/x/treasury/genesis_test.go +++ b/x/treasury/genesis_test.go @@ -3,9 +3,10 @@ package treasury import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + core "github.com/terra-project/core/types" "github.com/terra-project/core/x/treasury/keeper" ) diff --git a/x/treasury/keeper/burn_account.go b/x/treasury/keeper/burn_account.go index cc3fb6ac7..44584636e 100644 --- a/x/treasury/keeper/burn_account.go +++ b/x/treasury/keeper/burn_account.go @@ -3,8 +3,9 @@ package keeper import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/treasury/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BurnCoinsFromBurnAccount burn all coins from burn account diff --git a/x/treasury/keeper/params.go b/x/treasury/keeper/params.go index 714af6278..a196a5f62 100644 --- a/x/treasury/keeper/params.go +++ b/x/treasury/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/treasury/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // TaxPolicy defines constraints for TaxRate diff --git a/x/treasury/keeper/test_utils.go b/x/treasury/keeper/test_utils.go index 11f8ae9ba..a4e284303 100644 --- a/x/treasury/keeper/test_utils.go +++ b/x/treasury/keeper/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package keeper import ( diff --git a/x/treasury/module.go b/x/treasury/module.go index f17c62644..5cd75866d 100644 --- a/x/treasury/module.go +++ b/x/treasury/module.go @@ -76,7 +76,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the oracle module. diff --git a/x/treasury/proposal_handler_test.go b/x/treasury/proposal_handler_test.go index ac4e83509..1c60f2018 100644 --- a/x/treasury/proposal_handler_test.go +++ b/x/treasury/proposal_handler_test.go @@ -3,9 +3,10 @@ package treasury import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/terra-project/core/x/treasury/keeper" "github.com/terra-project/core/x/treasury/types" ) diff --git a/x/treasury/simulation/genesis.go b/x/treasury/simulation/genesis.go index 3fd0cb62e..9e61bb573 100644 --- a/x/treasury/simulation/genesis.go +++ b/x/treasury/simulation/genesis.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" diff --git a/x/treasury/simulation/params.go b/x/treasury/simulation/params.go index 822f6630c..570233ca9 100644 --- a/x/treasury/simulation/params.go +++ b/x/treasury/simulation/params.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" diff --git a/x/treasury/types/constraint.go b/x/treasury/types/constraint.go index b812b0ba3..4b5001946 100644 --- a/x/treasury/types/constraint.go +++ b/x/treasury/types/constraint.go @@ -1,8 +1,9 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" "gopkg.in/yaml.v2" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // String implements fmt.Stringer interface diff --git a/x/treasury/types/constraint_test.go b/x/treasury/types/constraint_test.go index b0851db1c..8e158e585 100644 --- a/x/treasury/types/constraint_test.go +++ b/x/treasury/types/constraint_test.go @@ -3,8 +3,9 @@ package types import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestConstraintClamp(t *testing.T) { diff --git a/x/vesting/types/genesis_test.go b/x/vesting/types/genesis_test.go index e985b0195..936b25739 100644 --- a/x/vesting/types/genesis_test.go +++ b/x/vesting/types/genesis_test.go @@ -9,6 +9,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authvesttypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + + core "github.com/terra-project/core/types" ) var ( @@ -21,7 +23,7 @@ var ( // require invalid vesting account fails validation func TestValidateGenesisInvalidAccounts(t *testing.T) { acc1 := authtypes.NewBaseAccountWithAddress(sdk.AccAddress(addr1)) - coins := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 150)) + coins := sdk.NewCoins(sdk.NewInt64Coin(core.MicroLunaDenom, 150)) baseVestingAcc := authvesttypes.NewBaseVestingAccount(acc1, coins, 0) // invalid delegated vesting @@ -39,6 +41,6 @@ func TestValidateGenesisInvalidAccounts(t *testing.T) { require.NoError(t, authtypes.ValidateGenAccounts(genAccs)) // invalid vesting time - genAccs[0] = NewLazyGradedVestingAccountRaw(baseVestingAcc, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{1654668078, 1554668078, sdk.OneDec()}}}}) + genAccs[0] = NewLazyGradedVestingAccountRaw(baseVestingAcc, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{1654668078, 1554668078, sdk.OneDec()}}}}) require.Error(t, authtypes.ValidateGenAccounts(genAccs)) } diff --git a/x/vesting/types/test_utils.go b/x/vesting/types/test_utils.go index d3335ba3c..8e2a41c5f 100644 --- a/x/vesting/types/test_utils.go +++ b/x/vesting/types/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package types import ( diff --git a/x/vesting/types/vesting_account_test.go b/x/vesting/types/vesting_account_test.go index 6d3801dad..e61645fec 100644 --- a/x/vesting/types/vesting_account_test.go +++ b/x/vesting/types/vesting_account_test.go @@ -5,13 +5,16 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/stretchr/testify/require" tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authvestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + + core "github.com/terra-project/core/types" ) var ( @@ -265,7 +268,7 @@ func TestGenesisAccountValidate(t *testing.T) { pubkey := secp256k1.GenPrivKey().PubKey() addr := sdk.AccAddress(pubkey.Address()) baseAcc := authtypes.NewBaseAccount(addr, pubkey, 0, 0) - initialVesting := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)) + initialVesting := sdk.NewCoins(sdk.NewInt64Coin(core.MicroLunaDenom, 50)) baseVestingWithCoins := authvestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, 100) tests := []struct { name string @@ -289,27 +292,27 @@ func TestGenesisAccountValidate(t *testing.T) { }, { "valid continuous vesting account", - NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{1554668078, 1654668078, sdk.OneDec()}}}}), + NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{1554668078, 1654668078, sdk.OneDec()}}}}), nil, }, { "invalid vesting times", - NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{1654668078, 1554668078, sdk.OneDec()}}}}), + NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{1654668078, 1554668078, sdk.OneDec()}}}}), errors.New("vesting start-time cannot be before end-time"), }, { "invalid vesting times 2", - NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{-1, 1554668078, sdk.OneDec()}}}}), + NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{-1, 1554668078, sdk.OneDec()}}}}), errors.New("vesting start-time cannot be negative"), }, { "invalid vesting ratio", - NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{1554668078, 1654668078, sdk.ZeroDec()}}}}), + NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{1554668078, 1654668078, sdk.ZeroDec()}}}}), errors.New("vesting ratio cannot be smaller than or equal with zero"), }, { "invalid vesting sum of ratio", - NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{sdk.DefaultBondDenom, Schedules{Schedule{1554668078, 1654668078, sdk.NewDecWithPrec(1, 1)}}}}), + NewLazyGradedVestingAccount(baseAcc, initialVesting, VestingSchedules{VestingSchedule{core.MicroLunaDenom, Schedules{Schedule{1554668078, 1654668078, sdk.NewDecWithPrec(1, 1)}}}}), errors.New("vesting total ratio must be one"), }, } diff --git a/x/wasm/client/rest/tx.go b/x/wasm/client/rest/tx.go index 0feb9e679..9d920f953 100644 --- a/x/wasm/client/rest/tx.go +++ b/x/wasm/client/rest/tx.go @@ -6,11 +6,12 @@ import ( "net/http" "strconv" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/gorilla/mux" feeutils "github.com/terra-project/core/custom/auth/client/utils" wasmUtils "github.com/terra-project/core/x/wasm/client/utils" diff --git a/x/wasm/common_test.go b/x/wasm/common_test.go index 167e81cb2..ba67fc27e 100644 --- a/x/wasm/common_test.go +++ b/x/wasm/common_test.go @@ -1,4 +1,3 @@ -// nolint:deadcode unused noalias package wasm_test import ( diff --git a/x/wasm/genesis.go b/x/wasm/genesis.go index 7fda7d73d..d8bc44613 100644 --- a/x/wasm/genesis.go +++ b/x/wasm/genesis.go @@ -3,9 +3,10 @@ package wasm import ( "bytes" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/wasm/keeper" "github.com/terra-project/core/x/wasm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis sets wasm information for genesis. diff --git a/x/wasm/handler_test.go b/x/wasm/handler_test.go index f0878af46..be1ed1eca 100644 --- a/x/wasm/handler_test.go +++ b/x/wasm/handler_test.go @@ -5,13 +5,14 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/terra-project/core/x/wasm" "github.com/terra-project/core/x/wasm/keeper" "github.com/terra-project/core/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + wasmTypes "github.com/CosmWasm/go-cosmwasm/types" core "github.com/terra-project/core/types" diff --git a/x/wasm/keeper/api.go b/x/wasm/keeper/api.go index 3e1e3c67b..e0bbd5f62 100644 --- a/x/wasm/keeper/api.go +++ b/x/wasm/keeper/api.go @@ -4,6 +4,7 @@ import ( "fmt" cosmwasm "github.com/CosmWasm/go-cosmwasm" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/wasm/types" diff --git a/x/wasm/keeper/contract.go b/x/wasm/keeper/contract.go index 4600d5af6..b81794574 100644 --- a/x/wasm/keeper/contract.go +++ b/x/wasm/keeper/contract.go @@ -3,11 +3,12 @@ package keeper import ( "encoding/binary" + "github.com/tendermint/tendermint/crypto" + "github.com/terra-project/core/x/wasm/types" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/tendermint/tendermint/crypto" - "github.com/terra-project/core/x/wasm/types" ) // CompileCode uncompress the wasm code bytes and store the code to local file system diff --git a/x/wasm/keeper/custom_test.go b/x/wasm/keeper/custom_test.go index 5b2487a65..7af19015c 100644 --- a/x/wasm/keeper/custom_test.go +++ b/x/wasm/keeper/custom_test.go @@ -8,6 +8,7 @@ import ( "testing" wasmTypes "github.com/CosmWasm/go-cosmwasm/types" + "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/wasm/keeper/legacy_querier_test.go b/x/wasm/keeper/legacy_querier_test.go index c8a226cc1..51d427ee7 100644 --- a/x/wasm/keeper/legacy_querier_test.go +++ b/x/wasm/keeper/legacy_querier_test.go @@ -7,9 +7,10 @@ import ( "os" "testing" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/viper" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/wasm/types" diff --git a/x/wasm/keeper/msg_server.go b/x/wasm/keeper/msg_server.go index 958c25a4e..a0f1e05c3 100644 --- a/x/wasm/keeper/msg_server.go +++ b/x/wasm/keeper/msg_server.go @@ -4,9 +4,10 @@ import ( "context" "fmt" + "github.com/terra-project/core/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/terra-project/core/x/wasm/types" ) type msgServer struct { diff --git a/x/wasm/keeper/params.go b/x/wasm/keeper/params.go index 30dc3084d..d266f7c01 100644 --- a/x/wasm/keeper/params.go +++ b/x/wasm/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/wasm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // MaxContractSize defines maximum bytes size of a contract diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go index 517d5acb9..3cac74971 100644 --- a/x/wasm/keeper/querier.go +++ b/x/wasm/keeper/querier.go @@ -5,11 +5,12 @@ import ( "fmt" "runtime/debug" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/terra-project/core/x/wasm/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over q diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 7a9aa18d8..cb3870375 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -7,9 +7,10 @@ import ( "os" "testing" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/viper" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/terra-project/core/x/wasm/types" diff --git a/x/wasm/keeper/recursive_test.go b/x/wasm/keeper/recursive_test.go index 957034a0e..c46be6807 100644 --- a/x/wasm/keeper/recursive_test.go +++ b/x/wasm/keeper/recursive_test.go @@ -11,11 +11,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerror "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" "github.com/terra-project/core/x/wasm/types" ) diff --git a/x/wasm/keeper/staking_test.go b/x/wasm/keeper/staking_test.go index 232f83785..637a102d5 100644 --- a/x/wasm/keeper/staking_test.go +++ b/x/wasm/keeper/staking_test.go @@ -6,6 +6,8 @@ import ( "os" "testing" + "github.com/tendermint/tendermint/crypto/secp256k1" + "github.com/cosmos/cosmos-sdk/client/flags" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -18,7 +20,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/spf13/viper" "github.com/stretchr/testify/assert" @@ -110,7 +111,7 @@ func TestInitializeStaking(t *testing.T) { assert.True(t, found) assert.Equal(t, v.GetDelegatorShares(), sdk.NewDec(1234567)) - deposit := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000), sdk.NewInt64Coin(core.MicroLunaDenom, 500000)) + deposit := sdk.NewCoins(sdk.NewInt64Coin(core.MicroLunaDenom, 500000)) creatorAddr := createFakeFundedAccount(ctx, accKeeper, bankKeeper, deposit) // upload staking derivates code @@ -178,7 +179,7 @@ func initializeStaking(t *testing.T, input TestInput) InitInfo { assert.Equal(t, v.GetDelegatorShares(), sdk.NewDec(1000000)) assert.Equal(t, v.Status, stakingtypes.Bonded) - deposit := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000), sdk.NewInt64Coin(core.MicroLunaDenom, 500000)) + deposit := sdk.NewCoins(sdk.NewInt64Coin(core.MicroLunaDenom, 500000)) creatorAddr := createFakeFundedAccount(ctx, accKeeper, bankKeeper, deposit) // upload staking derivates code diff --git a/x/wasm/keeper/test_utils.go b/x/wasm/keeper/test_utils.go index a96c6846a..ca5b5bc69 100644 --- a/x/wasm/keeper/test_utils.go +++ b/x/wasm/keeper/test_utils.go @@ -1,4 +1,4 @@ -// nolint:deadcode unused noalias +//nolint package keeper import ( @@ -13,6 +13,8 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -37,7 +39,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" customauth "github.com/terra-project/core/custom/auth" custombank "github.com/terra-project/core/custom/bank" diff --git a/x/wasm/module.go b/x/wasm/module.go index d0ac8bf92..cebfe00f7 100644 --- a/x/wasm/module.go +++ b/x/wasm/module.go @@ -76,7 +76,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the root tx command for the oracle module. diff --git a/x/wasm/simulation/genesis.go b/x/wasm/simulation/genesis.go index c0a22f226..4b58f19b5 100644 --- a/x/wasm/simulation/genesis.go +++ b/x/wasm/simulation/genesis.go @@ -1,14 +1,15 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" "fmt" "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/terra-project/core/x/wasm/types" + + "github.com/cosmos/cosmos-sdk/types/module" ) // Simulation parameter constants diff --git a/x/wasm/simulation/operations.go b/x/wasm/simulation/operations.go index 859ab50a6..4672eb201 100644 --- a/x/wasm/simulation/operations.go +++ b/x/wasm/simulation/operations.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "encoding/json" @@ -19,6 +19,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + core "github.com/terra-project/core/types" "github.com/terra-project/core/x/wasm/keeper" "github.com/terra-project/core/x/wasm/types" ) @@ -251,7 +252,7 @@ func SimulateMsgExecuteContract(ak types.AccountKeeper, bk types.BankKeeper, k k } spendableCoins = spendableCoins.Sub(fees) - spendableCoins = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, spendableCoins.AmountOf(sdk.DefaultBondDenom))) + spendableCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, spendableCoins.AmountOf(core.MicroLunaDenom))) if err := bk.SendEnabledCoins(ctx, spendableCoins...); err != nil { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgExecuteContract, "send not enabled"), nil, nil diff --git a/x/wasm/simulation/params.go b/x/wasm/simulation/params.go index 33824ea68..fed2dd675 100644 --- a/x/wasm/simulation/params.go +++ b/x/wasm/simulation/params.go @@ -1,6 +1,6 @@ package simulation -// DONTCOVER +//DONTCOVER import ( "fmt" diff --git a/x/wasm/types/msgs_test.go b/x/wasm/types/msgs_test.go index 205bd3bb1..28ca34738 100644 --- a/x/wasm/types/msgs_test.go +++ b/x/wasm/types/msgs_test.go @@ -6,8 +6,9 @@ import ( core "github.com/terra-project/core/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestMsgStoreCode(t *testing.T) {