From eb98f1c3a98a8eba7ed5d0573f1c4eed69f990c6 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 03:16:18 +0400 Subject: [PATCH] add missing changelog entries (#2224) --- CHANGELOG_PENDING.md | 6 ++++-- scripts/json2wal/main.go | 28 +++++++++++++--------------- scripts/wal2json/main.go | 2 +- types/genesis_test.go | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 12de0034..305c25b2 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -10,15 +10,17 @@ BREAKING CHANGES: - [abci] Added address of the original proposer of the block to Header. - [abci] Change ABCI Header to match Tendermint exactly - [libs] Remove cmn.Fmt, in favor of fmt.Sprintf +- [blockchain] fix go-amino routes for blockchain messages - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers FEATURES: +- [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) IMPROVEMENTS: - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) BUG FIXES: -- [mempool] No longer possible to fill up linked list without getting caching -benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) \ No newline at end of file +- [mempool] No longer possible to fill up linked list without getting caching + benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go index 9b593f89..acf58603 100644 --- a/scripts/json2wal/main.go +++ b/scripts/json2wal/main.go @@ -8,13 +8,13 @@ package main import ( - "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/types" - cs "github.com/tendermint/tendermint/consensus" - "fmt" - "os" - "io" "bufio" + "fmt" + "github.com/tendermint/go-amino" + cs "github.com/tendermint/tendermint/consensus" + "github.com/tendermint/tendermint/types" + "io" + "os" "strings" ) @@ -26,7 +26,6 @@ func init() { types.RegisterBlockAmino(cdc) } - func main() { if len(os.Args) < 3 { fmt.Fprintln(os.Stderr, "missing arguments: Usage:json2wal ") @@ -39,7 +38,7 @@ func main() { } defer f.Close() - walFile, err := os.OpenFile(os.Args[2],os.O_EXCL|os.O_WRONLY|os.O_CREATE,0666) + walFile, err := os.OpenFile(os.Args[2], os.O_EXCL|os.O_WRONLY|os.O_CREATE, 0666) if err != nil { panic(fmt.Errorf("failed to open WAL file: %v", err)) } @@ -50,26 +49,25 @@ func main() { for { msgJson, _, err := br.ReadLine() - if err == io.EOF{ + if err == io.EOF { break - }else if err != nil { + } else if err != nil { panic(fmt.Errorf("failed to read file: %v", err)) } // ignore the ENDHEIGHT in json.File - if strings.HasPrefix(string(msgJson),"ENDHEIGHT"){ + if strings.HasPrefix(string(msgJson), "ENDHEIGHT") { continue } var msg cs.TimedWALMessage - err = cdc.UnmarshalJSON(msgJson,&msg) - if err != nil{ + err = cdc.UnmarshalJSON(msgJson, &msg) + if err != nil { panic(fmt.Errorf("failed to unmarshal json: %v", err)) } err = dec.Encode(&msg) - if err != nil{ + if err != nil { panic(fmt.Errorf("failed to encode msg: %v", err)) } } } - diff --git a/scripts/wal2json/main.go b/scripts/wal2json/main.go index 80181bb1..cf8ae86c 100644 --- a/scripts/wal2json/main.go +++ b/scripts/wal2json/main.go @@ -12,8 +12,8 @@ import ( "io" "os" - cs "github.com/tendermint/tendermint/consensus" "github.com/tendermint/go-amino" + cs "github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/types" ) diff --git a/types/genesis_test.go b/types/genesis_test.go index fb981e9c..50134d03 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -64,10 +64,10 @@ func TestGenesisGood(t *testing.T) { // Genesis doc from raw json missingValidatorsTestCases := [][]byte{ - []byte(`{"chain_id":"mychain"}`), // missing validators - []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators + []byte(`{"chain_id":"mychain"}`), // missing validators + []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators []byte(`{"chain_id":"mychain","validators":null}`), // nil validator - []byte(`{"chain_id":"mychain"}`), // missing validators + []byte(`{"chain_id":"mychain"}`), // missing validators } for _, tc := range missingValidatorsTestCases {