diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-11-09 12:23:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 12:23:58 +0800 |
commit | a7e3c046693d9df860422e71a14c8659b36afe6a (patch) | |
tree | 3c4148b202a3d2acb3e326198c10c1b4b35738f6 /core/authenticator_test.go | |
parent | 71a1dd9c072fb64da026ebe56acd2d187ec272c8 (diff) | |
download | dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.gz dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.bz2 dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.lz dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.xz dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.zst dexon-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.zip |
core: Extract VoteHeader (#313)
Diffstat (limited to 'core/authenticator_test.go')
-rw-r--r-- | core/authenticator_test.go | 15 |
1 files changed, 6 insertions, 9 deletions
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) |