Skip to content

Commit

Permalink
add block proposal handlers (#182)
Browse files Browse the repository at this point in the history
* add block proposal handlers

* update workflow scripts

* lint fixes

* lint fixes
  • Loading branch information
harish551 authored Aug 22, 2024
1 parent b942c7a commit b64c773
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '**.go'

env:
GO_VERSION: '1.21.3'
GO_VERSION: '1.22.5'

permissions:
contents: read
Expand All @@ -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
12 changes: 11 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions x/globalfee/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions x/itc/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:all
),
&defaultNftMintDetails,
&defaultDistribution,
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func NewModifyDenomMetadataCmd() *cobra.Command {
},
{
Denom: ticker,
Exponent: uint32(exponent),
Exponent: uint32(exponent), //nolint:all
Aliases: []string{fullDenom},
},
},
Expand Down

0 comments on commit b64c773

Please sign in to comment.