mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 14:34:17 +00:00
state: proto migration (#4951)
This commit is contained in:
+2
-3
@@ -19,7 +19,6 @@ import (
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/tendermint/version"
|
||||
)
|
||||
|
||||
var crc32c = crc32.MakeTable(crc32.Castagnoli)
|
||||
@@ -259,8 +258,8 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
|
||||
)
|
||||
|
||||
// Set AppVersion on the state.
|
||||
if h.initialState.Version.Consensus.App != version.Protocol(res.AppVersion) {
|
||||
h.initialState.Version.Consensus.App = version.Protocol(res.AppVersion)
|
||||
if h.initialState.Version.Consensus.App != res.AppVersion {
|
||||
h.initialState.Version.Consensus.App = res.AppVersion
|
||||
sm.SaveState(h.stateDB, h.initialState)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import (
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/tendermint/version"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@@ -1086,7 +1085,7 @@ func readPieceFromWAL(msg *TimedWALMessage) interface{} {
|
||||
func stateAndStore(
|
||||
config *cfg.Config,
|
||||
pubKey crypto.PubKey,
|
||||
appVersion version.Protocol) (dbm.DB, sm.State, *mockBlockStore) {
|
||||
appVersion uint64) (dbm.DB, sm.State, *mockBlockStore) {
|
||||
stateDB := dbm.NewMemDB()
|
||||
state, _ := sm.MakeGenesisStateFromFile(config.GenesisFile())
|
||||
state.Version.Consensus.App = appVersion
|
||||
|
||||
Reference in New Issue
Block a user