diff options
author | Sonic <sonic@cobinhood.com> | 2018-10-26 10:52:20 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:52 +0800 |
commit | 0921ea5d4f7f6f7d2151462534f0d0a4343c5979 (patch) | |
tree | ae8e59158c557850790abb693bb71d716618ff39 /dex/protocol_test.go | |
parent | 2c38bf1bfb209424d5e5567f395268a90be9c58f (diff) | |
download | dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar.gz dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar.bz2 dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar.lz dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar.xz dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.tar.zst dexon-0921ea5d4f7f6f7d2151462534f0d0a4343c5979.zip |
dex: fix types changes in consensus core
Diffstat (limited to 'dex/protocol_test.go')
-rw-r--r-- | dex/protocol_test.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/dex/protocol_test.go b/dex/protocol_test.go index c48f8cb02..55d7abc69 100644 --- a/dex/protocol_test.go +++ b/dex/protocol_test.go @@ -27,6 +27,7 @@ import ( coreCrypto "github.com/dexon-foundation/dexon-consensus-core/core/crypto" "github.com/dexon-foundation/dexon-consensus-core/core/crypto/dkg" coreTypes "github.com/dexon-foundation/dexon-consensus-core/core/types" + dkgTypes "github.com/dexon-foundation/dexon-consensus-core/core/types/dkg" "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/core/types" @@ -332,9 +333,8 @@ func TestRecvLatticeBlock(t *testing.T) { })), Payload: []byte{3, 3, 3, 3, 3}, Witness: coreTypes.Witness{ - Timestamp: time.Now().UTC(), - Height: 13, - Data: []byte{4, 4, 4, 4, 4}, + Height: 13, + Data: []byte{4, 4, 4, 4, 4}, }, Finalization: coreTypes.FinalizationResult{ Randomness: []byte{5, 5, 5, 5, 5}, @@ -388,9 +388,8 @@ func TestSendLatticeBlock(t *testing.T) { })), Payload: []byte{3, 3, 3, 3, 3}, Witness: coreTypes.Witness{ - Timestamp: time.Now().UTC(), - Height: 13, - Data: []byte{4, 4, 4, 4, 4}, + Height: 13, + Data: []byte{4, 4, 4, 4, 4}, }, Finalization: coreTypes.FinalizationResult{ Randomness: []byte{5, 5, 5, 5, 5}, @@ -580,7 +579,7 @@ func TestRecvDKGPrivateShare(t *testing.T) { // TODO(sonic): polish this privkey := dkg.NewPrivateKey() - privateShare := coreTypes.DKGPrivateShare{ + privateShare := dkgTypes.PrivateShare{ ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, ReceiverID: coreTypes.NodeID{coreCommon.Hash{3, 4, 5}}, Round: 10, @@ -599,7 +598,7 @@ func TestRecvDKGPrivateShare(t *testing.T) { ch := pm.ReceiveChan() select { case msg := <-ch: - rps := msg.(*coreTypes.DKGPrivateShare) + rps := msg.(*dkgTypes.PrivateShare) if !reflect.DeepEqual(rps, &privateShare) { t.Errorf("vote mismatch") } @@ -617,7 +616,7 @@ func TestSendDKGPrivateShare(t *testing.T) { // TODO(sonic): polish this privkey := dkg.NewPrivateKey() - privateShare := coreTypes.DKGPrivateShare{ + privateShare := dkgTypes.PrivateShare{ ProposerID: coreTypes.NodeID{coreCommon.Hash{1, 2, 3}}, ReceiverID: coreTypes.NodeID{coreCommon.Hash{3, 4, 5}}, Round: 10, @@ -636,7 +635,7 @@ func TestSendDKGPrivateShare(t *testing.T) { t.Errorf("%v: got code %d, want %d", p1.Peer, msg.Code, DKGPrivateShareMsg) } - var ps coreTypes.DKGPrivateShare + var ps dkgTypes.PrivateShare if err := msg.Decode(&ps); err != nil { t.Errorf("%v: %v", p1.Peer, err) } |