Skip to content

Commit

Permalink
Merge branch 'master' into revert-tendermint-routing
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 authored Sep 29, 2021
2 parents a2397c2 + 6f33514 commit 35b641b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* [\#9879](https://github.com/cosmos/cosmos-sdk/pull/9879) Modify ABCI Queries to use `abci.QueryRequest` Height field if it is non-zero, otherwise continue using context height.
* [\#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) Remove legacy REST API. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/master/migrations/rest.html) to migrate to the new REST endpoints.
* [\#9995](https://github.com/cosmos/cosmos-sdk/pull/9995) Increased gas cost for creating proposals.

### CLI Breaking Changes

Expand Down
3 changes: 1 addition & 2 deletions x/gov/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) {
)
require.NoError(t, err)

wrapCtx := sdk.WrapSDKContext(ctx)
res, err := govMsgSvr.SubmitProposal(wrapCtx, newProposalMsg)
res, err := govMsgSvr.SubmitProposal(sdk.WrapSDKContext(ctx), newProposalMsg)
require.NoError(t, err)
require.NotNil(t, res)

Expand Down
12 changes: 12 additions & 0 deletions x/gov/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/armon/go-metrics"

store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
Expand All @@ -31,6 +32,17 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitPro
return nil, err
}

bytes, err := proposal.Marshal()
if err != nil {
return nil, err
}

// ref: https://github.com/cosmos/cosmos-sdk/issues/9683
ctx.GasMeter().ConsumeGas(
3*store.KVGasConfig().WriteCostPerByte*uint64(len(bytes)),
"submit proposal",
)

defer telemetry.IncrCounter(1, types.ModuleName, "proposal")

votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit())
Expand Down

0 comments on commit 35b641b

Please sign in to comment.