Skip to content
Permalink
Browse files

bump tendermint: v0.16.0

  • Loading branch information...
boz committed Mar 8, 2018
1 parent 0cfdac9 commit ce720c089ad2f33408abe32ac514a29a81f6a3c1
@@ -13,17 +13,20 @@ do_node(){

do_send(){
node=$(do_node)
export PHOTON_NODE=$node
../photon send 100 $(cat data/other.key) -k master -n "$node" -d "$DATA"
}

do_query(){
key=${1:-master}
node=$(do_node)
export PHOTON_NODE=$node
../photon query account $(cat "data/$key.key") -n "$node" -d "$DATA"
}

do_ping(){
node=$(do_node)
export PHOTON_NODE=$node
../photon ping -n "$node" -d "$DATA"
}

@@ -206,19 +206,17 @@ func (app *app) EndBlock(req tmtypes.RequestEndBlock) tmtypes.ResponseEndBlock {
func (app *app) Commit() tmtypes.ResponseCommit {
app.trace("Commit")

version := app.state.Version()

data, err := app.state.Commit(version + 1)
data, _, err := app.state.Commit()

if err != nil {
return tmtypes.ResponseCommit{Data: data, Code: code.ERROR, Log: err.Error()}
return tmtypes.ResponseCommit{Data: data}
}

if app.mfacilitator != nil {
app.mfacilitator.OnCommit(app.state)
}

return tmtypes.ResponseCommit{Code: tmtypes.CodeTypeOK, Data: data}
return tmtypes.ResponseCommit{Data: data}
}

func (app *app) appForTx(buf []byte) (
@@ -135,7 +135,7 @@ func (f *facilitator) checkCommit(state state.State) bool {
return false
}

if uint64(f.rs.Height) != state.Version() {
if f.rs.Height != state.Version() {
return false
}

@@ -50,9 +50,9 @@ func TestStoreApp(t *testing.T) {
acc := new(types.Account)
acc.Unmarshal(resp.Value)
assert.True(t, resp.IsOK())
assert.Equal(t, key, resp.Key.Bytes())
assert.Equal(t, key, resp.Key)
assert.Equal(t, balance, acc.Balance)
assert.Empty(t, resp.Proof.Bytes())
assert.Empty(t, resp.Proof)
}

{
@@ -65,9 +65,9 @@ func TestStoreApp(t *testing.T) {
acc := new(types.Account)
acc.Unmarshal(resp.Value)
assert.True(t, resp.IsOK())
assert.Equal(t, key, resp.Key.Bytes())
assert.Equal(t, key, resp.Key)
assert.Equal(t, balance, acc.Balance)
assert.NotEmpty(t, resp.Proof.Bytes())
assert.NotEmpty(t, resp.Proof)
}

{
@@ -78,7 +78,7 @@ func TestStoreApp(t *testing.T) {
})
assert.False(t, resp.IsOK())
assert.Nil(t, resp.Key)
assert.Empty(t, resp.Proof.Bytes())
assert.Empty(t, resp.Proof)
}

{
@@ -89,8 +89,8 @@ func TestStoreApp(t *testing.T) {
})
assert.True(t, resp.IsOK())
assert.Empty(t, resp.Value)
assert.Equal(t, key, resp.Key.Bytes())
assert.Empty(t, resp.Proof.Bytes())
assert.Equal(t, key, resp.Key)
assert.Empty(t, resp.Proof)
}

{
@@ -1,7 +1,7 @@
package types

import (
tmtypes "github.com/tendermint/abci/types"
tmcommon "github.com/tendermint/tmlibs/common"
)

const (
@@ -21,17 +21,24 @@ const (
TxTypeDatacenterCreate = "datacenter-create"
)

func NewTagApp(name string) *tmtypes.KVPair {
return tmtypes.KVPairString(TagNameApp, name)
func NewTagApp(name string) tmcommon.KVPair {
return kvPair(TagNameApp, name)
}

func NewTagTxType(name string) *tmtypes.KVPair {
return tmtypes.KVPairString(TagNameTxType, name)
func NewTagTxType(name string) tmcommon.KVPair {
return kvPair(TagNameTxType, name)
}

func NewTags(appName, txType string) []*tmtypes.KVPair {
return []*tmtypes.KVPair{
func NewTags(appName, txType string) []tmcommon.KVPair {
return []tmcommon.KVPair{
NewTagApp(appName),
NewTagTxType(txType),
}
}

func kvPair(k, v string) tmcommon.KVPair {
return tmcommon.KVPair{
Key: []byte(k),
Value: []byte(v),
}
}
@@ -105,10 +105,10 @@ func doCreateDatacenterCommand(ctx context.Context, cmd *cobra.Command, args []s
return err
}
if result.CheckTx.IsErr() {
return errors.New(result.CheckTx.Error())
return errors.New(result.CheckTx.GetLog())
}
if result.DeliverTx.IsErr() {
return errors.New(result.DeliverTx.Error())
return errors.New(result.DeliverTx.GetLog())
}

fmt.Println("Created datacenter: " + strings.ToUpper(hex.EncodeToString(datacenter.Address)))
@@ -33,9 +33,12 @@ func QueryCommand() *cobra.Command {
func doQuery(ctx context.Context, path string, structure interface{}) error {

client := tmclient.NewHTTP(ctx.Node(), "/websocket")
result, _ := client.ABCIQuery(path, nil)
result, err := client.ABCIQuery(path, nil)
if err != nil {
return err
}
if result.Response.IsErr() {
return errors.New(result.Response.Error())
return errors.New(result.Response.GetLog())
}

switch s := structure.(type) {

Some generated files are not rendered by default. Learn more.

@@ -10,37 +10,34 @@ import:
- package: github.com/spf13/viper
version: master
- package: github.com/tendermint/abci
version: master
subpackages:
- types
- package: github.com/tendermint/go-crypto
version: master
subpackages:
- keys
- keys/cryptostore
- keys/storage/filestorage
- package: github.com/tendermint/go-wire
version: master
subpackages:
- data
- package: github.com/tendermint/iavl
- package: github.com/tendermint/tendermint
version: master
version: ^0.16.0
subpackages:
- config
- node
- proxy
- rpc/core/types
- types
- package: github.com/tendermint/tmlibs
version: master
subpackages:
- db
- log
- package: github.com/stretchr/testify
version: ^1.2.1
subpackages:
- require
- assert
- package: github.com/rcrowley/go-metrics
- package: github.com/ethanfrey/hid
version: master

0 comments on commit ce720c0

Please sign in to comment.
You can’t perform that action at this time.