From a7e3c046693d9df860422e71a14c8659b36afe6a Mon Sep 17 00:00:00 2001 From: Mission Liao Date: Fri, 9 Nov 2018 12:23:58 +0800 Subject: core: Extract VoteHeader (#313) --- core/authenticator_test.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'core/authenticator_test.go') diff --git a/core/authenticator_test.go b/core/authenticator_test.go index 02758a6..68e4243 100644 --- a/core/authenticator_test.go +++ b/core/authenticator_test.go @@ -53,15 +53,12 @@ func (s *AuthenticatorTestSuite) TestBlock() { func (s *AuthenticatorTestSuite) TestVote() { k := s.setupAuthenticator() - v := &types.Vote{ - ProposerID: types.NodeID{Hash: common.NewRandomHash()}, - Type: types.VoteCom, - BlockHash: common.NewRandomHash(), - Period: 123, - Position: types.Position{ - ChainID: 4, - Height: 6, - }} + v := types.NewVote(types.VoteCom, common.NewRandomHash(), 123) + v.Position = types.Position{ + ChainID: 4, + Height: 6, + } + v.ProposerID = types.NodeID{Hash: common.NewRandomHash()} s.NoError(k.SignVote(v)) ok, err := k.VerifyVote(v) s.True(ok) -- cgit v1.2.3