From 11039b79327a2d29d85e8a6a8a0aba24d7e18af8 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:25:20 +0000 Subject: [PATCH] fix(types/mempool): fix slice init length (backport #21494) (#21519) Co-authored-by: dropbigfish Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + types/mempool/priority_nonce_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 383d00033017..4935247f8c04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (types/mempool) [#21494](https://github.com/cosmos/cosmos-sdk/pull/21494) `GetSigners` function in priority nonce mempool returns an slide of the correct length. * (x/consensus) [#21493](https://github.com/cosmos/cosmos-sdk/pull/21493) Fix regression that prevented to upgrade to > v0.50.7 without consensus version params. * (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0. * (baseapp) [#21444](https://github.com/cosmos/cosmos-sdk/pull/21444) Follow-up, Return PreBlocker events in FinalizeBlockResponse. diff --git a/types/mempool/priority_nonce_test.go b/types/mempool/priority_nonce_test.go index 24016b417abf..ad69bd8bf8a9 100644 --- a/types/mempool/priority_nonce_test.go +++ b/types/mempool/priority_nonce_test.go @@ -72,7 +72,7 @@ func (a signerExtractionAdapter) GetSigners(tx sdk.Tx) ([]mempool.SignerData, er if err != nil { return nil, err } - signerData := make([]mempool.SignerData, len(sigs)) + signerData := make([]mempool.SignerData, 0, len(sigs)) for _, sig := range sigs { signerData = append(signerData, mempool.SignerData{ Signer: sig.PubKey.Address().Bytes(),