From 91e02be28118b217d19fabe65cc01992e8837973 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Mon, 26 Nov 2018 17:58:02 +0800 Subject: dex: fix tests --- dex/protocol_test.go | 56 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) (limited to 'dex/protocol_test.go') diff --git a/dex/protocol_test.go b/dex/protocol_test.go index 64d7fa3e7..c2f9c00b2 100644 --- a/dex/protocol_test.go +++ b/dex/protocol_test.go @@ -433,12 +433,14 @@ func TestRecvVote(t *testing.T) { defer p.close() vote := coreTypes.Vote{ - ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, - Period: 10, - Position: coreTypes.Position{ - ChainID: 11, - Round: 12, - Height: 13, + VoteHeader: coreTypes.VoteHeader{ + ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, + Period: 10, + Position: coreTypes.Position{ + ChainID: 11, + Round: 12, + Height: 13, + }, }, Signature: coreCrypto.Signature{ Type: "123", @@ -468,12 +470,14 @@ func TestSendVote(t *testing.T) { defer pm.Stop() vote := coreTypes.Vote{ - ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, - Period: 10, - Position: coreTypes.Position{ - ChainID: 1, - Round: 10, - Height: 13, + VoteHeader: coreTypes.VoteHeader{ + ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, + Period: 10, + Position: coreTypes.Position{ + ChainID: 1, + Round: 10, + Height: 13, + }, }, Signature: coreCrypto.Signature{ Type: "123", @@ -663,12 +667,14 @@ func TestRecvAgreement(t *testing.T) { // TODO(sonic): polish this vote := coreTypes.Vote{ - ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, - Period: 10, - Position: coreTypes.Position{ - ChainID: 1, - Round: 10, - Height: 13, + VoteHeader: coreTypes.VoteHeader{ + ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, + Period: 10, + Position: coreTypes.Position{ + ChainID: 1, + Round: 10, + Height: 13, + }, }, Signature: coreCrypto.Signature{ Type: "123", @@ -706,12 +712,14 @@ func TestSendAgreement(t *testing.T) { // TODO(sonic): polish this vote := coreTypes.Vote{ - ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, - Period: 10, - Position: coreTypes.Position{ - ChainID: 1, - Round: 10, - Height: 13, + VoteHeader: coreTypes.VoteHeader{ + ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, + Period: 10, + Position: coreTypes.Position{ + ChainID: 1, + Round: 10, + Height: 13, + }, }, Signature: coreCrypto.Signature{ Type: "123", -- cgit v1.2.3