aboutsummaryrefslogtreecommitdiffstats
path: root/core/crypto_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-09 12:23:58 +0800
committerGitHub <noreply@github.com>2018-11-09 12:23:58 +0800
commita7e3c046693d9df860422e71a14c8659b36afe6a (patch)
tree3c4148b202a3d2acb3e326198c10c1b4b35738f6 /core/crypto_test.go
parent71a1dd9c072fb64da026ebe56acd2d187ec272c8 (diff)
downloadtangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.gz
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.bz2
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.lz
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.xz
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.tar.zst
tangerine-consensus-a7e3c046693d9df860422e71a14c8659b36afe6a.zip
core: Extract VoteHeader (#313)
Diffstat (limited to 'core/crypto_test.go')
-rw-r--r--core/crypto_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/core/crypto_test.go b/core/crypto_test.go
index 5fc8ea7..5aefec5 100644
--- a/core/crypto_test.go
+++ b/core/crypto_test.go
@@ -131,12 +131,8 @@ func (s *CryptoTestSuite) TestVoteSignature() {
s.Require().NoError(err)
pub := prv.PublicKey()
nID := types.NewNodeID(pub)
- vote := &types.Vote{
- ProposerID: nID,
- Type: types.VoteInit,
- BlockHash: common.NewRandomHash(),
- Period: 1,
- }
+ vote := types.NewVote(types.VoteInit, common.NewRandomHash(), 1)
+ vote.ProposerID = nID
vote.Signature, err = prv.Sign(hashVote(vote))
s.Require().NoError(err)
ok, err := verifyVoteSignature(vote)