diff --git a/state/execution_test.go b/state/execution_test.go index b1c6c1752..b9c5dd340 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -202,10 +202,14 @@ func TestFinalizeBlockValidators(t *testing.T) { } for _, tc := range testCases { - lastCommit := types.NewExtendedCommit(1, 0, prevBlockID, tc.lastCommitSigs) + lastCommit := &types.Commit{ + Height: 1, + BlockID: prevBlockID, + Signatures: tc.lastCommitSigs, + } // block for height 2 - block := makeBlock(state, 2, lastCommit.StripExtensions()) + block := makeBlock(state, 2, lastCommit) _, err = sm.ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), stateStore, 1) require.Nil(t, err, tc.desc) diff --git a/state/rollback_test.go b/state/rollback_test.go index 9e2d03efc..3e8f33c82 100644 --- a/state/rollback_test.go +++ b/state/rollback_test.go @@ -118,7 +118,7 @@ func TestRollbackHard(t *testing.T) { partSet, err := block.MakePartSet(types.BlockPartSizeBytes) require.NoError(t, err) - blockStore.SaveBlock(block, partSet, &types.Commit{Height: block.Height}) + blockStore.SaveBlock(block, partSet, &types.ExtendedCommit{Height: block.Height}) currState := state.State{ Version: tmstate.Version{ @@ -160,7 +160,7 @@ func TestRollbackHard(t *testing.T) { nextPartSet, err := nextBlock.MakePartSet(types.BlockPartSizeBytes) require.NoError(t, err) - blockStore.SaveBlock(nextBlock, nextPartSet, &types.Commit{Height: nextBlock.Height}) + blockStore.SaveBlock(nextBlock, nextPartSet, &types.ExtendedCommit{Height: nextBlock.Height}) rollbackHeight, rollbackHash, err := state.Rollback(blockStore, stateStore, true) require.NoError(t, err) @@ -173,7 +173,7 @@ func TestRollbackHard(t *testing.T) { require.Equal(t, currState, loadedState) // resave the same block - blockStore.SaveBlock(nextBlock, nextPartSet, &types.Commit{Height: nextBlock.Height}) + blockStore.SaveBlock(nextBlock, nextPartSet, &types.ExtendedCommit{Height: nextBlock.Height}) params.Version.App = 11 diff --git a/store/store.go b/store/store.go index 07df7bfb1..fa2bd998f 100644 --- a/store/store.go +++ b/store/store.go @@ -233,11 +233,11 @@ func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { } err = proto.Unmarshal(bz, pbc) if err != nil { - panic(fmt.Errorf("converting commit to proto: %w", err)) + panic(fmt.Sprintf("error reading block commit: %v", err)) } commit, err := types.CommitFromProto(pbc) if err != nil { - panic(fmt.Sprintf("Error reading block commit: %v", err)) + panic(fmt.Errorf("converting commit to proto: %w", err)) } return commit } diff --git a/store/store_test.go b/store/store_test.go index 15d853338..31ad2d482 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -14,7 +14,6 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/internal/test" "github.com/tendermint/tendermint/libs/log" @@ -377,7 +376,7 @@ func TestLoadBaseMeta(t *testing.T) { } func TestLoadBlockPart(t *testing.T) { - cfg := config.ResetTestRoot("blockchain_reactor_test") + config := test.ResetTestRoot("blockchain_reactor_test") bs, db := newInMemoryBlockStore() const height, index = 10, 1 @@ -386,7 +385,7 @@ func TestLoadBlockPart(t *testing.T) { return part, nil } - state, err := sm.MakeGenesisStateFromFile(cfg.GenesisFile()) + state, err := sm.MakeGenesisStateFromFile(config.GenesisFile()) require.NoError(t, err) // Initially no contents.