Skip to content

Commit

Permalink
V2.13.0 merge (#921)
Browse files Browse the repository at this point in the history
* update proto

* update: cosmos-sdk to 0.50.9

* update: go.mod
  • Loading branch information
skyargos authored Nov 9, 2024
1 parent e6991b0 commit 1e7b574
Show file tree
Hide file tree
Showing 114 changed files with 4,018 additions and 6,504 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: '1.21.10'
go-version: '1.22.0'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.22
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' }}

build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.22
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -28,12 +28,12 @@ jobs:

test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.22
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand All @@ -44,19 +44,19 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test nondeterminism
run: |
make test-sim-nondeterminism
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-import-export:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.22
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
Expand All @@ -68,44 +68,44 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test-sim-import-export
run: |
make test-sim-import-export
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-after-import:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.22
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
**/*.go
go.mod
go.sum
- uses: actions/cache@v3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test after import
run: |
make test-sim-after-import
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.22
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand All @@ -116,8 +116,8 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
cleanup-runs:
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
if: ${{ !startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
Expand All @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.22
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
- uses: codecov/[email protected]
with:
file: ./coverage.txt # optional
token: 6556fc17-6f3d-40be-b947-0bba9a9fe92f
fail_ci_if_error: true

test-e2e:
Expand All @@ -61,7 +62,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.22
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
Expand All @@ -71,6 +72,8 @@ jobs:
go.sum
- name: Build Docker Image
run: make docker-build-debug
- name: Build Hermes Image
run: make docker-build-hermes
- name: Test E2E
run: make test-e2e

Expand All @@ -81,7 +84,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.22
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ run:
skip-dirs:
- tests/e2e
# TODO: include below
- app/shentud/cmd
- x/gov
timeout: 5m

linters:
Expand All @@ -13,13 +13,13 @@ linters:
- deadcode
- depguard
- dogsled
# - errcheck
- errcheck
- goconst
- gocritic
- gofmt
- goimports
- golint
# - gosec
- gosec
- gosimple
- govet
- ineffassign
Expand Down
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ docker-build-debug:

# in CI.
docker-build-hermes:
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile .
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:1.0.0 -f hermes.Dockerfile .


image: Dockerfile Dockerfile.update
Expand Down Expand Up @@ -192,14 +192,13 @@ localnet-stop:
docker-compose down

start-localnet-ci:
./build/shentud init liveness --chain-id liveness --home ~/.shentud-liveness
./build/shentud config chain-id liveness --home ~/.shentud-liveness
./build/shentud config keyring-backend test --home ~/.shentud-liveness
./build/shentud keys add val --home ~/.shentud-liveness
./build/shentud add-genesis-account val 10000000000000000000000000uctk --home ~/.shentud-liveness --keyring-backend test
./build/shentud gentx val 1000000000uctk --home ~/.shentud-liveness --chain-id liveness
./build/shentud collect-gentxs --home ~/.shentud-liveness
sed -i'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.shentud-liveness/config/app.toml
./build/shentud init liveness -o --chain-id liveness --home ~/.shentud-liveness
./build/shentud config set client keyring-backend test --home ~/.shentud-liveness
./build/shentud keys add val --keyring-backend test --home ~/.shentud-liveness
./build/shentud add-genesis-account val 10000000000000000000stake --home ~/.shentud-liveness --keyring-backend test
./build/shentud genesis gentx val 1000000000stake --home ~/.shentud-liveness --chain-id liveness --keyring-backend test
./build/shentud genesis collect-gentxs --home ~/.shentud-liveness
sed -i 's/minimum-gas-prices = ".*"/minimum-gas-prices = "0stake"/' ~/.shentud-liveness/config/app.toml
./build/shentud start --home ~/.shentud-liveness --x-crisis-skip-assert-invariants

.PHONY: start-localnet-ci
Expand Down
27 changes: 18 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"io"
"os"

"github.com/spf13/cast"

"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/log"
Expand All @@ -22,21 +24,19 @@ import (
abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
tmos "github.com/cometbft/cometbft/libs/os"
"github.com/spf13/cast"

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/server"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand Down Expand Up @@ -82,6 +82,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
Expand All @@ -101,6 +102,7 @@ import (
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

appparams "github.com/shentufoundation/shentu/v2/app/params"
"github.com/shentufoundation/shentu/v2/x/auth"
Expand Down Expand Up @@ -509,6 +511,7 @@ func NewShentuApp(
oracle.NewAppModule(app.OracleKeeper, app.BankKeeper),
shield.NewAppModule(app.ShieldKeeper, app.AccountKeeper, app.BankKeeper),
ibc.NewAppModule(app.IBCKeeper),
ibctm.AppModule{},
params.NewAppModule(app.ParamsKeeper),
transferModule,
icaModule,
Expand Down Expand Up @@ -615,7 +618,10 @@ func NewShentuApp(

app.mm.RegisterInvariants(app.CrisisKeeper)
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
app.mm.RegisterServices(app.configurator)
err := app.mm.RegisterServices(app.configurator)
if err != nil {
panic(err)
}

app.sm = module.NewSimulationManager(
auth.NewAppModule(appCodec, app.AuthKeeper, app.AccountKeeper, app.BankKeeper, app.CertKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
Expand Down Expand Up @@ -703,7 +709,10 @@ func (app *ShentuApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
if err != nil {
panic(err)
}
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

Expand Down Expand Up @@ -876,7 +885,7 @@ func (app *ShentuApp) RegisterNodeService(clientCtx client.Context, cfg config.C

// RegisterUpgradeHandlers registers necessary upgrade handlers
func (app *ShentuApp) RegisterUpgradeHandlers() {
app.setUpgradeHandler(app.appCodec, app.IBCKeeper.ClientKeeper)
app.setUpgradeHandler(app.appCodec)
}

// initParamsKeeper init params keeper and its subspaces
Expand Down
Loading

0 comments on commit 1e7b574

Please sign in to comment.