mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-10 05:50:19 +00:00
state: Rename LoadBlockExtCommit to LoadBlockExtendedCommit
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -186,7 +186,7 @@ func (r *Reactor) OnStop() {
|
||||
func (r *Reactor) respondToPeer(ctx context.Context, msg *bcproto.BlockRequest, peerID types.NodeID, blockSyncCh *p2p.Channel) error {
|
||||
block := r.store.LoadBlock(msg.Height)
|
||||
if block != nil {
|
||||
extCommit := r.store.LoadBlockExtCommit(msg.Height)
|
||||
extCommit := r.store.LoadBlockExtendedCommit(msg.Height)
|
||||
if extCommit == nil {
|
||||
return fmt.Errorf("blockstore has block but not extended commit (block: %v)", block)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
testing "testing"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
state "github.com/tendermint/tendermint/internal/state"
|
||||
)
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ func (r *Reactor) gossipVotesRoutine(ctx context.Context, ps *PeerState, voteCh
|
||||
if blockStoreBase > 0 && prs.Height != 0 && rs.Height >= prs.Height+2 && prs.Height >= blockStoreBase {
|
||||
// Load the block's extended commit for prs.Height, which contains precommit
|
||||
// signatures for prs.Height.
|
||||
if ec := r.state.blockStore.LoadBlockExtCommit(prs.Height); ec != nil {
|
||||
if ec := r.state.blockStore.LoadBlockExtendedCommit(prs.Height); ec != nil {
|
||||
if ok, err := r.pickSendVote(ctx, ps, ec, voteCh); err != nil {
|
||||
return
|
||||
} else if ok {
|
||||
|
||||
@@ -578,11 +578,11 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
|
||||
}
|
||||
ensureNewRound(t, newRoundCh, height+1, 0)
|
||||
|
||||
sim.Chain = make([]*types.Block, 0)
|
||||
sim.ExtCommits = make([]*types.ExtendedCommit, 0)
|
||||
sim.Chain = []*types.Block{}
|
||||
sim.ExtCommits = []*types.ExtendedCommit{}
|
||||
for i := 1; i <= numBlocks; i++ {
|
||||
sim.Chain = append(sim.Chain, css[0].blockStore.LoadBlock(int64(i)))
|
||||
sim.ExtCommits = append(sim.ExtCommits, css[0].blockStore.LoadBlockExtCommit(int64(i)))
|
||||
sim.ExtCommits = append(sim.ExtCommits, css[0].blockStore.LoadBlockExtendedCommit(int64(i)))
|
||||
}
|
||||
|
||||
return sim
|
||||
@@ -1209,7 +1209,7 @@ func (bs *mockBlockStore) LoadBlockCommit(height int64) *types.Commit {
|
||||
func (bs *mockBlockStore) LoadSeenCommit() *types.Commit {
|
||||
return bs.extCommits[len(bs.extCommits)-1].StripExtensions()
|
||||
}
|
||||
func (bs *mockBlockStore) LoadBlockExtCommit(height int64) *types.ExtendedCommit {
|
||||
func (bs *mockBlockStore) LoadBlockExtendedCommit(height int64) *types.ExtendedCommit {
|
||||
return bs.extCommits[height-1]
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ func (cs *State) sendInternalMessage(ctx context.Context, mi msgInfo) {
|
||||
// Reconstruct LastCommit from SeenCommit, which we saved along with the block,
|
||||
// (which happens even before saving the state)
|
||||
func (cs *State) reconstructLastCommit(state sm.State) {
|
||||
extCommit := cs.blockStore.LoadBlockExtCommit(state.LastBlockHeight)
|
||||
extCommit := cs.blockStore.LoadBlockExtendedCommit(state.LastBlockHeight)
|
||||
if extCommit == nil {
|
||||
panic(fmt.Sprintf(
|
||||
"failed to reconstruct last commit; commit for height %v not found",
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
indexer "github.com/tendermint/tendermint/internal/state/indexer"
|
||||
|
||||
query "github.com/tendermint/tendermint/internal/pubsub/query"
|
||||
|
||||
@@ -107,8 +107,8 @@ func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit {
|
||||
return r0
|
||||
}
|
||||
|
||||
// LoadBlockExtCommit provides a mock function with given fields: height
|
||||
func (_m *BlockStore) LoadBlockExtCommit(height int64) *types.ExtendedCommit {
|
||||
// LoadBlockExtendedCommit provides a mock function with given fields: height
|
||||
func (_m *BlockStore) LoadBlockExtendedCommit(height int64) *types.ExtendedCommit {
|
||||
ret := _m.Called(height)
|
||||
|
||||
var r0 *types.ExtendedCommit
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
state "github.com/tendermint/tendermint/internal/state"
|
||||
|
||||
testing "testing"
|
||||
|
||||
@@ -4,7 +4,6 @@ package mocks
|
||||
|
||||
import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
state "github.com/tendermint/tendermint/internal/state"
|
||||
tendermintstate "github.com/tendermint/tendermint/proto/tendermint/state"
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ type BlockStore interface {
|
||||
|
||||
LoadBlockCommit(height int64) *types.Commit
|
||||
LoadSeenCommit() *types.Commit
|
||||
LoadBlockExtCommit(height int64) *types.ExtendedCommit
|
||||
LoadBlockExtendedCommit(height int64) *types.ExtendedCommit
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
state "github.com/tendermint/tendermint/internal/state"
|
||||
|
||||
testing "testing"
|
||||
|
||||
@@ -278,7 +278,7 @@ func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit {
|
||||
return commit
|
||||
}
|
||||
|
||||
func (bs *BlockStore) LoadBlockExtCommit(height int64) *types.ExtendedCommit {
|
||||
func (bs *BlockStore) LoadBlockExtendedCommit(height int64) *types.ExtendedCommit {
|
||||
var pbec = new(tmproto.ExtendedCommit)
|
||||
bz, err := bs.db.Get(extCommitKey(height))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user