From 2744682e77c7bb035a8dc53ab4e8c0daf590b540 Mon Sep 17 00:00:00 2001 From: Liamsi Date: Wed, 18 Jul 2018 15:53:53 +0200 Subject: [PATCH] update to latest amino (pre) release v0.11.1 - also reformat code and order imports --- Gopkg.toml | 2 +- types/proto3_test.go | 66 ++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index 19fa68944..09ba364cc 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -63,7 +63,7 @@ [[constraint]] name = "github.com/tendermint/go-amino" - version = "=0.10.1" + version = "=v0.11.1" [[constraint]] name = "google.golang.org/grpc" diff --git a/types/proto3_test.go b/types/proto3_test.go index ba5fe4902..c19296cad 100644 --- a/types/proto3_test.go +++ b/types/proto3_test.go @@ -2,10 +2,12 @@ package types import ( "testing" - "github.com/tendermint/tendermint/types/proto3" - "github.com/stretchr/testify/assert" - "github.com/golang/protobuf/proto" "time" + + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + + "github.com/tendermint/tendermint/types/proto3" ) func TestProto3Compatibility(t *testing.T) { @@ -15,38 +17,37 @@ func TestProto3Compatibility(t *testing.T) { nanos := int32(tm.Nanosecond()) pbHeader := proto3.Header{ ChainID: "cosmos", - Height:150, - Time: &proto3.Timestamp{Seconds:seconds, Nanos:nanos}, - NumTxs: 7, + Height: 150, + Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos}, + NumTxs: 7, LastBlockID: &proto3.BlockID{ Hash: []byte("some serious hashing"), - PartsHeader:&proto3.PartSetHeader{ + PartsHeader: &proto3.PartSetHeader{ Total: 8, - Hash: []byte("some more serious hashing"), + Hash: []byte("some more serious hashing"), }, }, - TotalTxs: 100, + TotalTxs: 100, LastCommitHash: []byte("commit hash"), - DataHash: []byte("data hash"), - ValidatorsHash:[]byte("validators hash"), - + DataHash: []byte("data hash"), + ValidatorsHash: []byte("validators hash"), } aminoHeader := Header{ ChainID: "cosmos", - Height:150, - Time: tm, - NumTxs: 7, + Height: 150, + Time: tm, + NumTxs: 7, LastBlockID: BlockID{ Hash: []byte("some serious hashing"), PartsHeader: PartSetHeader{ Total: 8, - Hash: []byte("some more serious hashing"), + Hash: []byte("some more serious hashing"), }, }, - TotalTxs: 100, + TotalTxs: 100, LastCommitHash: []byte("commit hash"), - DataHash: []byte("data hash"), - ValidatorsHash:[]byte("validators hash"), + DataHash: []byte("data hash"), + ValidatorsHash: []byte("validators hash"), } ab, err := cdc.MarshalBinaryBare(aminoHeader) assert.NoError(t, err, "unexpected error") @@ -58,28 +59,27 @@ func TestProto3Compatibility(t *testing.T) { emptyLastBlockPb := proto3.Header{ ChainID: "cosmos", - Height:150, - Time: &proto3.Timestamp{Seconds:seconds, Nanos:nanos}, - NumTxs: 7, + Height: 150, + Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos}, + NumTxs: 7, // TODO(ismail): as Jae suggested, we'll add a flag to make this obsolete: LastBlockID: &proto3.BlockID{ PartsHeader: &proto3.PartSetHeader{}, }, - TotalTxs: 100, + TotalTxs: 100, LastCommitHash: []byte("commit hash"), - DataHash: []byte("data hash"), - ValidatorsHash:[]byte("validators hash"), - + DataHash: []byte("data hash"), + ValidatorsHash: []byte("validators hash"), } emptyLastBlockAm := Header{ - ChainID: "cosmos", - Height:150, - Time: tm, - NumTxs: 7, - TotalTxs: 100, + ChainID: "cosmos", + Height: 150, + Time: tm, + NumTxs: 7, + TotalTxs: 100, LastCommitHash: []byte("commit hash"), - DataHash: []byte("data hash"), - ValidatorsHash:[]byte("validators hash"), + DataHash: []byte("data hash"), + ValidatorsHash: []byte("validators hash"), } ab, err = cdc.MarshalBinaryBare(emptyLastBlockAm)