aboutsummaryrefslogtreecommitdiffstats
path: root/core/crypto_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-20 09:09:37 +0800
committerGitHub <noreply@github.com>2018-09-20 09:09:37 +0800
commit421d72b2d796195178104a0eb1dedf319ba8664c (patch)
treef32f15c167989905494eca1891c3240b80dac1d6 /core/crypto_test.go
parent37f117d35c6617e1944d45e001e03813a6a278ed (diff)
downloaddexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.gz
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.bz2
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.lz
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.xz
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.tar.zst
dexon-consensus-421d72b2d796195178104a0eb1dedf319ba8664c.zip
Rename validator* to node* (#120)
Diffstat (limited to 'core/crypto_test.go')
-rw-r--r--core/crypto_test.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/crypto_test.go b/core/crypto_test.go
index fe6bbc1..6c807da 100644
--- a/core/crypto_test.go
+++ b/core/crypto_test.go
@@ -33,7 +33,7 @@ type CryptoTestSuite struct {
suite.Suite
}
-var myVID = types.ValidatorID{Hash: common.NewRandomHash()}
+var myNID = types.NodeID{Hash: common.NewRandomHash()}
func (s *CryptoTestSuite) prepareBlock(prevBlock *types.Block) *types.Block {
acks := common.Hashes{}
@@ -181,9 +181,9 @@ func (s *CryptoTestSuite) TestVoteSignature() {
prv, err := eth.NewPrivateKey()
s.Require().Nil(err)
pub := prv.PublicKey()
- vID := types.NewValidatorID(pub)
+ nID := types.NewNodeID(pub)
vote := &types.Vote{
- ProposerID: vID,
+ ProposerID: nID,
Type: types.VoteAck,
BlockHash: common.NewRandomHash(),
Period: 1,
@@ -200,9 +200,9 @@ func (s *CryptoTestSuite) TestCRSSignature() {
prv, err := eth.NewPrivateKey()
s.Require().Nil(err)
pub := prv.PublicKey()
- vID := types.NewValidatorID(pub)
+ nID := types.NewNodeID(pub)
block := &types.Block{
- ProposerID: vID,
+ ProposerID: nID,
}
block.CRSSignature, err = prv.Sign(hashCRS(block, crs))
s.Require().Nil(err)
@@ -214,9 +214,9 @@ func (s *CryptoTestSuite) TestCRSSignature() {
func (s *CryptoTestSuite) TestDKGSignature() {
prv, err := eth.NewPrivateKey()
s.Require().Nil(err)
- vID := types.NewValidatorID(prv.PublicKey())
+ nID := types.NewNodeID(prv.PublicKey())
prvShare := &types.DKGPrivateShare{
- ProposerID: vID,
+ ProposerID: nID,
Round: 5,
PrivateShare: *dkg.NewPrivateKey(),
}
@@ -229,7 +229,7 @@ func (s *CryptoTestSuite) TestDKGSignature() {
id := dkg.NewID([]byte{13})
_, pkShare := dkg.NewPrivateKeyShares(1)
mpk := &types.DKGMasterPublicKey{
- ProposerID: vID,
+ ProposerID: nID,
Round: 5,
DKGID: id,
PublicKeyShares: *pkShare,
@@ -241,7 +241,7 @@ func (s *CryptoTestSuite) TestDKGSignature() {
s.False(verifyDKGMasterPublicKeySignature(mpk, eth.SigToPub))
complaint := &types.DKGComplaint{
- ProposerID: vID,
+ ProposerID: nID,
Round: 5,
PrivateShare: *prvShare,
}
@@ -252,7 +252,7 @@ func (s *CryptoTestSuite) TestDKGSignature() {
s.False(verifyDKGComplaintSignature(complaint, eth.SigToPub))
sig := &types.DKGPartialSignature{
- ProposerID: vID,
+ ProposerID: nID,
Round: 5,
PartialSignature: dkg.PartialSignature{},
}