diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3d21b52..613da7c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,45 +1,11 @@ +--- version: 2 -updates: -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 -- package-ecosystem: gomod - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: github.com/CosmWasm/wasmvm - versions: - - 0.14.0-beta2 - - 0.14.0-beta3 - - 0.14.0-beta4 - - 0.14.0-beta5 - - 0.14.0-rc1 - - dependency-name: github.com/cometbft/cometbft - versions: - - 0.34.10 - - 0.34.4 - - 0.34.7 - - 0.34.8 - - 0.34.9 - - dependency-name: github.com/cosmos/cosmos-sdk - versions: - - 0.41.4 - - 0.42.0 - - 0.42.1 - - 0.42.2 - - 0.42.4 - - dependency-name: google.golang.org/grpc - versions: - - 1.36.0 - - 1.36.1 - - 1.37.0 - - dependency-name: github.com/spf13/cobra - versions: - - 1.1.2 - - dependency-name: github.com/cometbft/cometbft-db - versions: - - 0.6.4 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbe476c..35a91ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,16 +11,19 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + GO_VERSION: 1.21.0 + jobs: build: runs-on: ubuntu-latest name: build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup go uses: actions/setup-go@v4 with: - go-version: 1.20.0 + go-version: ${{ env.GO_VERSION }} - run: go build ./... test: @@ -30,7 +33,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: ${{ env.GO_VERSION }} - name: Checkout code uses: actions/checkout@v3 - name: Test @@ -44,7 +47,7 @@ jobs: - name: Setup go uses: actions/setup-go@v4 with: - go-version: 1.20.0 + go-version: ${{ env.GO_VERSION }} - run: | go mod tidy CHANGES_IN_REPO=$(git status --porcelain) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index d832b9b..676302a 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -16,13 +16,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build without push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64 diff --git a/.github/workflows/codeql-analyzer.yml b/.github/workflows/codeql-analyzer.yml deleted file mode 100644 index 77f3446..0000000 --- a/.github/workflows/codeql-analyzer.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "Code Scanning - Action" - -on: - pull_request: - paths: - - "**.go" - push: - branches: [ main ] - paths: - - "**.go" - -jobs: - CodeQL-Build: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3.5.0 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: 'go' - queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 40b385c..7777018 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,16 +1,25 @@ -name: "Code Scanning - Action" +--- +# THIS GITHUB ACTION LIFTED WITH LOVE FROM THE COSMOS-SDK +name: "CodeQL" on: pull_request: paths: - "**.go" push: - branches: + branches: - main - release/** paths: - "**.go" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + GO_VERSION: 1.21.0 + jobs: analyze: name: Analyze @@ -22,10 +31,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: 1.20.0 + go-version: ${{ env.GO_VERSION }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..5545cd2 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v4 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v2 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 2ae2c07..c64bc88 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -8,14 +8,16 @@ on: - master - main pull_request: - paths: - - '**.go' + permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + +env: + GO_VERSION: 1.21.0 jobs: golangci: @@ -24,10 +26,10 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.0 - - uses: actions/checkout@v3 + go-version: ${{ env.GO_VERSION }} + - uses: actions/checkout@v4 - - name: golangci-lint + - name: golangci-lint-terpd uses: golangci/golangci-lint-action@v3 with: version: latest diff --git a/.github/workflows/interchaintest-E2E.yml b/.github/workflows/interchaintest-E2E.yml index 9a894e8..d48ec4c 100644 --- a/.github/workflows/interchaintest-E2E.yml +++ b/.github/workflows/interchaintest-E2E.yml @@ -1,186 +1,98 @@ name: ictest E2E on: + pull_request: push: tags: - - '**' + - "**" branches: - - '**' - paths: - - '**.yml' - - '**.go' - - '**.mod' - - '**.sum' + - "main" + - "master" + +permissions: + contents: read + packages: write env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }}-e2e - GO_VERSION: 1.20.0 + GO_VERSION: 1.21.0 + TAR_PATH: /tmp/terp-docker-image.tar + IMAGE_NAME: terp-docker-image concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - build-and-push-image: + build-docker: runs-on: ubuntu-latest - outputs: - branchTag: ${{ steps.meta.outputs.version }} - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - # We setup go & cache dependencies here. This way each child job - # does not have to reinstall all dependencies individually. - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 + - name: Setup Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - id: go - - - name: Download dependencies - run: | - go mod download - cd interchaintest && go mod download - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + cache-dependency-path: interchaintest/go.sum - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v4 + - name: Build and export + uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - # make terp-core:branchname here for all needs.build-and-push-image.outputs.branchTag - # then upload to github. Then download for each as a cache. This way its only built once + tags: terpnetwork:local + outputs: type=docker,dest=${{ env.TAR_PATH }} - # TODO: Add reusable job template here, just changing the `make` command for each - - test-terp-basic: - runs-on: ubuntu-latest - needs: build-and-push-image - steps: - - name: checkout chain - uses: actions/checkout@v2 - - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 + - name: Upload artifact + uses: actions/upload-artifact@v3 with: - go-version: ${{ env.GO_VERSION }} - id: go + name: ${{ env.IMAGE_NAME }} + path: ${{ env.TAR_PATH }} - - run: make ictest-basic - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} - - test-terp-ibc: + e2e-tests: + needs: build-docker runs-on: ubuntu-latest - needs: build-and-push-image - steps: - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 - with: - go-version: ${{ env.GO_VERSION }} - id: go - - - name: checkout chain - uses: actions/checkout@v2 + strategy: + matrix: + # names of `make` commands to run tests + test: + - "ictest-basic" + - "ictest-statesync" + - "ictest-ibchooks" + - "ictest-tokenfactory" + - "ictest-feeshare" + - "ictest-pfm" + # - "ictest-upgrade" + - "ictest-ibc" + # - "ictest-pob" + # - "ictest-drip" + - "ictest-burn" + # - "ictest-cwhooks" + # - "ictest-clock" + fail-fast: false - - run: make ictest-ibc - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} - - test-terp-upgrade: - runs-on: ubuntu-latest - needs: build-and-push-image steps: - - name: checkout chain - uses: actions/checkout@v2 - - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - id: go - - - run: make ictest-upgrade - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} - - test-terp-ibchooks: - runs-on: ubuntu-latest - needs: build-and-push-image - steps: - - name: checkout chain - uses: actions/checkout@v2 - - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 - with: - go-version: ${{ env.GO_VERSION }} - id: go - - - run: make ictest-ibchooks - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} + cache-dependency-path: interchaintest/go.sum - test-terp-pfm: - runs-on: ubuntu-latest - needs: build-and-push-image - steps: - name: checkout chain - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 + - name: Download Tarball Artifact + uses: actions/download-artifact@v3 with: - go-version: ${{ env.GO_VERSION }} - id: go + name: ${{ env.IMAGE_NAME }} + path: /tmp - - run: make ictest-pfm - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} - - test-terp-tokenfactory: - runs-on: ubuntu-latest - needs: build-and-push-image - steps: - - name: Setup Golang with cache - uses: magnetikonline/action-golang-cache@v4 - with: - go-version: ${{ env.GO_VERSION }} - id: go - - - name: checkout chain - uses: actions/checkout@v2 + - name: Load Docker Image + run: | + docker image load -i ${{ env.TAR_PATH }} + docker image ls -a - - run: make ictest-tokenfactory - env: - BRANCH_CI: ${{needs.build-and-push-image.outputs.branchTag}} \ No newline at end of file + - name: Run Test + run: make ${{ matrix.test }} \ No newline at end of file diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 6436aed..d35fab2 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -34,15 +34,15 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -62,7 +62,7 @@ jobs: - name: Build and push id: build_push_image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: Dockerfile context: . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8df5eb6..5e09014 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker compose run: STAKE_TOKEN="uterp" TIMEOUT_COMMIT=500ms docker-compose up -d diff --git a/.gitignore b/.gitignore index ed049cc..e60ff67 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,7 @@ dependency-graph.png *.out *.synctex.gz contract_tests/* + +# Protobuf +gogoproto +github.com \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bd33cbe..b537266 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,11 @@ RUN apk add git WORKDIR /code COPY . /code/ # See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a -ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2a72c7062e3c791792b3dab781c815c9a76083a7997ce6f9f2799aaf577f3c25 -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 8ea2e3b5fae83e671da2bb51115adc88591045953f509955ec38dc02ea5a7b94 + +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913 +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63 # Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a diff --git a/Makefile b/Makefile index 1c545f7..e143904 100644 --- a/Makefile +++ b/Makefile @@ -195,6 +195,9 @@ format: format-tools ictest-basic: rm-testcache cd interchaintest && go test -race -v -run TestBasicTerpStart . +ictest-statesync: rm-testcache + cd interchaintest && go test -race -v -run TestTerpStateSync . + ictest-ibchooks: rm-testcache cd interchaintest && go test -race -v -run TestTerpIBCHooks . @@ -204,6 +207,12 @@ ictest-pfm: rm-testcache ictest-tokenfactory: rm-testcache cd interchaintest && go test -race -v -run TestTerpTokenFactory . +ictest-burn: rm-testcache + cd interchaintest && go test -race -v -run TestTerpBurnModule . + +# ictest-clock: rm-testcache +# cd interchaintest && go test -race -v -run TestTerpClock . + ictest-feeshare: rm-testcache cd interchaintest && go test -race -v -run TestTerpFeeShare . diff --git a/app/ante.go b/app/ante.go index 9f719e4..fa3566f 100644 --- a/app/ante.go +++ b/app/ante.go @@ -13,10 +13,10 @@ import ( ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" "github.com/cosmos/ibc-go/v7/modules/core/keeper" - feeshareante "github.com/terpnetwork/terp-core/v2/x/feeshare/ante" - feesharekeeper "github.com/terpnetwork/terp-core/v2/x/feeshare/keeper" - globalfeeante "github.com/terpnetwork/terp-core/v2/x/globalfee/ante" - globalfeekeeper "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" + feeshareante "github.com/terpnetwork/terp-core/v4/x/feeshare/ante" + feesharekeeper "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper" + globalfeeante "github.com/terpnetwork/terp-core/v4/x/globalfee/ante" + globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" diff --git a/app/app.go b/app/app.go index ff880f9..14309f9 100644 --- a/app/app.go +++ b/app/app.go @@ -62,17 +62,18 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/terpnetwork/terp-core/v2/app/openapiconsole" - v2 "github.com/terpnetwork/terp-core/v2/app/upgrades/v2" - v3 "github.com/terpnetwork/terp-core/v2/app/upgrades/v3" - "github.com/terpnetwork/terp-core/v2/docs" + "github.com/terpnetwork/terp-core/v4/app/openapiconsole" + v2 "github.com/terpnetwork/terp-core/v4/app/upgrades/v2" + v3 "github.com/terpnetwork/terp-core/v4/app/upgrades/v3" + v4 "github.com/terpnetwork/terp-core/v4/app/upgrades/v4" + "github.com/terpnetwork/terp-core/v4/docs" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/terpnetwork/terp-core/v2/app/keepers" - "github.com/terpnetwork/terp-core/v2/app/upgrades" + "github.com/terpnetwork/terp-core/v4/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/upgrades" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" // statik for swagger UI support @@ -99,6 +100,7 @@ var ( Upgrades = []upgrades.Upgrade{ v2.Upgrade, v3.Upgrade, + v4.Upgrade, } ) @@ -154,23 +156,6 @@ func SetAddressPrefixes() { }) } -// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to -// produce a list of enabled proposals to pass into wasmd app. -func GetEnabledProposals() []wasmtypes.ProposalType { - if EnableSpecificProposals == "" { - if ProposalsEnabled == "true" { - return wasmtypes.EnableAllProposals - } - return wasmtypes.DisableAllProposals - } - chunks := strings.Split(EnableSpecificProposals, ",") - proposals, err := wasmtypes.ConvertToProposals(chunks) - if err != nil { - panic(err) - } - return proposals -} - func GetWasmOpts(appOpts servertypes.AppOptions) []wasmkeeper.Option { var wasmOpts []wasmkeeper.Option if cast.ToBool(appOpts.Get("telemetry.enabled")) { @@ -228,7 +213,6 @@ func NewTerpApp( db dbm.DB, traceStore io.Writer, loadLatest bool, - enabledProposals []wasmtypes.ProposalType, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), @@ -261,7 +245,6 @@ func NewTerpApp( bApp, legacyAmino, keepers.GetMaccPerms(), - enabledProposals, appOpts, wasmOpts, ) diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index e3d9ee1..4a27355 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -34,8 +34,8 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/terpnetwork/terp-core/v2/app" - appparams "github.com/terpnetwork/terp-core/v2/app/params" + "github.com/terpnetwork/terp-core/v4/app" + appparams "github.com/terpnetwork/terp-core/v4/app/params" ) type KeeperTestHelper struct { diff --git a/app/encoding.go b/app/encoding.go index 8ebe3ed..770e2af 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -3,7 +3,7 @@ package app import ( "github.com/cosmos/cosmos-sdk/std" - "github.com/terpnetwork/terp-core/v2/app/params" + "github.com/terpnetwork/terp-core/v4/app/params" ) // MakeEncodingConfig creates a new EncodingConfig with all modules registered diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index c59cd09..a89d132 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -92,22 +92,25 @@ import ( upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - feesharekeeper "github.com/terpnetwork/terp-core/v2/x/feeshare/keeper" - feesharetypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + denomburn "github.com/terpnetwork/terp-core/v4/x/burn" + // clockkeeper "github.com/terpnetwork/terp-core/v4/x/clock/keeper" + // clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types" + feesharekeeper "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee" - globalfeekeeper "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" - globalfeetypes "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee" + globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" + globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" // token factory - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings" - tokenfactorykeeper "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings" + tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) var ( - wasmCapabilities = "iterator,staking,stargate,token_factory,cosmwasm_1_1,cosmwasm_1_2,tokenfactory" + wasmCapabilities = "iterator,staking,stargate,token_factory,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,tokenfactory" tokenFactoryCapabilities = []string{ tokenfactorytypes.EnableBurnFrom, @@ -132,6 +135,7 @@ var maccPerms = map[string][]string{ globalfee.ModuleName: nil, wasmtypes.ModuleName: {authtypes.Burner}, tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + denomburn.ModuleName: {authtypes.Burner}, } type AppKeepers struct { @@ -171,8 +175,9 @@ type AppKeepers struct { PacketForwardKeeper *packetforwardkeeper.Keeper ICQKeeper icqkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - WasmKeeper wasmkeeper.Keeper + // ClockKeeper clockkeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + WasmKeeper wasmkeeper.Keeper ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper @@ -192,7 +197,6 @@ func NewAppKeepers( bApp *baseapp.BaseApp, cdc *codec.LegacyAmino, maccPerms map[string][]string, - enabledProposals []wasmtypes.ProposalType, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, ) AppKeepers { @@ -526,6 +530,10 @@ func NewAppKeepers( }) wasmOpts = append(wasmOpts, querierOpts) + denomBurnerPlugin := denomburn.NewBurnerPlugin(appKeepers.BankKeeper, appKeepers.MintKeeper) + burnOverride := wasmkeeper.WithMessageHandler(wasmkeeper.NewBurnCoinMessageHandler(denomBurnerPlugin)) + wasmOpts = append(wasmOpts, burnOverride) + appKeepers.WasmKeeper = wasmkeeper.NewKeeper( appCodec, appKeepers.keys[wasmtypes.StoreKey], @@ -566,11 +574,12 @@ func NewAppKeepers( appKeepers.keys[globalfeetypes.StoreKey], govModAddress, ) - - // The gov proposal types can be individually enabled - if len(enabledProposals) != 0 { - govRouter.AddRoute(wasmtypes.RouterKey, wasmkeeper.NewWasmProposalHandler(appKeepers.WasmKeeper, enabledProposals)) //nolint:staticcheck - } + // appKeepers.ClockKeeper = clockkeeper.NewKeeper( + // appKeepers.keys[clocktypes.StoreKey], + // appCodec, + // *appKeepers.ContractKeeper, + // govModAddress, + // ) // Set legacy router for backwards compatibility with gov v1beta1 appKeepers.GovKeeper.SetLegacyRouter(govRouter) diff --git a/app/keepers/keys.go b/app/keepers/keys.go index f563941..75047a6 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -26,14 +26,15 @@ import ( ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - feesharetypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" - globalfeetypes "github.com/terpnetwork/terp-core/v2/x/globalfee/types" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" + globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + // clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types" ) func (appKeepers *AppKeepers) GenerateKeys() { @@ -67,6 +68,7 @@ func (appKeepers *AppKeepers) GenerateKeys() { ibchookstypes.StoreKey, feesharetypes.StoreKey, globalfeetypes.StoreKey, + // clocktypes.StoreKey, tokenfactorytypes.StoreKey, ) diff --git a/app/modules.go b/app/modules.go index 2eddb85..d65acca 100644 --- a/app/modules.go +++ b/app/modules.go @@ -4,6 +4,8 @@ import ( wasm "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + mint "github.com/cosmos/cosmos-sdk/x/mint" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" icq "github.com/cosmos/ibc-apps/modules/async-icq/v7" @@ -18,8 +20,8 @@ import ( ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - mint "github.com/cosmos/cosmos-sdk/x/mint" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + // "github.com/terpnetwork/terp-core/v4/x/clock" + // clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -58,17 +60,17 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - encparams "github.com/terpnetwork/terp-core/v2/app/params" - "github.com/terpnetwork/terp-core/v2/x/feeshare" - feesharetypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory" + encparams "github.com/terpnetwork/terp-core/v4/app/params" + "github.com/terpnetwork/terp-core/v4/x/feeshare" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory" "github.com/cosmos/cosmos-sdk/x/group" ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7" ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" ) @@ -108,6 +110,7 @@ var ModuleBasics = module.NewBasicManager( packetforward.AppModuleBasic{}, feeshare.AppModuleBasic{}, globalfee.AppModuleBasic{}, + // clock.AppModuleBasic{}, tokenfactory.AppModuleBasic{}, ) @@ -154,6 +157,7 @@ func appModules( ica.NewAppModule(&app.AppKeepers.ICAControllerKeeper, &app.AppKeepers.ICAHostKeeper), icq.NewAppModule(app.AppKeepers.ICQKeeper), packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper), + // clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper), ibchooks.NewAppModule(app.AppKeepers.AccountKeeper), crisis.NewAppModule(app.AppKeepers.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them } @@ -219,6 +223,7 @@ func orderBeginBlockers() []string { packetforwardtypes.ModuleName, feesharetypes.ModuleName, globalfee.ModuleName, + // clocktypes.ModuleName, ibchookstypes.ModuleName, tokenfactorytypes.ModuleName, wasmtypes.ModuleName, @@ -255,6 +260,7 @@ func orderEndBlockers() []string { packetforwardtypes.ModuleName, feesharetypes.ModuleName, globalfee.ModuleName, + // clocktypes.ModuleName, ibchookstypes.ModuleName, tokenfactorytypes.ModuleName, wasmtypes.ModuleName, @@ -280,6 +286,7 @@ func orderInitBlockers() []string { packetforwardtypes.ModuleName, ibchookstypes.ModuleName, tokenfactorytypes.ModuleName, + // clocktypes.ModuleName, wasmtypes.ModuleName, } } diff --git a/app/sim_test.go b/app/sim_test.go index 2eca812..8a35117 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -7,7 +7,6 @@ import ( "testing" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" @@ -112,7 +111,6 @@ func TestFullAppSimulation(t *testing.T) { db, nil, true, - wasmtypes.EnableAllProposals, appOptions, emptyWasmOption, fauxMerkleModeOpt, diff --git a/app/test_helpers.go b/app/test_helpers.go index 0148173..f310a9f 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -7,7 +7,6 @@ import ( "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" @@ -33,8 +32,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - apphelpers "github.com/terpnetwork/terp-core/v2/app/helpers" - appparams "github.com/terpnetwork/terp-core/v2/app/params" + apphelpers "github.com/terpnetwork/terp-core/v4/app/helpers" + appparams "github.com/terpnetwork/terp-core/v4/app/params" ) // EmptyBaseAppOptions is a stub implementing AppOptions @@ -46,7 +45,7 @@ func (ao EmptyBaseAppOptions) Get(_ string) interface{} { } // DefaultConsensusParams defines the default Tendermint consensus params used -// in junoApp testing. +// in terpApp testing. var DefaultConsensusParams = &tmproto.ConsensusParams{ Block: &tmproto.BlockParams{ MaxBytes: 200000, @@ -92,21 +91,21 @@ func Setup(t *testing.T) *TerpApp { return app } -// SetupWithGenesisValSet initializes a new junoApp with a validator set and genesis accounts +// SetupWithGenesisValSet initializes a new terpApp with a validator set and genesis accounts // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit in the default token of the TerpApp from first genesis // account. A Nop logger is set in TerpApp. func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *TerpApp { t.Helper() - junoApp, genesisState := setup(t, true) - genesisState = genesisStateWithValSet(t, junoApp, genesisState, valSet, genAccs, balances...) + terpApp, genesisState := setup(t, true) + genesisState = genesisStateWithValSet(t, terpApp, genesisState, valSet, genAccs, balances...) stateBytes, err := json.MarshalIndent(genesisState, "", " ") require.NoError(t, err) // init chain will set the validator set and initialize the genesis accounts - junoApp.InitChain( + terpApp.InitChain( abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, @@ -118,17 +117,17 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs ) // commit genesis changes - junoApp.Commit() - junoApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + terpApp.Commit() + terpApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ ChainID: "testing", - Height: junoApp.LastBlockHeight() + 1, - AppHash: junoApp.LastCommitID().Hash, + Height: terpApp.LastBlockHeight() + 1, + AppHash: terpApp.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), NextValidatorsHash: valSet.Hash(), Time: time.Now().UTC(), }}) - return junoApp + return terpApp } func setup(t *testing.T, withGenesis bool, opts ...wasmkeeper.Option) (*TerpApp, GenesisState) { @@ -151,7 +150,6 @@ func setup(t *testing.T, withGenesis bool, opts ...wasmkeeper.Option) (*TerpApp, db, nil, true, - wasmtypes.EnableAllProposals, EmptyAppOptions{}, opts, bam.SetChainID("testing"), diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 25286f5..6c441a8 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/terpnetwork/terp-core/v2/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/keepers" ) // BaseAppParamManager defines an interrace that BaseApp is expected to fullfil diff --git a/app/upgrades/v2/constants.go b/app/upgrades/v2/constants.go index d7afd4c..4f9b869 100644 --- a/app/upgrades/v2/constants.go +++ b/app/upgrades/v2/constants.go @@ -5,12 +5,12 @@ import ( icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" - feesharetypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" - globalfeetypes "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" + globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/terpnetwork/terp-core/v2/app/upgrades" + "github.com/terpnetwork/terp-core/v4/app/upgrades" ) const UpgradeName = "v2" diff --git a/app/upgrades/v2/upgrade.go b/app/upgrades/v2/upgrade.go index 885b194..25e2c37 100644 --- a/app/upgrades/v2/upgrade.go +++ b/app/upgrades/v2/upgrade.go @@ -7,18 +7,18 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - feesharetypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" - globalfeetypes "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" - "github.com/terpnetwork/terp-core/v2/app/keepers" - "github.com/terpnetwork/terp-core/v2/app/upgrades" + "github.com/terpnetwork/terp-core/v4/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/upgrades" ) // We now charge 2 million gas * gas price to create a denom. diff --git a/app/upgrades/v3/constants.go b/app/upgrades/v3/constants.go index 31b5b19..a56da57 100644 --- a/app/upgrades/v3/constants.go +++ b/app/upgrades/v3/constants.go @@ -1,7 +1,7 @@ package v3 import ( - "github.com/terpnetwork/terp-core/v2/app/upgrades" + "github.com/terpnetwork/terp-core/v4/app/upgrades" store "github.com/cosmos/cosmos-sdk/store/types" ) diff --git a/app/upgrades/v3/headstash.go b/app/upgrades/v3/headstash.go index 57c066b..bd0691c 100644 --- a/app/upgrades/v3/headstash.go +++ b/app/upgrades/v3/headstash.go @@ -10,7 +10,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/terpnetwork/terp-core/v2/app/upgrades" + "github.com/terpnetwork/terp-core/v4/app/upgrades" ) func HeadStash( diff --git a/app/upgrades/v3/upgrade.go b/app/upgrades/v3/upgrade.go index 89560fb..c88c4e7 100644 --- a/app/upgrades/v3/upgrade.go +++ b/app/upgrades/v3/upgrade.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/terpnetwork/terp-core/v2/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/keepers" ) // CreateUpgradeHandler creates an SDK upgrade handler for v2 diff --git a/app/upgrades/v4/constants.go b/app/upgrades/v4/constants.go new file mode 100644 index 0000000..9cfe900 --- /dev/null +++ b/app/upgrades/v4/constants.go @@ -0,0 +1,16 @@ +package v4 + +import ( + "github.com/terpnetwork/terp-core/v4/app/upgrades" + + store "github.com/cosmos/cosmos-sdk/store/types" +) + +// UpgradeName defines the on-chain upgrade name for the Terp v4 upgrade. +const UpgradeName = "v4" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV4UpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/v4/headstash-contract.go b/app/upgrades/v4/headstash-contract.go new file mode 100644 index 0000000..4430fc3 --- /dev/null +++ b/app/upgrades/v4/headstash-contract.go @@ -0,0 +1,80 @@ +package v4 + +import ( + "embed" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/terpnetwork/terp-core/v4/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/upgrades" +) + +//go:embed headstash_contract.wasm +var embedFs embed.FS + +func setupHeadstashContract(ctx sdk.Context, keepers *keepers.AppKeepers) error { + logger := ctx.Logger() + // set the gov module address + govModule := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName) + // define the headstash patch contract + code, err := embedFs.ReadFile("headstash_contract.wasm") + if err != nil { + return err + } + // define instantiate permissions + instantiateConfig := wasmtypes.AccessConfig{Permission: wasmtypes.AccessTypeEverybody} + contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(keepers.WasmKeeper) + // store wasm contract + codeID, _, err := contractKeeper.Create(ctx, govModule, code, &instantiateConfig) + if err != nil { + return err + } + // define claim_msg + const claimMsg = "{wallet}" + // define merkle_root string + const merkleRoot = "77fb25152b72ac67f5a155461e396b0788dd0567ec32a96f8201b899ad516b02" + // define instantiate msg + initMsgBz := []byte(fmt.Sprintf(`{ + "owner": "%s", + "claim_msg_plaintext": "%s", + "merkle_root": "%s" + }`, + govModule, claimMsg, merkleRoot)) + // instantiate contract + addr, _, err := contractKeeper.Instantiate(ctx, codeID, govModule, govModule, initMsgBz, "headstash patch contract", nil) + if err != nil { + return err + } + // format contract bytes to bech32 addr + addrStr, err := sdk.Bech32ifyAddressBytes("terp", addr) + if err != nil { + return err + } + // print results + logger.Info(fmt.Sprintf("instantiated headstash patch contract: %s", addrStr)) + + // define token denominations + nativeDenom := upgrades.GetChainsDenomToken(ctx.ChainID()) + nativeFeeDenom := upgrades.GetChainsFeeDenomToken(ctx.ChainID()) + + // define total amount of tokens per each denom + amount := int64(123456789) + terpcoins := sdk.NewCoins( + sdk.NewInt64Coin(nativeDenom, amount), + ) + thiolcoins := sdk.NewCoins( + sdk.NewInt64Coin(nativeFeeDenom, amount), + ) + // send tokens from gov module to headstash-contract + if err := keepers.DistrKeeper.DistributeFromFeePool(ctx, terpcoins, addr); err != nil { + panic(err) + } + if err := keepers.DistrKeeper.DistributeFromFeePool(ctx, thiolcoins, addr); err != nil { + panic(err) + } + return nil +} diff --git a/app/upgrades/v4/headstash-patch.go b/app/upgrades/v4/headstash-patch.go new file mode 100644 index 0000000..6d25a96 --- /dev/null +++ b/app/upgrades/v4/headstash-patch.go @@ -0,0 +1,52 @@ +package v4 + +import ( + "strconv" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + "github.com/terpnetwork/terp-core/v4/app/upgrades" + + v3 "github.com/terpnetwork/terp-core/v4/app/upgrades/v3" +) + +// revert headstash allocation by depositing funds back into community pool +func returnFundsToCommunityPool( + ctx sdk.Context, + dk distrkeeper.Keeper, +) { + headstashes := v3.GetHeadstashPayments() + total := int64(0) + + nativeDenom := upgrades.GetChainsDenomToken(ctx.ChainID()) + nativeFeeDenom := upgrades.GetChainsFeeDenomToken(ctx.ChainID()) + + for _, headstash := range headstashes { + addr, err := sdk.AccAddressFromBech32(headstash[0]) + if err != nil { + panic(err) + } + // defines the value associated with a given address + amount, err := strconv.ParseInt(strings.TrimSpace(headstash[1]), 10, 64) + if err != nil { + panic(err) + } + terpcoins := sdk.NewCoins( + sdk.NewInt64Coin(nativeDenom, amount), + ) + thiolcoins := sdk.NewCoins( + sdk.NewInt64Coin(nativeFeeDenom, amount), + ) + if err := dk.FundCommunityPool(ctx, terpcoins, addr); err != nil { + panic(err) + } + if err := dk.FundCommunityPool(ctx, thiolcoins, addr); err != nil { + panic(err) + } + total += amount + } +} + +// TODO: handle headstash-patch contract upload & instantiation diff --git a/app/upgrades/v4/headstash_contract.wasm b/app/upgrades/v4/headstash_contract.wasm new file mode 100644 index 0000000..6179525 Binary files /dev/null and b/app/upgrades/v4/headstash_contract.wasm differ diff --git a/app/upgrades/v4/upgrade.go b/app/upgrades/v4/upgrade.go new file mode 100644 index 0000000..2de7701 --- /dev/null +++ b/app/upgrades/v4/upgrade.go @@ -0,0 +1,56 @@ +package v4 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/terpnetwork/terp-core/v4/app/keepers" + "github.com/terpnetwork/terp-core/v4/app/upgrades" + "github.com/terpnetwork/terp-core/v4/x/burn" + globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" +) + +// CreateUpgradeHandler creates an SDK upgrade handler for v4 +func CreateV4UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + logger := ctx.Logger().With("upgrade", UpgradeName) + + // GlobalFee + nativeDenom := upgrades.GetChainsDenomToken(ctx.ChainID()) + nativeFeeDenom := upgrades.GetChainsFeeDenomToken(ctx.ChainID()) + minGasPrices := sdk.DecCoins{ + // 0.0025uterp + sdk.NewDecCoinFromDec(nativeDenom, sdk.NewDecWithPrec(25, 4)), + // 0.05uthiol + sdk.NewDecCoinFromDec(nativeFeeDenom, sdk.NewDecWithPrec(5, 2)), + } + newGlobalFeeParams := globalfeetypes.Params{ + MinimumGasPrices: minGasPrices, + } + if err := keepers.GlobalFeeKeeper.SetParams(ctx, newGlobalFeeParams); err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("upgraded global fee params to %s", minGasPrices)) + + // revert headstash allocation + returnFundsToCommunityPool(ctx, keepers.DistrKeeper) + + // print the burn module address + burnModule := keepers.AccountKeeper.GetModuleAddress(burn.ModuleName) + logger.Info(fmt.Sprintf("burn module address %s", burnModule)) + + // deployment & instantiation of headstash patch contract + if err := setupHeadstashContract(ctx, keepers); err != nil { + return nil, err + } + + return vm, nil + } +} diff --git a/cmd/terpd/cmd/balances_from_state_export.go b/cmd/terpd/cmd/balances_from_state_export.go index 2033484..facc5ba 100644 --- a/cmd/terpd/cmd/balances_from_state_export.go +++ b/cmd/terpd/cmd/balances_from_state_export.go @@ -23,7 +23,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - appparams "github.com/terpnetwork/terp-core/v2/app/params" + appparams "github.com/terpnetwork/terp-core/v4/app/params" ) const ( diff --git a/cmd/terpd/cmd/root.go b/cmd/terpd/cmd/root.go index 0735e58..fd0c948 100644 --- a/cmd/terpd/cmd/root.go +++ b/cmd/terpd/cmd/root.go @@ -39,8 +39,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/terpnetwork/terp-core/v2/app" - "github.com/terpnetwork/terp-core/v2/app/params" + "github.com/terpnetwork/terp-core/v4/app" + "github.com/terpnetwork/terp-core/v4/app/params" ) // NewRootCmd creates a new root command for terpd. It is called once in the @@ -324,7 +324,6 @@ func (ac appCreator) newApp( db, traceStore, loadLatest, - app.GetEnabledProposals(), appOpts, wasmOpts, baseappOptions..., @@ -363,7 +362,6 @@ func (ac appCreator) appExport( db, traceStore, height == -1, - app.GetEnabledProposals(), appOpts, emptyWasmOpts, ) diff --git a/cmd/terpd/main.go b/cmd/terpd/main.go index 846d63b..6adaa50 100644 --- a/cmd/terpd/main.go +++ b/cmd/terpd/main.go @@ -7,8 +7,8 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/terpnetwork/terp-core/v2/app" - "github.com/terpnetwork/terp-core/v2/cmd/terpd/cmd" + "github.com/terpnetwork/terp-core/v4/app" + "github.com/terpnetwork/terp-core/v4/cmd/terpd/cmd" ) func main() { diff --git a/draft_proposal.json b/draft_proposal.json deleted file mode 100644 index 24692a6..0000000 --- a/draft_proposal.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "messages": [ - { - "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", - "authority": "terp10d07y265gmmuvt4z0w9aw880jnsr700jag6fuq", - "plan": { - "name": "v3", - "time": "0001-01-01T00:00:00Z", - "height": "20", - "info": "", - "upgraded_client_state": null - } - } - ], - "metadata": "ipfs://CID", - "deposit": "1000000000uterp", - "title": "v3", - "summary": "test" - } - diff --git a/go.mod b/go.mod index f83c601..7825f31 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module github.com/terpnetwork/terp-core/v2 +module github.com/terpnetwork/terp-core/v4 go 1.19 require ( - github.com/CosmWasm/wasmd v0.42.0 - github.com/CosmWasm/wasmvm v1.4.0 + github.com/CosmWasm/wasmd v0.43.0 + github.com/CosmWasm/wasmvm v1.5.0 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 @@ -21,7 +21,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.16.0 + github.com/prometheus/client_golang v1.17.0 github.com/rakyll/statik v0.1.7 // indirect github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa github.com/spf13/cast v1.5.1 @@ -149,9 +149,9 @@ require ( github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect diff --git a/go.sum b/go.sum index b4790be..998cc59 100644 --- a/go.sum +++ b/go.sum @@ -211,10 +211,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmd v0.42.0 h1:4xZ7GHLrJp3P8qN0wsWOpk5qYLHW9AM5fgcDFPi/p90= -github.com/CosmWasm/wasmd v0.42.0/go.mod h1:DiEyBjHxzkEENYqQhHyka+r4HfR72stSPUtGv+Yh/UU= -github.com/CosmWasm/wasmvm v1.4.0 h1:84I3MlvvzcOo2z+ed0ztPi7eeDNk6/sYuK76uyXP1nI= -github.com/CosmWasm/wasmvm v1.4.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/CosmWasm/wasmd v0.43.0 h1:4xQAiNf6Ej+TuYe4PXwrtVJ9C+xyFrbsdqHH/kU9Vxk= +github.com/CosmWasm/wasmd v0.43.0/go.mod h1:gpri8YvkRErBz+qDme5jOThGZmSlHfyN532bWibXOl4= +github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= +github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= @@ -843,32 +843,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1170,7 +1170,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/interchaintest/chain_upgrade_test.go b/interchaintest/chain_upgrade_test.go index 268044d..54af505 100644 --- a/interchaintest/chain_upgrade_test.go +++ b/interchaintest/chain_upgrade_test.go @@ -1,5 +1,7 @@ package interchaintest +// notice: upgrade v4 will return error, as headstash accounts in v3 upgrade do not have balance during ictests. + import ( "context" "fmt" @@ -24,8 +26,8 @@ const ( func TestBasicTerpUpgrade(t *testing.T) { repo, version := GetDockerImageInfo() - startVersion := "v2.0.0" - upgradeName := "v3" + startVersion := "v3.0.0" + upgradeName := "v4.0.0" CosmosChainUpgradeTest(t, "terp", startVersion, version, repo, upgradeName) } diff --git a/interchaintest/contracts/clock_example.wasm b/interchaintest/contracts/clock_example.wasm new file mode 100644 index 0000000..cb3f083 Binary files /dev/null and b/interchaintest/contracts/clock_example.wasm differ diff --git a/interchaintest/contracts/cw_testburn.wasm b/interchaintest/contracts/cw_testburn.wasm new file mode 100644 index 0000000..4b47f36 Binary files /dev/null and b/interchaintest/contracts/cw_testburn.wasm differ diff --git a/interchaintest/go.mod b/interchaintest/go.mod index 2137e13..400df6a 100644 --- a/interchaintest/go.mod +++ b/interchaintest/go.mod @@ -10,20 +10,20 @@ replace ( github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 //indirect github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // For this nested module, you always want to replace the parent reference with the current worktree. - github.com/terpnetwork/terp-core/v2 => ../ + github.com/terpnetwork/terp-core/v4 => ../ github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 ) require ( - github.com/CosmWasm/wasmd v0.42.0 + github.com/CosmWasm/wasmd v0.43.0 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.3.0 github.com/docker/docker v24.0.4+incompatible github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230721183422-fb937bb0e165 github.com/stretchr/testify v1.8.4 - github.com/terpnetwork/terp-core/v2 v2.0.0-00010101000000-000000000000 + github.com/terpnetwork/terp-core/v4 v4.0.0-00010101000000-000000000000 go.uber.org/zap v1.24.0 ) @@ -47,7 +47,7 @@ require ( github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 // indirect - github.com/CosmWasm/wasmvm v1.4.0 // indirect + github.com/CosmWasm/wasmvm v1.5.0 // indirect github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect github.com/Microsoft/go-winio v0.6.0 // indirect @@ -183,10 +183,10 @@ require ( github.com/pierrec/xxHash v0.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect diff --git a/interchaintest/go.sum b/interchaintest/go.sum index 57d5977..5318d66 100644 --- a/interchaintest/go.sum +++ b/interchaintest/go.sum @@ -219,10 +219,10 @@ github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRr github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 h1:oknQF/iIhf5lVjbwjsVDzDByupRhga8nhA3NAmwyHDA= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420/go.mod h1:KYkiMX5AbOlXXYfxkrYPrRPV6EbVUALTQh5ptUOJzu8= -github.com/CosmWasm/wasmd v0.42.0 h1:4xZ7GHLrJp3P8qN0wsWOpk5qYLHW9AM5fgcDFPi/p90= -github.com/CosmWasm/wasmd v0.42.0/go.mod h1:DiEyBjHxzkEENYqQhHyka+r4HfR72stSPUtGv+Yh/UU= -github.com/CosmWasm/wasmvm v1.4.0 h1:84I3MlvvzcOo2z+ed0ztPi7eeDNk6/sYuK76uyXP1nI= -github.com/CosmWasm/wasmvm v1.4.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/CosmWasm/wasmd v0.43.0 h1:4xQAiNf6Ej+TuYe4PXwrtVJ9C+xyFrbsdqHH/kU9Vxk= +github.com/CosmWasm/wasmd v0.43.0/go.mod h1:gpri8YvkRErBz+qDme5jOThGZmSlHfyN532bWibXOl4= +github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= +github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc= github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw= @@ -916,32 +916,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= diff --git a/interchaintest/helpers/query_helpers.go b/interchaintest/helpers/query_helpers.go index 511cd7e..e707991 100644 --- a/interchaintest/helpers/query_helpers.go +++ b/interchaintest/helpers/query_helpers.go @@ -15,10 +15,9 @@ func GetUserTokenFactoryBalances(t *testing.T, ctx context.Context, chain *cosmo return res } -func GetUnityContractWithdrawalReadyTime(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, contract string) WithdrawalTimestampResponse { - // terpd query wasm contract-state smart '{"get_withdrawal_ready_time":{}}' --output json - var res WithdrawalTimestampResponse - err := chain.QueryContract(ctx, contract, QueryMsg{GetWithdrawalReadyTime: &struct{}{}}, &res) +func GetClockContractValue(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, contract string) ClockContractResponse { + var res ClockContractResponse + err := chain.QueryContract(ctx, contract, QueryMsg{GetConfig: &struct{}{}}, &res) require.NoError(t, err) return res } diff --git a/interchaintest/helpers/tokenfactory.go b/interchaintest/helpers/tokenfactory.go index a7723e8..bd39930 100644 --- a/interchaintest/helpers/tokenfactory.go +++ b/interchaintest/helpers/tokenfactory.go @@ -9,7 +9,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" diff --git a/interchaintest/helpers/types.go b/interchaintest/helpers/types.go index d3d49d7..4181725 100644 --- a/interchaintest/helpers/types.go +++ b/interchaintest/helpers/types.go @@ -76,3 +76,10 @@ type GetCountResponse struct { type GetCountObj struct { Count int64 `json:"count"` } + +type ClockContractResponse struct { + Data *ClockContractObj `json:"data"` +} +type ClockContractObj struct { + Val uint32 `json:"val"` +} diff --git a/interchaintest/module_burn_test.go b/interchaintest/module_burn_test.go new file mode 100644 index 0000000..936eeaf --- /dev/null +++ b/interchaintest/module_burn_test.go @@ -0,0 +1,59 @@ +package interchaintest + +import ( + "fmt" + "strconv" + "testing" + + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/stretchr/testify/assert" + + helpers "github.com/terpnetwork/terp-core/tests/interchaintest/helpers" +) + +// TestTerpBurnModule ensures the terpburn module register and execute sharing functions work properly on smart contracts. +// It is purely for developers ::BurnTokens to function as expected. +func TestTerpBurnModule(t *testing.T) { + t.Parallel() + + // Base setup + chains := CreateThisBranchChain(t, 1, 0) + ic, ctx, _, _ := BuildInitialChain(t, chains) + + // Chains + terp := chains[0].(*cosmos.CosmosChain) + + nativeDenom := terp.Config().Denom + + // Users + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(10_000_000), terp, terp) + user := users[0] + + // Upload & init contract + _, contractAddr := helpers.SetupContract(t, ctx, terp, user.KeyName(), "contracts/cw_testburn.wasm", `{}`) + + // get balance before execute + balance, err := terp.GetBalance(ctx, user.FormattedAddress(), nativeDenom) + if err != nil { + t.Fatal(err) + } + + // execute burn of tokens + burnAmt := int64(1_000_000) + helpers.ExecuteMsgWithAmount(t, ctx, terp, user, contractAddr, strconv.Itoa(int(burnAmt))+nativeDenom, `{"burn_token":{}}`) + + // verify it is down 1_000_000 tokens since the burn + updatedBal, err := terp.GetBalance(ctx, user.FormattedAddress(), nativeDenom) + if err != nil { + t.Fatal(err) + } + + // Verify the funds were sent, and burned. + fmt.Println(balance, updatedBal) + assert.Equal(t, burnAmt, balance-updatedBal, fmt.Sprintf("balance should be %d less than updated balance", burnAmt)) + + t.Cleanup(func() { + _ = ic.Close() + }) +} diff --git a/interchaintest/module_clock_test.go b/interchaintest/module_clock_test.go new file mode 100644 index 0000000..1b2e566 --- /dev/null +++ b/interchaintest/module_clock_test.go @@ -0,0 +1,85 @@ +package interchaintest + +// import ( +// "context" +// "fmt" +// "testing" + +// cosmosproto "github.com/cosmos/gogoproto/proto" +// "github.com/strangelove-ventures/interchaintest/v7" +// "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" +// "github.com/strangelove-ventures/interchaintest/v7/ibc" +// "github.com/strangelove-ventures/interchaintest/v7/testutil" +// "github.com/stretchr/testify/require" +// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types" + +// helpers "github.com/terpnetwork/terp-core/tests/interchaintest/helpers" +// ) + +// // TestJunoClock ensures the clock module auto executes allowed contracts. +// func TestTerpClock(t *testing.T) { +// t.Parallel() + +// cfg := terpConfig + +// // Base setup +// chains := CreateChainWithCustomConfig(t, 1, 0, cfg) +// ic, ctx, _, _ := BuildInitialChain(t, chains) + +// // Chains +// terp := chains[0].(*cosmos.CosmosChain) + +// // Users +// users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(10_000_000_000), terp, terp) +// user := users[0] + +// // Upload & init contract payment to another address +// _, contractAddr := helpers.SetupContract(t, ctx, terp, user.KeyName(), "contracts/clock_example.wasm", `{}`) + +// // Ensure config is 0 +// res := helpers.GetClockContractValue(t, ctx, terp, contractAddr) +// fmt.Printf("- res: %v\n", res.Data.Val) +// require.Equal(t, uint32(0), res.Data.Val) + +// // Submit the proposal to add it to the allowed contracts list +// SubmitParamChangeProp(t, ctx, terp, user, []string{contractAddr}) + +// // Wait 1 block +// _ = testutil.WaitForBlocks(ctx, 1, terp) + +// // Validate the contract is now auto incrementing from the end blocker +// res = helpers.GetClockContractValue(t, ctx, terp, contractAddr) +// fmt.Printf("- res: %v\n", res.Data.Val) +// require.GreaterOrEqual(t, res.Data.Val, uint32(1)) + +// t.Cleanup(func() { +// _ = ic.Close() +// }) +// } + +// func SubmitParamChangeProp(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, contracts []string) string { +// govAcc := "terp10d07y265gmmuvt4z0w9aw880jnsr700jag6fuq" +// updateParams := []cosmosproto.Message{ +// &clocktypes.MsgUpdateParams{ +// Authority: govAcc, +// Params: clocktypes.NewParams(contracts, 1_000_000_000), +// }, +// } + +// proposal, err := chain.BuildProposal(updateParams, "Params Add Contract", "params", "ipfs://CID", fmt.Sprintf(`500000000%s`, chain.Config().Denom)) +// require.NoError(t, err, "error building proposal") + +// txProp, err := chain.SubmitProposal(ctx, user.KeyName(), proposal) +// t.Log("txProp", txProp) +// require.NoError(t, err, "error submitting proposal") + +// height, _ := chain.Height(ctx) + +// err = chain.VoteOnProposalAllValidators(ctx, txProp.ProposalID, cosmos.ProposalVoteYes) +// require.NoError(t, err, "failed to submit votes") + +// _, err = cosmos.PollForProposalStatus(ctx, chain, height, height+haltHeightDelta, txProp.ProposalID, cosmos.ProposalStatusPassed) +// require.NoError(t, err, "proposal status did not change to passed in expected number of blocks") + +// return txProp.ProposalID +// } diff --git a/interchaintest/setup.go b/interchaintest/setup.go index 016b865..ea479a8 100644 --- a/interchaintest/setup.go +++ b/interchaintest/setup.go @@ -7,17 +7,19 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" ibclocalhost "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost" - "github.com/docker/docker/client" - interchaintest "github.com/strangelove-ventures/interchaintest/v7" "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/strangelove-ventures/interchaintest/v7/testreporter" - "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" + // clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types" + feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" testutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) @@ -78,6 +80,10 @@ var ( genesisWalletAmount = int64(10_000_000) ) +func init() { + sdk.GetConfig().SetBech32PrefixForAccount("terp", "terp") +} + // terpEncoding registers the Terp specific module codecs so that the associated types and msgs // will be supported when writing to the blocksdb sqlite database. func terpEncoding() *testutil.TestEncodingConfig { @@ -86,6 +92,9 @@ func terpEncoding() *testutil.TestEncodingConfig { // register custom types ibclocalhost.RegisterInterfaces(cfg.InterfaceRegistry) wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry) + feesharetypes.RegisterInterfaces(cfg.InterfaceRegistry) + tokenfactorytypes.RegisterInterfaces(cfg.InterfaceRegistry) + // clocktypes.RegisterInterfaces(cfg.InterfaceRegistry) // github.com/cosmos/cosmos-sdk/types/module/testutil @@ -119,6 +128,26 @@ func CreateThisBranchChain(t *testing.T, numVals, numFull int) []ibc.Chain { return chains } +func CreateChainWithCustomConfig(t *testing.T, numVals, numFull int, config ibc.ChainConfig) []ibc.Chain { + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + { + Name: "terp", + ChainName: "terpnetwork", + Version: config.Images[0].Version, + ChainConfig: config, + NumValidators: &numVals, + NumFullNodes: &numFull, + }, + }) + + // Get chains from the chain factory + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + // chain := chains[0].(*cosmos.CosmosChain) + return chains +} + func BuildInitialChain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, context.Context, *client.Client, string) { // Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use ic := interchaintest.NewInterchain() diff --git a/interchaintest/state_sync_test.go b/interchaintest/state_sync_test.go new file mode 100644 index 0000000..04017a1 --- /dev/null +++ b/interchaintest/state_sync_test.go @@ -0,0 +1,83 @@ +package interchaintest + +import ( + "context" + "encoding/hex" + "fmt" + "testing" + "time" + + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" +) + +const stateSyncSnapshotInterval = 10 + +func TestTerpStateSync(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + + t.Parallel() + + configFileOverrides := make(map[string]any) + appTomlOverrides := make(testutil.Toml) + + // state sync snapshots every stateSyncSnapshotInterval blocks. + stateSync := make(testutil.Toml) + stateSync["snapshot-interval"] = stateSyncSnapshotInterval + appTomlOverrides["state-sync"] = stateSync + + // state sync snapshot interval must be a multiple of pruning keep every interval. + appTomlOverrides["pruning"] = "custom" + appTomlOverrides["pruning-keep-recent"] = stateSyncSnapshotInterval + appTomlOverrides["pruning-keep-every"] = stateSyncSnapshotInterval + appTomlOverrides["pruning-interval"] = stateSyncSnapshotInterval + + configFileOverrides["config/app.toml"] = appTomlOverrides + + // Setup + chains := CreateThisBranchChain(t, 1, 1) + _, ctx, _, _ := BuildInitialChain(t, chains) + + chain := chains[0].(*cosmos.CosmosChain) + + // Wait for blocks so that nodes have a few state sync snapshot available + require.NoError(t, testutil.WaitForBlocks(ctx, stateSyncSnapshotInterval*2, chain)) + + latestHeight, err := chain.Height(ctx) + require.NoError(t, err, "failed to fetch latest chain height") + + // Trusted height should be state sync snapshot interval blocks ago. + trustHeight := int64(latestHeight) - stateSyncSnapshotInterval + + firstFullNode := chain.FullNodes[0] + + // Fetch block hash for trusted height. + blockRes, err := firstFullNode.Client.Block(ctx, &trustHeight) + require.NoError(t, err, "failed to fetch trusted block") + trustHash := hex.EncodeToString(blockRes.BlockID.Hash) + + // Construct statesync parameters for new node to get in sync. + configFileOverrides = make(map[string]any) + configTomlOverrides := make(testutil.Toml) + + // Set trusted parameters and rpc servers for verification. + stateSync = make(testutil.Toml) + stateSync["trust_hash"] = trustHash + stateSync["trust_height"] = trustHeight + // State sync requires minimum of two RPC servers for verification. We can provide the same RPC twice though. + stateSync["rpc_servers"] = fmt.Sprintf("tcp://%s:26657,tcp://%s:26657", firstFullNode.HostName(), firstFullNode.HostName()) + configTomlOverrides["statesync"] = stateSync + + configFileOverrides["config/config.toml"] = configTomlOverrides + + // Now that nodes are providing state sync snapshots, state sync a new node. + require.NoError(t, chain.AddFullNodes(ctx, configFileOverrides, 1)) + + // Wait for new node to be in sync. + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + require.NoError(t, testutil.WaitForInSync(ctx, chain, chain.FullNodes[len(chain.FullNodes)-1])) +} diff --git a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index 347e53c..95f7abb 100644 --- a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto +++ b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -4,7 +4,7 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"; // DenomAuthorityMetadata specifies metadata for addresses that have specific // capabilities over a token factory denom. Right now there is only one Admin diff --git a/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/proto/osmosis/tokenfactory/v1beta1/genesis.proto index 39147b1..fac2f90 100644 --- a/proto/osmosis/tokenfactory/v1beta1/genesis.proto +++ b/proto/osmosis/tokenfactory/v1beta1/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "osmosis/tokenfactory/v1beta1/params.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"; // GenesisState defines the tokenfactory module's genesis state. message GenesisState { diff --git a/proto/osmosis/tokenfactory/v1beta1/params.proto b/proto/osmosis/tokenfactory/v1beta1/params.proto index 1eef2b7..0e82a24 100644 --- a/proto/osmosis/tokenfactory/v1beta1/params.proto +++ b/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -6,7 +6,7 @@ import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"; // Params defines the parameters for the tokenfactory module. message Params { diff --git a/proto/osmosis/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto index d4e93bf..f18e179 100644 --- a/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -7,7 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "osmosis/tokenfactory/v1beta1/params.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/osmosis/tokenfactory/v1beta1/tx.proto b/proto/osmosis/tokenfactory/v1beta1/tx.proto index 7f40114..b859f42 100644 --- a/proto/osmosis/tokenfactory/v1beta1/tx.proto +++ b/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -8,7 +8,7 @@ import "osmosis/tokenfactory/v1beta1/params.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { diff --git a/proto/terp/clock/v1/genesis.proto b/proto/terp/clock/v1/genesis.proto new file mode 100644 index 0000000..7e66137 --- /dev/null +++ b/proto/terp/clock/v1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package terp.clock.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/terpnetwork/terp-core/x/clock/types"; + +// GenesisState - initial state of module +message GenesisState { + // Params of this module + Params params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "params,omitempty" + ]; +} + +// Params defines the set of module parameters. +message Params { + // contract_addresses stores the list of executable contracts to be ticked on every block. + repeated string contract_addresses = 1 [ + (gogoproto.jsontag) = "contract_addresses,omitempty", + (gogoproto.moretags) = "yaml:\"contract_addresses\"" + ]; + + uint64 contract_gas_limit = 2 [ + (gogoproto.jsontag) = "contract_gas_limit,omitempty", + (gogoproto.moretags) = "yaml:\"contract_gas_limit\"" + ]; +} diff --git a/proto/terp/clock/v1/query.proto b/proto/terp/clock/v1/query.proto new file mode 100644 index 0000000..db0485a --- /dev/null +++ b/proto/terp/clock/v1/query.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package terp.clock.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "terp/clock/v1/genesis.proto"; + +option go_package = "github.com/terpnetwork/terp-core/x/clock/types"; + +// Query defines the gRPC querier service. +service Query { + // ClockContracts + rpc ClockContracts(QueryClockContracts) + returns (QueryClockContractsResponse) { + option (google.api.http).get = + "/terp/clock/v1/contracts"; + } + // Params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/terp/clock/v1/params"; + } +} + +// QueryClockContracts is the request type to get all contracts. +message QueryClockContracts {} + +// QueryClockContractsResponse is the response type for the Query/ClockContracts RPC method. +message QueryClockContractsResponse { + repeated string contract_addresses = 1 [ + (gogoproto.jsontag) = "contract_addresses,omitempty", + (gogoproto.moretags) = "yaml:\"contract_addresses\"" + ]; +} + +// QueryParams is the request type to get all module params. +message QueryParamsRequest {} + +// QueryClockContractsResponse is the response type for the Query/ClockContracts RPC method. +message QueryParamsResponse { + Params params = 1 [(gogoproto.jsontag) = "params", (gogoproto.moretags) = "yaml:\"params\""]; +} diff --git a/proto/terp/clock/v1/tx.proto b/proto/terp/clock/v1/tx.proto new file mode 100644 index 0000000..6b1bf02 --- /dev/null +++ b/proto/terp/clock/v1/tx.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package terp.clock.v1; + +option go_package = "github.com/terpnetwork/terp-core/x/clock/types"; + +import "cosmos/msg/v1/msg.proto"; +import "terp/clock/v1/genesis.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// Msg defines the Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/clock module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/clock parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/terp/feeshare/v1/feeshare.proto b/proto/terp/feeshare/v1/feeshare.proto index 1d7f9a8..046ac8e 100644 --- a/proto/terp/feeshare/v1/feeshare.proto +++ b/proto/terp/feeshare/v1/feeshare.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package terp.feeshare.v1; -option go_package = "github.com/terpnetwork/terp-core/v2/x/feeshare/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/feeshare/types"; // FeeShare defines an instance that organizes fee distribution conditions for // the owner of a given smart contract diff --git a/proto/terp/feeshare/v1/genesis.proto b/proto/terp/feeshare/v1/genesis.proto index da635c4..b7d64ee 100644 --- a/proto/terp/feeshare/v1/genesis.proto +++ b/proto/terp/feeshare/v1/genesis.proto @@ -3,7 +3,7 @@ package terp.feeshare.v1; import "terp/feeshare/v1/feeshare.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/feeshare/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/feeshare/types"; // GenesisState defines the module's genesis state. message GenesisState { diff --git a/proto/terp/feeshare/v1/query.proto b/proto/terp/feeshare/v1/query.proto index 7200378..7295e12 100644 --- a/proto/terp/feeshare/v1/query.proto +++ b/proto/terp/feeshare/v1/query.proto @@ -7,7 +7,7 @@ import "terp/feeshare/v1/feeshare.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/feeshare/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/feeshare/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/terp/feeshare/v1/tx.proto b/proto/terp/feeshare/v1/tx.proto index af279bb..e8b51ae 100644 --- a/proto/terp/feeshare/v1/tx.proto +++ b/proto/terp/feeshare/v1/tx.proto @@ -7,7 +7,7 @@ import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "terp/feeshare/v1/genesis.proto"; -option go_package = "github.com/terpnetwork/terp-core/v2/x/feeshare/types"; +option go_package = "github.com/terpnetwork/terp-core/v4/x/feeshare/types"; // Msg defines the fees Msg service. service Msg { diff --git a/x/burn/README.md b/x/burn/README.md new file mode 100644 index 0000000..dab52c3 --- /dev/null +++ b/x/burn/README.md @@ -0,0 +1,7 @@ +# x/burn + +This is a 'module' used solely to burn tokens properly in line with our x/mint module requirements. + +## Burn address + +- diff --git a/x/burn/burner.go b/x/burn/burner.go new file mode 100644 index 0000000..97ce3a5 --- /dev/null +++ b/x/burn/burner.go @@ -0,0 +1,50 @@ +package burn + +import ( + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" +) + +// used to override Wasmd's NewBurnCoinMessageHandler + +type BurnerWasmPlugin struct { + bk bankkeeper.Keeper + mk mintkeeper.Keeper +} + +var _ wasmtypes.Burner = &BurnerWasmPlugin{} + +func NewBurnerPlugin(bk bankkeeper.Keeper, mk mintkeeper.Keeper) *BurnerWasmPlugin { + return &BurnerWasmPlugin{bk: bk, mk: mk} +} + +func (k *BurnerWasmPlugin) BurnCoins(ctx sdk.Context, _ string, amt sdk.Coins) error { + // first, try to burn the coins on bank module + err := k.bk.BurnCoins(ctx, ModuleName, amt) + if err != nil { + return err + } + + // get mint params + // params := k.mk.GetParams(ctx) + + // // loop the burned coins + // for _, amount := range amt { + // // if we are burning mint denom, reduce the target staking supply + // if amount.Denom == params.MintDenom { + // if err := k.mk.ReduceTargetSupply(ctx, amount); err != nil { + // return err + // } + // } + // } + + return nil +} + +func (k *BurnerWasmPlugin) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, _ string, amt sdk.Coins) error { + return k.bk.SendCoinsFromAccountToModule(ctx, senderAddr, ModuleName, amt) +} diff --git a/x/burn/constants.go b/x/burn/constants.go new file mode 100644 index 0000000..8dc829f --- /dev/null +++ b/x/burn/constants.go @@ -0,0 +1,5 @@ +package burn + +const ( + ModuleName = "burner" +) diff --git a/x/feeshare/ante/ante.go b/x/feeshare/ante/ante.go index e871059..b8b2d41 100644 --- a/x/feeshare/ante/ante.go +++ b/x/feeshare/ante/ante.go @@ -9,7 +9,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - feeshare "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + feeshare "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // FeeSharePayoutDecorator Run his after we already deduct the fee from the account with diff --git a/x/feeshare/ante/ante_test.go b/x/feeshare/ante/ante_test.go index 321110a..7acb8c7 100644 --- a/x/feeshare/ante/ante_test.go +++ b/x/feeshare/ante/ante_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - ante "github.com/terpnetwork/terp-core/v2/x/feeshare/ante" + ante "github.com/terpnetwork/terp-core/v4/x/feeshare/ante" ) type AnteTestSuite struct { diff --git a/x/feeshare/ante/expected_keepers.go b/x/feeshare/ante/expected_keepers.go index 438c33b..981069b 100644 --- a/x/feeshare/ante/expected_keepers.go +++ b/x/feeshare/ante/expected_keepers.go @@ -5,7 +5,7 @@ package ante import ( sdk "github.com/cosmos/cosmos-sdk/types" - revtypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + revtypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) type BankKeeper interface { diff --git a/x/feeshare/client/cli/query.go b/x/feeshare/client/cli/query.go index fb5dc3c..cecc59f 100644 --- a/x/feeshare/client/cli/query.go +++ b/x/feeshare/client/cli/query.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/feeshare/client/cli/tx.go b/x/feeshare/client/cli/tx.go index e0b4dbd..28440cf 100644 --- a/x/feeshare/client/cli/tx.go +++ b/x/feeshare/client/cli/tx.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // NewTxCmd returns a root CLI command handler for certain modules/FeeShare diff --git a/x/feeshare/genesis.go b/x/feeshare/genesis.go index bae421b..49f0697 100644 --- a/x/feeshare/genesis.go +++ b/x/feeshare/genesis.go @@ -3,8 +3,8 @@ package feeshare import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/keeper" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // InitGenesis import module genesis diff --git a/x/feeshare/genesis_test.go b/x/feeshare/genesis_test.go index 33e20ca..dcf19e0 100644 --- a/x/feeshare/genesis_test.go +++ b/x/feeshare/genesis_test.go @@ -10,9 +10,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/app" - "github.com/terpnetwork/terp-core/v2/x/feeshare" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/app" + "github.com/terpnetwork/terp-core/v4/x/feeshare" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) type GenesisTestSuite struct { diff --git a/x/feeshare/integration_test.go b/x/feeshare/integration_test.go index 27e6460..3ecc9b8 100644 --- a/x/feeshare/integration_test.go +++ b/x/feeshare/integration_test.go @@ -6,7 +6,6 @@ import ( "testing" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" @@ -21,7 +20,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/mint/types" - terpapp "github.com/terpnetwork/terp-core/v2/app" + terpapp "github.com/terpnetwork/terp-core/v4/app" ) // returns context and an app with updated mint keeper @@ -79,7 +78,6 @@ func GenApp(t *testing.T, withGenesis bool, opts ...wasmkeeper.Option) (*terpapp db, nil, true, - wasmtypes.EnableAllProposals, simtestutil.EmptyAppOptions{}, opts, bam.SetChainID("testing"), diff --git a/x/feeshare/keeper/feeshare.go b/x/feeshare/keeper/feeshare.go index 0ccbe9a..443d569 100644 --- a/x/feeshare/keeper/feeshare.go +++ b/x/feeshare/keeper/feeshare.go @@ -4,7 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // GetFeeShares returns all registered FeeShares. diff --git a/x/feeshare/keeper/grpc_query.go b/x/feeshare/keeper/grpc_query.go index 67be214..9f0d92a 100644 --- a/x/feeshare/keeper/grpc_query.go +++ b/x/feeshare/keeper/grpc_query.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) var _ types.QueryServer = Querier{} diff --git a/x/feeshare/keeper/grpc_query_test.go b/x/feeshare/keeper/grpc_query_test.go index 9cc2183..4813f8a 100644 --- a/x/feeshare/keeper/grpc_query_test.go +++ b/x/feeshare/keeper/grpc_query_test.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/terpnetwork/terp-core/v2/testutil/nullify" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/testutil/nullify" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) func (s *IntegrationTestSuite) TestFeeShares() { diff --git a/x/feeshare/keeper/keeper.go b/x/feeshare/keeper/keeper.go index 04e3df6..fc673f8 100644 --- a/x/feeshare/keeper/keeper.go +++ b/x/feeshare/keeper/keeper.go @@ -11,7 +11,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - revtypes "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + revtypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // Keeper of this module maintains collections of feeshares for contracts diff --git a/x/feeshare/keeper/keeper_test.go b/x/feeshare/keeper/keeper_test.go index 0b0f012..2042507 100644 --- a/x/feeshare/keeper/keeper_test.go +++ b/x/feeshare/keeper/keeper_test.go @@ -14,9 +14,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/terpnetwork/terp-core/v2/app" - "github.com/terpnetwork/terp-core/v2/x/feeshare/keeper" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/app" + "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // BankKeeper defines the expected interface needed to retrieve account balances. diff --git a/x/feeshare/keeper/migrator.go b/x/feeshare/keeper/migrator.go index 77b9e72..cbadaac 100644 --- a/x/feeshare/keeper/migrator.go +++ b/x/feeshare/keeper/migrator.go @@ -3,8 +3,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/exported" - v2 "github.com/terpnetwork/terp-core/v2/x/feeshare/migrations/v2" + "github.com/terpnetwork/terp-core/v4/x/feeshare/exported" + v2 "github.com/terpnetwork/terp-core/v4/x/feeshare/migrations/v2" ) // Migrator is a struct for handling in-place state migrations. diff --git a/x/feeshare/keeper/msg_server.go b/x/feeshare/keeper/msg_server.go index c5d8474..78d596b 100644 --- a/x/feeshare/keeper/msg_server.go +++ b/x/feeshare/keeper/msg_server.go @@ -11,7 +11,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) var _ types.MsgServer = &Keeper{} diff --git a/x/feeshare/keeper/msg_server_test.go b/x/feeshare/keeper/msg_server_test.go index 9b145d9..44f3227 100644 --- a/x/feeshare/keeper/msg_server_test.go +++ b/x/feeshare/keeper/msg_server_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) //go:embed testdata/reflect.wasm diff --git a/x/feeshare/keeper/params.go b/x/feeshare/keeper/params.go index 3b6f3c5..35a0d7d 100644 --- a/x/feeshare/keeper/params.go +++ b/x/feeshare/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // GetParams returns the total set of fees parameters. diff --git a/x/feeshare/migrations/v2/migrate.go b/x/feeshare/migrations/v2/migrate.go index 3aa51cc..1d2da98 100644 --- a/x/feeshare/migrations/v2/migrate.go +++ b/x/feeshare/migrations/v2/migrate.go @@ -4,8 +4,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/feeshare/exported" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/exported" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) const ( diff --git a/x/feeshare/migrations/v2/migrate_test.go b/x/feeshare/migrations/v2/migrate_test.go index 18095a4..d7838a1 100644 --- a/x/feeshare/migrations/v2/migrate_test.go +++ b/x/feeshare/migrations/v2/migrate_test.go @@ -9,10 +9,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/terpnetwork/terp-core/v2/x/feeshare" - "github.com/terpnetwork/terp-core/v2/x/feeshare/exported" - v2 "github.com/terpnetwork/terp-core/v2/x/feeshare/migrations/v2" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare" + "github.com/terpnetwork/terp-core/v4/x/feeshare/exported" + v2 "github.com/terpnetwork/terp-core/v4/x/feeshare/migrations/v2" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) type mockSubspace struct { diff --git a/x/feeshare/module.go b/x/feeshare/module.go index b9735a0..571f79a 100644 --- a/x/feeshare/module.go +++ b/x/feeshare/module.go @@ -19,10 +19,10 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/terpnetwork/terp-core/v2/x/feeshare/client/cli" - "github.com/terpnetwork/terp-core/v2/x/feeshare/exported" - "github.com/terpnetwork/terp-core/v2/x/feeshare/keeper" - "github.com/terpnetwork/terp-core/v2/x/feeshare/types" + "github.com/terpnetwork/terp-core/v4/x/feeshare/client/cli" + "github.com/terpnetwork/terp-core/v4/x/feeshare/exported" + "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper" + "github.com/terpnetwork/terp-core/v4/x/feeshare/types" ) // type check to ensure the interface is properly implemented diff --git a/x/globalfee/alias.go b/x/globalfee/alias.go index 3a16d3a..3ddb388 100644 --- a/x/globalfee/alias.go +++ b/x/globalfee/alias.go @@ -1,7 +1,7 @@ package globalfee import ( - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) const ( diff --git a/x/globalfee/ante/antetest/fee_test_setup.go.archive b/x/globalfee/ante/antetest/fee_test_setup.go.archive index b504011..2f926c0 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go.archive +++ b/x/globalfee/ante/antetest/fee_test_setup.go.archive @@ -17,9 +17,9 @@ import ( "github.com/terpnetwork/terp-core/app" appparams "github.com/terpnetwork/terp-core/app/params" - "github.com/terpnetwork/terp-core/v2/x/globalfee" - gaiafeeante "github.com/terpnetwork/terp-core/v2/x/globalfee/ante" - globfeetypes "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee" + gaiafeeante "github.com/terpnetwork/terp-core/v4/x/globalfee/ante" + globfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) type IntegrationTestSuite struct { diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 0f03279..864ba7f 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -11,7 +11,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - globalfeekeeper "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" + globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" ) // FeeWithBypassDecorator checks if the transaction's fee is at least as large diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index 415a1cb..b03666b 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) func GetQueryCmd() *cobra.Command { diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 79e4ce1..bc4e489 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -15,9 +15,9 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - appparams "github.com/terpnetwork/terp-core/v2/app/params" - globalfeekeeper "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + appparams "github.com/terpnetwork/terp-core/v4/app/params" + globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) func TestDefaultGenesis(t *testing.T) { diff --git a/x/globalfee/keeper/keeper.go b/x/globalfee/keeper/keeper.go index 6919f83..9c436ff 100644 --- a/x/globalfee/keeper/keeper.go +++ b/x/globalfee/keeper/keeper.go @@ -5,7 +5,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) // Keeper of the globalfee store diff --git a/x/globalfee/keeper/migrator.go b/x/globalfee/keeper/migrator.go index 747b1be..92f736d 100644 --- a/x/globalfee/keeper/migrator.go +++ b/x/globalfee/keeper/migrator.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/terpnetwork/terp-core/v2/x/globalfee/migrations/v2" + v2 "github.com/terpnetwork/terp-core/v4/x/globalfee/migrations/v2" ) // Migrator is a struct for handling in-place state migrations. diff --git a/x/globalfee/keeper/msg_server.go b/x/globalfee/keeper/msg_server.go index cef1608..d821ec5 100644 --- a/x/globalfee/keeper/msg_server.go +++ b/x/globalfee/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/globalfee/migrations/v2/migrate.go b/x/globalfee/migrations/v2/migrate.go index aa0a219..c9cc655 100644 --- a/x/globalfee/migrations/v2/migrate.go +++ b/x/globalfee/migrations/v2/migrate.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) const ( diff --git a/x/globalfee/migrations/v2/migrator_test.go b/x/globalfee/migrations/v2/migrator_test.go index f2a9ed6..ed83a90 100644 --- a/x/globalfee/migrations/v2/migrator_test.go +++ b/x/globalfee/migrations/v2/migrator_test.go @@ -9,10 +9,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/terpnetwork/terp-core/v2/x/globalfee" - "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper/exported" - v2 "github.com/terpnetwork/terp-core/v2/x/globalfee/migrations/v2" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee" + "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper/exported" + v2 "github.com/terpnetwork/terp-core/v4/x/globalfee/migrations/v2" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) //lint:ignore U1000 disregard lint check diff --git a/x/globalfee/module.go b/x/globalfee/module.go index e54b45f..6d6a712 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -19,9 +19,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/terpnetwork/terp-core/v2/x/globalfee/client/cli" - "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/client/cli" + "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) var ( diff --git a/x/globalfee/querier.go b/x/globalfee/querier.go index 90e36a5..81303b3 100644 --- a/x/globalfee/querier.go +++ b/x/globalfee/querier.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) var _ types.QueryServer = &GrpcQuerier{} diff --git a/x/globalfee/querier_test.go b/x/globalfee/querier_test.go index e0d0ff8..ae7701d 100644 --- a/x/globalfee/querier_test.go +++ b/x/globalfee/querier_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - globalfeekeeper "github.com/terpnetwork/terp-core/v2/x/globalfee/keeper" - "github.com/terpnetwork/terp-core/v2/x/globalfee/types" + globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper" + "github.com/terpnetwork/terp-core/v4/x/globalfee/types" ) func TestQueryMinimumGasPrices(t *testing.T) { diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index a478fad..9c91da8 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -5,22 +5,19 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -40,11 +37,9 @@ func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_015b3e8b7a7c65c5, []int{0} } - func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) @@ -57,15 +52,12 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *GenesisState) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisState.Merge(m, src) } - func (m *GenesisState) XXX_Size() int { return m.Size() } - func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } @@ -95,11 +87,9 @@ func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_015b3e8b7a7c65c5, []int{1} } - func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Params.Marshal(b, m, deterministic) @@ -112,15 +102,12 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *Params) XXX_Merge(src proto.Message) { xxx_messageInfo_Params.Merge(m, src) } - func (m *Params) XXX_Size() int { return m.Size() } - func (m *Params) XXX_DiscardUnknown() { xxx_messageInfo_Params.DiscardUnknown(m) } @@ -249,7 +236,6 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *GenesisState) Size() (n int) { if m == nil { return 0 @@ -279,11 +265,9 @@ func (m *Params) Size() (n int) { func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -367,7 +351,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } - func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -452,7 +435,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } - func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index b94a154..5b87eb6 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -19,14 +15,15 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -36,7 +33,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // QueryMinimumGasPricesRequest is the request type for the // Query/MinimumGasPrices RPC method. -type QueryMinimumGasPricesRequest struct{} +type QueryMinimumGasPricesRequest struct { +} func (m *QueryMinimumGasPricesRequest) Reset() { *m = QueryMinimumGasPricesRequest{} } func (m *QueryMinimumGasPricesRequest) String() string { return proto.CompactTextString(m) } @@ -44,11 +42,9 @@ func (*QueryMinimumGasPricesRequest) ProtoMessage() {} func (*QueryMinimumGasPricesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_12a736cede25d10a, []int{0} } - func (m *QueryMinimumGasPricesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryMinimumGasPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryMinimumGasPricesRequest.Marshal(b, m, deterministic) @@ -61,15 +57,12 @@ func (m *QueryMinimumGasPricesRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } - func (m *QueryMinimumGasPricesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMinimumGasPricesRequest.Merge(m, src) } - func (m *QueryMinimumGasPricesRequest) XXX_Size() int { return m.Size() } - func (m *QueryMinimumGasPricesRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryMinimumGasPricesRequest.DiscardUnknown(m) } @@ -88,11 +81,9 @@ func (*QueryMinimumGasPricesResponse) ProtoMessage() {} func (*QueryMinimumGasPricesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_12a736cede25d10a, []int{1} } - func (m *QueryMinimumGasPricesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryMinimumGasPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryMinimumGasPricesResponse.Marshal(b, m, deterministic) @@ -105,15 +96,12 @@ func (m *QueryMinimumGasPricesResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } - func (m *QueryMinimumGasPricesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryMinimumGasPricesResponse.Merge(m, src) } - func (m *QueryMinimumGasPricesResponse) XXX_Size() int { return m.Size() } - func (m *QueryMinimumGasPricesResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryMinimumGasPricesResponse.DiscardUnknown(m) } @@ -165,10 +153,8 @@ var fileDescriptor_12a736cede25d10a = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +var _ context.Context +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -206,7 +192,8 @@ type QueryServer interface { } // UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct{} +type UnimplementedQueryServer struct { +} func (*UnimplementedQueryServer) MinimumGasPrices(ctx context.Context, req *QueryMinimumGasPricesRequest) (*QueryMinimumGasPricesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MinimumGasPrices not implemented") @@ -318,7 +305,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *QueryMinimumGasPricesRequest) Size() (n int) { if m == nil { return 0 @@ -346,11 +332,9 @@ func (m *QueryMinimumGasPricesResponse) Size() (n int) { func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *QueryMinimumGasPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -401,7 +385,6 @@ func (m *QueryMinimumGasPricesRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryMinimumGasPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -486,7 +469,6 @@ func (m *QueryMinimumGasPricesResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/globalfee/types/query.pb.gw.go b/x/globalfee/types/query.pb.gw.go index 123396e..a7b2956 100644 --- a/x/globalfee/types/query.pb.gw.go +++ b/x/globalfee/types/query.pb.gw.go @@ -25,15 +25,13 @@ import ( ) // Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = descriptor.ForMessage - _ = metadata.Join -) +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_MinimumGasPrices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryMinimumGasPricesRequest @@ -41,6 +39,7 @@ func request_Query_MinimumGasPrices_0(ctx context.Context, marshaler runtime.Mar msg, err := client.MinimumGasPrices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_Query_MinimumGasPrices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -49,6 +48,7 @@ func local_request_Query_MinimumGasPrices_0(ctx context.Context, marshaler runti msg, err := server.MinimumGasPrices(ctx, &protoReq) return msg, metadata, err + } // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". @@ -56,6 +56,7 @@ func local_request_Query_MinimumGasPrices_0(ctx context.Context, marshaler runti // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_MinimumGasPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -76,6 +77,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv } forward_Query_MinimumGasPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil @@ -118,6 +120,7 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_MinimumGasPrices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -135,11 +138,16 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } forward_Query_MinimumGasPrices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } -var pattern_Query_MinimumGasPrices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gaia", "globalfee", "v1beta1", "minimum_gas_prices"}, "", runtime.AssumeColonVerbOpt(false))) +var ( + pattern_Query_MinimumGasPrices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gaia", "globalfee", "v1beta1", "minimum_gas_prices"}, "", runtime.AssumeColonVerbOpt(false))) +) -var forward_Query_MinimumGasPrices_0 = runtime.ForwardResponseMessage +var ( + forward_Query_MinimumGasPrices_0 = runtime.ForwardResponseMessage +) diff --git a/x/globalfee/types/tx.pb.go b/x/globalfee/types/tx.pb.go index c5d9b2c..5438344 100644 --- a/x/globalfee/types/tx.pb.go +++ b/x/globalfee/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" @@ -18,14 +14,15 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -51,11 +48,9 @@ func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { return fileDescriptor_1b7ff262ac5784d9, []int{0} } - func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) @@ -68,15 +63,12 @@ func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } - func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParams.Merge(m, src) } - func (m *MsgUpdateParams) XXX_Size() int { return m.Size() } - func (m *MsgUpdateParams) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) } @@ -101,7 +93,8 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParams message. // // Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct{} +type MsgUpdateParamsResponse struct { +} func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } @@ -109,11 +102,9 @@ func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_1b7ff262ac5784d9, []int{1} } - func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) @@ -126,15 +117,12 @@ func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } - func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) } - func (m *MsgUpdateParamsResponse) XXX_Size() int { return m.Size() } - func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) } @@ -174,10 +162,8 @@ var fileDescriptor_1b7ff262ac5784d9 = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +var _ context.Context +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -221,7 +207,8 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") @@ -336,7 +323,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgUpdateParams) Size() (n int) { if m == nil { return 0 @@ -364,11 +350,9 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -484,7 +468,6 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -535,7 +518,6 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/tokenfactory/bindings/custom_msg_test.go b/x/tokenfactory/bindings/custom_msg_test.go index 6d8e469..f8e3f06 100644 --- a/x/tokenfactory/bindings/custom_msg_test.go +++ b/x/tokenfactory/bindings/custom_msg_test.go @@ -11,9 +11,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/app" - bindings "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/app" + bindings "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func TestCreateDenomMsg(t *testing.T) { diff --git a/x/tokenfactory/bindings/custom_query_test.go b/x/tokenfactory/bindings/custom_query_test.go index e025ddb..1ca7fee 100644 --- a/x/tokenfactory/bindings/custom_query_test.go +++ b/x/tokenfactory/bindings/custom_query_test.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/app" - bindings "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" + "github.com/terpnetwork/terp-core/v4/app" + bindings "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" ) func TestQueryFullDenom(t *testing.T) { diff --git a/x/tokenfactory/bindings/helpers_test.go b/x/tokenfactory/bindings/helpers_test.go index 6b6c401..2751ba6 100644 --- a/x/tokenfactory/bindings/helpers_test.go +++ b/x/tokenfactory/bindings/helpers_test.go @@ -15,7 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" - "github.com/terpnetwork/terp-core/v2/app" + "github.com/terpnetwork/terp-core/v4/app" ) func CreateTestInput(t *testing.T) (*app.TerpApp, sdk.Context) { diff --git a/x/tokenfactory/bindings/message_plugin.go b/x/tokenfactory/bindings/message_plugin.go index 78d7f2c..cd3202e 100644 --- a/x/tokenfactory/bindings/message_plugin.go +++ b/x/tokenfactory/bindings/message_plugin.go @@ -13,9 +13,9 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - bindingstypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" - tokenfactorykeeper "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" - tokenfactorytypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + bindingstypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" + tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" + tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages diff --git a/x/tokenfactory/bindings/queries.go b/x/tokenfactory/bindings/queries.go index 75a21d1..0855b1c 100644 --- a/x/tokenfactory/bindings/queries.go +++ b/x/tokenfactory/bindings/queries.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - bindingstypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" - tokenfactorykeeper "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" + bindingstypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" + tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" ) type QueryPlugin struct { diff --git a/x/tokenfactory/bindings/query_plugin.go b/x/tokenfactory/bindings/query_plugin.go index f934663..4d30531 100644 --- a/x/tokenfactory/bindings/query_plugin.go +++ b/x/tokenfactory/bindings/query_plugin.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - bindingstypes "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" + bindingstypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" ) // CustomQuerier dispatches custom CosmWasm bindings queries. diff --git a/x/tokenfactory/bindings/validate_msg_test.go b/x/tokenfactory/bindings/validate_msg_test.go index b89adf6..931a133 100644 --- a/x/tokenfactory/bindings/validate_msg_test.go +++ b/x/tokenfactory/bindings/validate_msg_test.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - wasmbinding "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings" - bindings "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + wasmbinding "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings" + bindings "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func TestCreateDenom(t *testing.T) { diff --git a/x/tokenfactory/bindings/validate_queries_test.go b/x/tokenfactory/bindings/validate_queries_test.go index 00c72e8..4feee3d 100644 --- a/x/tokenfactory/bindings/validate_queries_test.go +++ b/x/tokenfactory/bindings/validate_queries_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - wasmbinding "github.com/terpnetwork/terp-core/v2/x/tokenfactory/bindings" + wasmbinding "github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings" ) func TestFullDenom(t *testing.T) { diff --git a/x/tokenfactory/bindings/wasm.go b/x/tokenfactory/bindings/wasm.go index fd77a21..8a33de7 100644 --- a/x/tokenfactory/bindings/wasm.go +++ b/x/tokenfactory/bindings/wasm.go @@ -5,7 +5,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - tokenfactorykeeper "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" + tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" ) func RegisterCustomPlugins( diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go index d76648e..1d4534e 100644 --- a/x/tokenfactory/client/cli/query.go +++ b/x/tokenfactory/client/cli/query.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index 059dd24..e2a24bf 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // GetTxCmd returns the transaction commands for this module diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index ba4aa7c..3c149be 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // GetAuthorityMetadata returns the authority metadata for a specific denom diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index 8f19b61..98861ad 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestAdminMsgs() { diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index dbe92b5..db987a6 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func (k Keeper) mintTo(ctx sdk.Context, amount sdk.Coin, mintTo string) error { diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index 5411ca8..2d50ff0 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go index 52784e3..af60e9a 100644 --- a/x/tokenfactory/keeper/createdenom_test.go +++ b/x/tokenfactory/keeper/createdenom_test.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/app/apptesting" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/app/apptesting" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestMsgCreateDenom() { diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index dfd5875..9b2f04f 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // InitGenesis initializes the tokenfactory module's state from a provided genesis diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index 3c7d6fa..49f46c6 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestGenesis() { diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index 5ced656..3ae2695 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index 2eb024d..a49ed49 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) type ( diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index 8a92288..599f1ea 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -10,9 +10,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/app/apptesting" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/app/apptesting" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) type KeeperTestSuite struct { diff --git a/x/tokenfactory/keeper/migrator.go b/x/tokenfactory/keeper/migrator.go index 0a5ac69..ccf69ed 100644 --- a/x/tokenfactory/keeper/migrator.go +++ b/x/tokenfactory/keeper/migrator.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/exported" - v2 "github.com/terpnetwork/terp-core/v2/x/tokenfactory/migrations/v2" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/exported" + v2 "github.com/terpnetwork/terp-core/v4/x/tokenfactory/migrations/v2" ) // Migrator is a struct for handling in-place state migrations. diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 098db8e..2e33298 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) type msgServer struct { diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 2f5b7d5..5eb6637 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // TestMintDenomMsg tests TypeMsgMint message is emitted on a successful mint diff --git a/x/tokenfactory/keeper/params.go b/x/tokenfactory/keeper/params.go index 5949338..e4a0c0d 100644 --- a/x/tokenfactory/keeper/params.go +++ b/x/tokenfactory/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // GetParams returns the total set params. diff --git a/x/tokenfactory/migrations/v2/migrate.go b/x/tokenfactory/migrations/v2/migrate.go index 689486c..3e28859 100644 --- a/x/tokenfactory/migrations/v2/migrate.go +++ b/x/tokenfactory/migrations/v2/migrate.go @@ -4,8 +4,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/exported" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/exported" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) const ModuleName = "tokenfactory" diff --git a/x/tokenfactory/migrations/v2/migrate_test.go b/x/tokenfactory/migrations/v2/migrate_test.go index 0ed9fdd..a470e7f 100644 --- a/x/tokenfactory/migrations/v2/migrate_test.go +++ b/x/tokenfactory/migrations/v2/migrate_test.go @@ -9,10 +9,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/exported" - v2 "github.com/terpnetwork/terp-core/v2/x/tokenfactory/migrations/v2" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/exported" + v2 "github.com/terpnetwork/terp-core/v4/x/tokenfactory/migrations/v2" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) type mockSubspace struct { diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go index 9f93f1d..3d5a490 100644 --- a/x/tokenfactory/module.go +++ b/x/tokenfactory/module.go @@ -26,11 +26,11 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/client/cli" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/exported" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/keeper" - simulation "github.com/terpnetwork/terp-core/v2/x/tokenfactory/simulation" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/client/cli" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/exported" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper" + simulation "github.com/terpnetwork/terp-core/v4/x/tokenfactory/simulation" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) var ( diff --git a/x/tokenfactory/simulation/genesis.go b/x/tokenfactory/simulation/genesis.go index 3d2704e..213e8f1 100644 --- a/x/tokenfactory/simulation/genesis.go +++ b/x/tokenfactory/simulation/genesis.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - appparams "github.com/terpnetwork/terp-core/v2/app/params" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + appparams "github.com/terpnetwork/terp-core/v4/app/params" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func RandDenomCreationFeeParam(r *rand.Rand) sdk.Coins { diff --git a/x/tokenfactory/simulation/operations.go b/x/tokenfactory/simulation/operations.go index 4936439..8a54694 100644 --- a/x/tokenfactory/simulation/operations.go +++ b/x/tokenfactory/simulation/operations.go @@ -10,8 +10,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/simulation" - appparams "github.com/terpnetwork/terp-core/v2/app/params" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + appparams "github.com/terpnetwork/terp-core/v4/app/params" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // Simulation operation weights constants diff --git a/x/tokenfactory/types/denoms_test.go b/x/tokenfactory/types/denoms_test.go index 36f013e..a2030a8 100644 --- a/x/tokenfactory/types/denoms_test.go +++ b/x/tokenfactory/types/denoms_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func TestDeconstructDenom(t *testing.T) { diff --git a/x/tokenfactory/types/genesis_test.go b/x/tokenfactory/types/genesis_test.go index a3134d7..489a982 100644 --- a/x/tokenfactory/types/genesis_test.go +++ b/x/tokenfactory/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/tokenfactory/types/msgs_test.go b/x/tokenfactory/types/msgs_test.go index 8c31600..78734ad 100644 --- a/x/tokenfactory/types/msgs_test.go +++ b/x/tokenfactory/types/msgs_test.go @@ -11,8 +11,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/testhelpers" - "github.com/terpnetwork/terp-core/v2/x/tokenfactory/types" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/testhelpers" + "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types" ) // Test authz serialize and de-serializes for tokenfactory msg.