mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 07:12:16 +00:00
update to latest amino (pre) release v0.11.1
- also reformat code and order imports
This commit is contained in:
parent
d665c79cc9
commit
2744682e77
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/tendermint/go-amino"
|
name = "github.com/tendermint/go-amino"
|
||||||
version = "=0.10.1"
|
version = "=v0.11.1"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "google.golang.org/grpc"
|
name = "google.golang.org/grpc"
|
||||||
|
@ -2,10 +2,12 @@ package types
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
"github.com/tendermint/tendermint/types/proto3"
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/tendermint/tendermint/types/proto3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestProto3Compatibility(t *testing.T) {
|
func TestProto3Compatibility(t *testing.T) {
|
||||||
@ -15,12 +17,12 @@ func TestProto3Compatibility(t *testing.T) {
|
|||||||
nanos := int32(tm.Nanosecond())
|
nanos := int32(tm.Nanosecond())
|
||||||
pbHeader := proto3.Header{
|
pbHeader := proto3.Header{
|
||||||
ChainID: "cosmos",
|
ChainID: "cosmos",
|
||||||
Height:150,
|
Height: 150,
|
||||||
Time: &proto3.Timestamp{Seconds:seconds, Nanos:nanos},
|
Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos},
|
||||||
NumTxs: 7,
|
NumTxs: 7,
|
||||||
LastBlockID: &proto3.BlockID{
|
LastBlockID: &proto3.BlockID{
|
||||||
Hash: []byte("some serious hashing"),
|
Hash: []byte("some serious hashing"),
|
||||||
PartsHeader:&proto3.PartSetHeader{
|
PartsHeader: &proto3.PartSetHeader{
|
||||||
Total: 8,
|
Total: 8,
|
||||||
Hash: []byte("some more serious hashing"),
|
Hash: []byte("some more serious hashing"),
|
||||||
},
|
},
|
||||||
@ -28,12 +30,11 @@ func TestProto3Compatibility(t *testing.T) {
|
|||||||
TotalTxs: 100,
|
TotalTxs: 100,
|
||||||
LastCommitHash: []byte("commit hash"),
|
LastCommitHash: []byte("commit hash"),
|
||||||
DataHash: []byte("data hash"),
|
DataHash: []byte("data hash"),
|
||||||
ValidatorsHash:[]byte("validators hash"),
|
ValidatorsHash: []byte("validators hash"),
|
||||||
|
|
||||||
}
|
}
|
||||||
aminoHeader := Header{
|
aminoHeader := Header{
|
||||||
ChainID: "cosmos",
|
ChainID: "cosmos",
|
||||||
Height:150,
|
Height: 150,
|
||||||
Time: tm,
|
Time: tm,
|
||||||
NumTxs: 7,
|
NumTxs: 7,
|
||||||
LastBlockID: BlockID{
|
LastBlockID: BlockID{
|
||||||
@ -46,7 +47,7 @@ func TestProto3Compatibility(t *testing.T) {
|
|||||||
TotalTxs: 100,
|
TotalTxs: 100,
|
||||||
LastCommitHash: []byte("commit hash"),
|
LastCommitHash: []byte("commit hash"),
|
||||||
DataHash: []byte("data hash"),
|
DataHash: []byte("data hash"),
|
||||||
ValidatorsHash:[]byte("validators hash"),
|
ValidatorsHash: []byte("validators hash"),
|
||||||
}
|
}
|
||||||
ab, err := cdc.MarshalBinaryBare(aminoHeader)
|
ab, err := cdc.MarshalBinaryBare(aminoHeader)
|
||||||
assert.NoError(t, err, "unexpected error")
|
assert.NoError(t, err, "unexpected error")
|
||||||
@ -58,8 +59,8 @@ func TestProto3Compatibility(t *testing.T) {
|
|||||||
|
|
||||||
emptyLastBlockPb := proto3.Header{
|
emptyLastBlockPb := proto3.Header{
|
||||||
ChainID: "cosmos",
|
ChainID: "cosmos",
|
||||||
Height:150,
|
Height: 150,
|
||||||
Time: &proto3.Timestamp{Seconds:seconds, Nanos:nanos},
|
Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos},
|
||||||
NumTxs: 7,
|
NumTxs: 7,
|
||||||
// TODO(ismail): as Jae suggested, we'll add a flag to make this obsolete:
|
// TODO(ismail): as Jae suggested, we'll add a flag to make this obsolete:
|
||||||
LastBlockID: &proto3.BlockID{
|
LastBlockID: &proto3.BlockID{
|
||||||
@ -68,18 +69,17 @@ func TestProto3Compatibility(t *testing.T) {
|
|||||||
TotalTxs: 100,
|
TotalTxs: 100,
|
||||||
LastCommitHash: []byte("commit hash"),
|
LastCommitHash: []byte("commit hash"),
|
||||||
DataHash: []byte("data hash"),
|
DataHash: []byte("data hash"),
|
||||||
ValidatorsHash:[]byte("validators hash"),
|
ValidatorsHash: []byte("validators hash"),
|
||||||
|
|
||||||
}
|
}
|
||||||
emptyLastBlockAm := Header{
|
emptyLastBlockAm := Header{
|
||||||
ChainID: "cosmos",
|
ChainID: "cosmos",
|
||||||
Height:150,
|
Height: 150,
|
||||||
Time: tm,
|
Time: tm,
|
||||||
NumTxs: 7,
|
NumTxs: 7,
|
||||||
TotalTxs: 100,
|
TotalTxs: 100,
|
||||||
LastCommitHash: []byte("commit hash"),
|
LastCommitHash: []byte("commit hash"),
|
||||||
DataHash: []byte("data hash"),
|
DataHash: []byte("data hash"),
|
||||||
ValidatorsHash:[]byte("validators hash"),
|
ValidatorsHash: []byte("validators hash"),
|
||||||
}
|
}
|
||||||
|
|
||||||
ab, err = cdc.MarshalBinaryBare(emptyLastBlockAm)
|
ab, err = cdc.MarshalBinaryBare(emptyLastBlockAm)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user