Skip to content

Commit

Permalink
launchpad: backport account sequence stuck (#6721)
Browse files Browse the repository at this point in the history
Launchpad fix for #6287
  • Loading branch information
fedekunze committed Jul 14, 2020
1 parent 23f82ff commit f4ae40b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ respectively, and the latter defines the height interval in which versions are d
* (baseapp) [\#6306](https://github.com/cosmos/cosmos-sdk/issues/6306) Prevent events emitted by the antehandler from being persisted between transactions.
* (client/keys) [\#5091](https://github.com/cosmos/cosmos-sdk/issues/5091) `keys parse` does not honor client app's configuration.
* (x/bank) [\#6674](https://github.com/cosmos/cosmos-sdk/pull/6674) Create account if recipient does not exist on handing `MsgMultiSend`.
* (x/auth) [\#6287](https://github.com/cosmos/cosmos-sdk/pull/6287) Fix nonce stuck when sending multiple transactions from an account in a same block.

## [v0.38.5] - 2020-07-02

Expand Down
5 changes: 0 additions & 5 deletions x/auth/ante/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ func NewIncrementSequenceDecorator(ak keeper.AccountKeeper) IncrementSequenceDec
}

func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// no need to increment sequence on RecheckTx
if ctx.IsReCheckTx() && !simulate {
return next(ctx, tx, simulate)
}

sigTx, ok := tx.(SigVerifiableTx)
if !ok {
return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type")
Expand Down
8 changes: 4 additions & 4 deletions x/auth/ante/sigverify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ func TestIncrementSequenceDecorator(t *testing.T) {
simulate bool
expectedSeq uint64
}{
{ctx.WithIsReCheckTx(true), false, 0},
{ctx.WithIsCheckTx(true).WithIsReCheckTx(false), false, 1},
{ctx.WithIsReCheckTx(true), false, 1},
{ctx.WithIsReCheckTx(true), false, 1},
{ctx.WithIsReCheckTx(true), true, 2},
{ctx.WithIsCheckTx(true).WithIsReCheckTx(false), false, 2},
{ctx.WithIsReCheckTx(true), false, 3},
{ctx.WithIsReCheckTx(true), false, 4},
{ctx.WithIsReCheckTx(true), true, 5},
}

for i, tc := range testCases {
Expand Down

0 comments on commit f4ae40b

Please sign in to comment.