Merge branch 'develop' into config

This commit is contained in:
Zach
2018-01-06 05:30:38 +00:00
committed by GitHub
51 changed files with 2152 additions and 1328 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
cmn "github.com/tendermint/tmlibs/common"
)
@@ -336,8 +337,7 @@ func BlockResults(heightPtr *int64) (*ctypes.ResultBlockResults, error) {
}
// load the results
state := consensusState.GetState()
results, err := state.LoadABCIResponses(height)
results, err := sm.LoadABCIResponses(stateDB, height)
if err != nil {
return nil, err
}

View File

@@ -4,6 +4,7 @@ import (
cm "github.com/tendermint/tendermint/consensus"
cstypes "github.com/tendermint/tendermint/consensus/types"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
)
@@ -49,8 +50,7 @@ func Validators(heightPtr *int64) (*ctypes.ResultValidators, error) {
return nil, err
}
state := consensusState.GetState()
validators, err := state.LoadValidators(height)
validators, err := sm.LoadValidators(stateDB, height)
if err != nil {
return nil, err
}

View File

@@ -11,6 +11,7 @@ import (
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
)
@@ -20,7 +21,7 @@ var subscribeTimeout = 5 * time.Second
// These interfaces are used by RPC and must be thread safe
type Consensus interface {
GetState() *sm.State
GetState() sm.State
GetValidators() (int64, []*types.Validator)
GetRoundState() *cstypes.RoundState
}
@@ -43,6 +44,7 @@ var (
proxyAppQuery proxy.AppConnQuery
// interfaces defined in types and above
stateDB dbm.DB
blockStore types.BlockStore
mempool types.Mempool
evidencePool types.EvidencePool
@@ -60,6 +62,10 @@ var (
logger log.Logger
)
func SetStateDB(db dbm.DB) {
stateDB = db
}
func SetBlockStore(bs types.BlockStore) {
blockStore = bs
}