From a94e2e76097f53821e4c8321552451ac8cbeab8f Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Thu, 15 Aug 2024 02:49:28 +0530 Subject: [PATCH 1/4] add block proposal handlers --- app/app.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 8e903e6..9e37270 100644 --- a/app/app.go +++ b/app/app.go @@ -9,6 +9,7 @@ import ( "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/x/auth/posthandler" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" @@ -241,6 +242,9 @@ func NewOmniFlixApp( app.MountTransientStores(app.GetTransientStoreKey()) app.MountMemoryStores(app.GetMemoryStoreKey()) + app.SetPrepareProposal(baseapp.NoOpPrepareProposal()) + app.SetProcessProposal(baseapp.NoOpProcessProposal()) + anteHandler, err := NewAnteHandler( HandlerOptions{ HandlerOptions: ante.HandlerOptions{ @@ -264,12 +268,18 @@ func NewOmniFlixApp( if err != nil { panic(fmt.Errorf("failed to create AnteHandler: %s", err)) } - + postHandler, err := posthandler.NewPostHandler( + posthandler.HandlerOptions{}, + ) + if err != nil { + panic(err) + } // initialize BaseApp app.SetInitChainer(app.InitChainer) app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetAnteHandler(anteHandler) + app.SetPostHandler(postHandler) app.SetEndBlocker(app.EndBlocker) app.SetPrecommiter(app.PreCommitter) app.SetPrepareCheckStater(app.PrepareCheckStater) From 4fc52cf05658cd3f9c14c7ca9106305895ad55c6 Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Thu, 22 Aug 2024 18:22:41 +0530 Subject: [PATCH 2/4] update workflow scripts --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac6b38a..f8d31b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - GO_VERSION: "1.21.3" + GO_VERSION: "1.22.5" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 99289db..2438bbd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ on: - '**.go' env: - GO_VERSION: '1.21.3' + GO_VERSION: '1.22.5' permissions: contents: read @@ -31,7 +31,7 @@ jobs: go-version: ${{env.GO_VERSION}} - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest args: --timeout 10m From 3111505d282bf38fab10593c085f742e7669bf07 Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Thu, 22 Aug 2024 18:49:35 +0530 Subject: [PATCH 3/4] lint fixes --- x/globalfee/ante/fee.go | 4 ++-- x/itc/keeper/keeper_test.go | 4 ++-- x/tokenfactory/client/cli/tx.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 972702b..b3be74d 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -69,7 +69,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne } // Get local minimum-gas-prices - localFees := GetMinGasPrice(ctx, int64(feeTx.GetGas())) + localFees := GetMinGasPrice(ctx, int64(feeTx.GetGas())) //nolint:all // CombinedFeeRequirement should never be empty since // global fee is set to its default value, i.e. 0uatom, if empty @@ -160,7 +160,7 @@ func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coin requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdkmath.LegacyNewDec(int64(feeTx.GetGas())) + glDec := sdkmath.LegacyNewDec(int64(feeTx.GetGas())) //nolint:all for i, gp := range globalMinGasPrices { fee := gp.Amount.Mul(glDec) requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) diff --git a/x/itc/keeper/keeper_test.go b/x/itc/keeper/keeper_test.go index 751af48..c21ae9b 100644 --- a/x/itc/keeper/keeper_test.go +++ b/x/itc/keeper/keeper_test.go @@ -89,7 +89,7 @@ func (suite *KeeperTestSuite) CreateDefaultCampaign() { defaultTokensPerClaim, sdk.NewInt64Coin( defaultTokensPerClaim.Denom, - defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), + defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), //nolint:all ), nil, &defaultDistribution, @@ -119,7 +119,7 @@ func (suite *KeeperTestSuite) CreateSecondaryCampaign() { defaultTokensPerClaim, sdk.NewInt64Coin( defaultTokensPerClaim.Denom, - defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), + defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), //nolint:golint ), &defaultNftMintDetails, &defaultDistribution, diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index 8a86b44..ad78e52 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -346,7 +346,7 @@ func NewModifyDenomMetadataCmd() *cobra.Command { }, { Denom: ticker, - Exponent: uint32(exponent), + Exponent: uint32(exponent), //nolint:all Aliases: []string{fullDenom}, }, }, From fbc81c9562cd583c100721405d21f36450db3852 Mon Sep 17 00:00:00 2001 From: Harish Marri Date: Thu, 22 Aug 2024 18:53:24 +0530 Subject: [PATCH 4/4] lint fixes --- x/itc/keeper/keeper_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/itc/keeper/keeper_test.go b/x/itc/keeper/keeper_test.go index c21ae9b..7e14016 100644 --- a/x/itc/keeper/keeper_test.go +++ b/x/itc/keeper/keeper_test.go @@ -119,7 +119,7 @@ func (suite *KeeperTestSuite) CreateSecondaryCampaign() { defaultTokensPerClaim, sdk.NewInt64Coin( defaultTokensPerClaim.Denom, - defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), //nolint:golint + defaultTokensPerClaim.Amount.MulRaw(int64(defaultMaxClaims)).Int64(), //nolint:all ), &defaultNftMintDetails, &defaultDistribution,