state: proto migration (#4951)

This commit is contained in:
Marko
2020-06-05 10:47:16 +02:00
committed by GitHub
parent ee91312d34
commit b9af87c4ea
45 changed files with 5222 additions and 1471 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ var (
stateKey = []byte("stateKey")
kvPairPrefixKey = []byte("kvPairKey:")
ProtocolVersion version.Protocol = 0x1
ProtocolVersion uint64 = 0x1
)
type State struct {
@@ -76,7 +76,7 @@ func (app *Application) Info(req types.RequestInfo) (resInfo types.ResponseInfo)
return types.ResponseInfo{
Data: fmt.Sprintf("{\"size\":%v}", app.state.Size),
Version: version.ABCIVersion,
AppVersion: ProtocolVersion.Uint64(),
AppVersion: ProtocolVersion,
LastBlockHeight: app.state.Height,
LastBlockAppHash: app.state.AppHash,
}
+5 -4
View File
@@ -16,6 +16,7 @@ import (
"github.com/tendermint/tendermint/abci/example/code"
abciserver "github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/types"
)
const (
@@ -103,7 +104,7 @@ func TestPersistentKVStoreInfo(t *testing.T) {
// make and apply block
height = int64(1)
hash := []byte("foo")
header := types.Header{
header := tmproto.Header{
Height: height,
}
kvstore.BeginBlock(types.RequestBeginBlock{Hash: hash, Header: header})
@@ -193,7 +194,7 @@ func makeApplyBlock(
// make and apply block
height := int64(heightInt)
hash := []byte("foo")
header := types.Header{
header := tmproto.Header{
Height: height,
}
@@ -273,7 +274,7 @@ func TestClientServer(t *testing.T) {
// set up socket app
kvstore := NewApplication()
client, server, err := makeSocketClientServer(kvstore, "kvstore-socket")
require.Nil(t, err)
require.NoError(t, err)
defer server.Stop()
defer client.Stop()
@@ -282,7 +283,7 @@ func TestClientServer(t *testing.T) {
// set up grpc app
kvstore = NewApplication()
gclient, gserver, err := makeGRPCClientServer(kvstore, "kvstore-grpc")
require.Nil(t, err)
require.NoError(t, err)
defer gserver.Stop()
defer gclient.Stop()