diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c9c9e79..3ed5ce80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ BUG FIXES: - Graceful handling/recovery for apps that have non-determinism or fail to halt - Graceful handling/recovery for violations of safety, or liveness -## 0.13.0 (TBA) +## 0.13.0 (December 6, 2017) BREAKING CHANGES: - abci: update to v0.8 using gogo/protobuf; includes tx tags, vote info in RequestBeginBlock, data.Bytes everywhere, use int64, etc. @@ -38,6 +38,7 @@ BREAKING CHANGES: - rpc/client: WaitForOneEvent takes an EventsClient instead of types.EventSwitch - rpc/client: Add/RemoveListenerForEvent are now Subscribe/Unsubscribe - rpc: `/subscribe` and `/unsubscribe` take `query` arg instead of `event` +- rpc/core/types: ResultABCIQuery wraps an abci.ResponseQuery - mempool: cached transactions return an error instead of an ABCI response with BadNonce FEATURES: diff --git a/benchmarks/codec_test.go b/benchmarks/codec_test.go index 3650d281..631b303e 100644 --- a/benchmarks/codec_test.go +++ b/benchmarks/codec_test.go @@ -2,9 +2,11 @@ package benchmarks import ( "testing" + "time" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" + proto "github.com/tendermint/tendermint/benchmarks/proto" "github.com/tendermint/tendermint/p2p" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -26,7 +28,7 @@ func BenchmarkEncodeStatusWire(b *testing.B) { PubKey: pubKey, LatestBlockHash: []byte("SOMEBYTES"), LatestBlockHeight: 123, - LatestBlockTime: 1234, + LatestBlockTime: time.Unix(0, 1234), } b.StartTimer() diff --git a/glide.lock b/glide.lock index f637dcce..82846067 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 09fc7f59ca6b718fe236368bb55f4801455295cfe455ea5865d544ee4dcfdc08 -updated: 2017-12-06T02:43:52.419328535-05:00 +updated: 2017-12-06T03:31:34.476581624-05:00 imports: - name: github.com/btcsuite/btcd version: 2e60448ffcc6bf78332d1fe590260095f554dd78 @@ -103,7 +103,7 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/abci - version: 12dca48768bbc0ac0f345a8505166874daf1f8ec + version: fca2b508c185b855af1446ec4afc19bdfc7b315d subpackages: - client - example/code diff --git a/rpc/client/mock/abci.go b/rpc/client/mock/abci.go index ad528efc..4593d059 100644 --- a/rpc/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -32,7 +32,7 @@ func (a ABCIApp) ABCIQuery(path string, data data.Bytes) (*ctypes.ResultABCIQuer func (a ABCIApp) ABCIQueryWithOptions(path string, data data.Bytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) { q := a.App.Query(abci.RequestQuery{data, path, opts.Height, opts.Trusted}) - return &ctypes.ResultABCIQuery{&q}, nil + return &ctypes.ResultABCIQuery{q}, nil } func (a ABCIApp) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { @@ -91,7 +91,7 @@ func (m ABCIMock) ABCIQueryWithOptions(path string, data data.Bytes, opts client return nil, err } resQuery := res.(abci.ResponseQuery) - return &ctypes.ResultABCIQuery{&resQuery}, nil + return &ctypes.ResultABCIQuery{resQuery}, nil } func (m ABCIMock) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { diff --git a/rpc/client/mock/abci_test.go b/rpc/client/mock/abci_test.go index 773297c8..0f83cc5f 100644 --- a/rpc/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -51,7 +51,8 @@ func TestABCIMock(t *testing.T) { assert.Equal("foobar", err.Error()) // query always returns the response - query, err := m.ABCIQueryWithOptions("/", nil, client.ABCIQueryOptions{Trusted: true}) + _query, err := m.ABCIQueryWithOptions("/", nil, client.ABCIQueryOptions{Trusted: true}) + query := _query.Response require.Nil(err) require.NotNil(query) assert.EqualValues(key, query.Key) @@ -173,7 +174,8 @@ func TestABCIApp(t *testing.T) { assert.True(res.DeliverTx.IsOK()) // check the key - qres, err := m.ABCIQueryWithOptions("/key", data.Bytes(key), client.ABCIQueryOptions{Trusted: true}) + _qres, err := m.ABCIQueryWithOptions("/key", data.Bytes(key), client.ABCIQueryOptions{Trusted: true}) + qres := _qres.Response require.Nil(err) assert.EqualValues(value, qres.Value) } diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 06183b9f..c32d08bd 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -111,7 +111,8 @@ func TestABCIQuery(t *testing.T) { // wait before querying client.WaitForHeight(c, apph, nil) - qres, err := c.ABCIQuery("/key", k) + res, err := c.ABCIQuery("/key", k) + qres := res.Response if assert.Nil(t, err) && assert.True(t, qres.IsOK()) { assert.EqualValues(t, v, qres.Value) } @@ -146,7 +147,8 @@ func TestAppCalls(t *testing.T) { if err := client.WaitForHeight(c, apph, nil); err != nil { t.Error(err) } - qres, err := c.ABCIQueryWithOptions("/key", k, client.ABCIQueryOptions{Trusted: true}) + _qres, err := c.ABCIQueryWithOptions("/key", k, client.ABCIQueryOptions{Trusted: true}) + qres := _qres.Response if assert.Nil(err) && assert.True(qres.IsOK()) { // assert.Equal(k, data.GetKey()) // only returned for proofs assert.EqualValues(v, qres.Value) @@ -194,7 +196,8 @@ func TestAppCalls(t *testing.T) { assert.Equal(block.Block.LastCommit, commit2.Commit) // and we got a proof that works! - pres, err := c.ABCIQueryWithOptions("/key", k, client.ABCIQueryOptions{Trusted: false}) + _pres, err := c.ABCIQueryWithOptions("/key", k, client.ABCIQueryOptions{Trusted: false}) + pres := _pres.Response if assert.Nil(err) && assert.True(pres.IsOK()) { proof, err := iavl.ReadKeyExistsProof(pres.Proof) if assert.Nil(err) { diff --git a/rpc/core/abci.go b/rpc/core/abci.go index 2fe7214a..a49b52b6 100644 --- a/rpc/core/abci.go +++ b/rpc/core/abci.go @@ -58,9 +58,7 @@ func ABCIQuery(path string, data data.Bytes, height int64, trusted bool) (*ctype return nil, err } logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery) - return &ctypes.ResultABCIQuery{ - resQuery, - }, nil + return &ctypes.ResultABCIQuery{*resQuery}, nil } // Get some info about the application. diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 08ddf659..3d1e7a21 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -53,7 +53,7 @@ type ResultStatus struct { LatestBlockHash data.Bytes `json:"latest_block_hash"` LatestAppHash data.Bytes `json:"latest_app_hash"` LatestBlockHeight int64 `json:"latest_block_height"` - LatestBlockTime time.Time `json:"latest_block_time"` // nano + LatestBlockTime time.Time `json:"latest_block_time"` Syncing bool `json:"syncing"` } @@ -129,7 +129,7 @@ type ResultABCIInfo struct { } type ResultABCIQuery struct { - *abci.ResponseQuery `json:"response"` + Response abci.ResponseQuery `json:"response"` } type ResultUnsafeFlushMempool struct{} diff --git a/version/version.go b/version/version.go index aa2ebbeb..54081b35 100644 --- a/version/version.go +++ b/version/version.go @@ -1,13 +1,13 @@ package version const Maj = "0" -const Min = "12" -const Fix = "1" +const Min = "13" +const Fix = "0" var ( // Version is the current version of Tendermint // Must be a string because scripts like dist.sh read this file. - Version = "0.12.1" + Version = "0.13.0" // GitCommit is the current HEAD set using ldflags. GitCommit string