aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-22 12:54:03 +0800
committerGitHub <noreply@github.com>2018-12-22 12:54:03 +0800
commit6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6 (patch)
tree1895248f011a356fcd2a28c03dbda9d93fd46fd8 /core/utils_test.go
parent146ed32cf841151b826eafd7d6ade188c56865bf (diff)
downloadtangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.gz
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.bz2
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.lz
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.xz
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.tar.zst
tangerine-consensus-6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6.zip
utils: move authenticator to utils package (#378)
Diffstat (limited to 'core/utils_test.go')
-rw-r--r--core/utils_test.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/core/utils_test.go b/core/utils_test.go
index 81b093e..dd15607 100644
--- a/core/utils_test.go
+++ b/core/utils_test.go
@@ -21,10 +21,6 @@ import (
"testing"
"github.com/stretchr/testify/suite"
-
- "github.com/dexon-foundation/dexon-consensus/common"
- "github.com/dexon-foundation/dexon-consensus/core/crypto/ecdsa"
- "github.com/dexon-foundation/dexon-consensus/core/types"
)
type UtilsTestSuite struct {
@@ -43,24 +39,6 @@ func (s *UtilsTestSuite) TestRemoveFromSortedUint32Slice() {
s.Equal([]uint32{}, removeFromSortedUint32Slice([]uint32{}, 1))
}
-func (s *UtilsTestSuite) TestVerifyBlock() {
- prv, err := ecdsa.NewPrivateKey()
- s.Require().NoError(err)
- auth := NewAuthenticator(prv)
- block := &types.Block{}
- auth.SignBlock(block)
- s.NoError(VerifyBlock(block))
-
- hash := block.Hash
- block.Hash = common.NewRandomHash()
- s.Equal(ErrIncorrectHash, VerifyBlock(block))
-
- block.Hash = hash
- block.Signature, err = prv.Sign(common.NewRandomHash())
- s.Require().NoError(err)
- s.Equal(ErrIncorrectSignature, VerifyBlock(block))
-}
-
func TestUtils(t *testing.T) {
suite.Run(t, new(UtilsTestSuite))
}