diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-15 14:18:59 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-02-19 10:48:50 +0800 |
commit | 4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c (patch) | |
tree | 625b7d34aa700d072ffb8e68dc89ed3936b76d29 /core/db | |
parent | e4825619fb2499f5f534537c1a4d52d3e0bcacfe (diff) | |
download | dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar.gz dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar.bz2 dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar.lz dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar.xz dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.tar.zst dexon-consensus-4dbdc22e355cf1f6f0c39af1b2f3737b7527bc0c.zip |
big-bang: single chain (#446)
Diffstat (limited to 'core/db')
-rw-r--r-- | core/db/level-db_test.go | 8 | ||||
-rw-r--r-- | core/db/memory_test.go | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/core/db/level-db_test.go b/core/db/level-db_test.go index df971ee..40f9a60 100644 --- a/core/db/level-db_test.go +++ b/core/db/level-db_test.go @@ -148,10 +148,10 @@ func (s *LevelDBTestSuite) TestCompactionChainTipInfo() { s.Require().Equal(height, uint64(1)) // Unable to put compaction chain tip info with lower height. err = dbInst.PutCompactionChainTipInfo(hash, 0) - s.Require().IsType(err, ErrInvalidCompactionChainTipHeight) + s.Require().Equal(err.Error(), ErrInvalidCompactionChainTipHeight.Error()) // Unable to put compaction chain tip info with height not incremental by 1. err = dbInst.PutCompactionChainTipInfo(hash, 3) - s.Require().IsType(err, ErrInvalidCompactionChainTipHeight) + s.Require().Equal(err.Error(), ErrInvalidCompactionChainTipHeight.Error()) // It's OK to put compaction chain tip info with height incremental by 1. s.Require().NoError(dbInst.PutCompactionChainTipInfo(hash, 2)) } @@ -173,12 +173,12 @@ func (s *LevelDBTestSuite) TestDKGPrivateKey() { s.Require().False(exists) // We should be unable to get it, too. _, err = dbInst.GetDKGPrivateKey(1) - s.Require().IsType(err, ErrDKGPrivateKeyDoesNotExist) + s.Require().Equal(err.Error(), ErrDKGPrivateKeyDoesNotExist.Error()) // Put it. s.Require().NoError(dbInst.PutDKGPrivateKey(1, *p)) // Put it again, should not success. err = dbInst.PutDKGPrivateKey(1, *p) - s.Require().IsType(err, ErrDKGPrivateKeyExists) + s.Require().Equal(err.Error(), ErrDKGPrivateKeyExists.Error()) // Get it back. tmpPrv, err := dbInst.GetDKGPrivateKey(1) s.Require().NoError(err) diff --git a/core/db/memory_test.go b/core/db/memory_test.go index a1b5165..b210c8d 100644 --- a/core/db/memory_test.go +++ b/core/db/memory_test.go @@ -144,10 +144,10 @@ func (s *MemBackedDBTestSuite) TestCompactionChainTipInfo() { s.Require().Equal(height, uint64(1)) // Unable to put compaction chain tip info with lower height. err = dbInst.PutCompactionChainTipInfo(hash, 0) - s.Require().IsType(err, ErrInvalidCompactionChainTipHeight) + s.Require().Equal(err.Error(), ErrInvalidCompactionChainTipHeight.Error()) // Unable to put compaction chain tip info with height not incremental by 1. err = dbInst.PutCompactionChainTipInfo(hash, 3) - s.Require().IsType(err, ErrInvalidCompactionChainTipHeight) + s.Require().Equal(err.Error(), ErrInvalidCompactionChainTipHeight.Error()) // It's OK to put compaction chain tip info with height incremental by 1. s.Require().NoError(dbInst.PutCompactionChainTipInfo(hash, 2)) } @@ -163,12 +163,12 @@ func (s *MemBackedDBTestSuite) TestDKGPrivateKey() { s.Require().False(exists) // We should be unable to get it, too. _, err = dbInst.GetDKGPrivateKey(1) - s.Require().IsType(err, ErrDKGPrivateKeyDoesNotExist) + s.Require().Equal(err.Error(), ErrDKGPrivateKeyDoesNotExist.Error()) // Put it. s.Require().NoError(dbInst.PutDKGPrivateKey(1, *p)) // Put it again, should not success. err = dbInst.PutDKGPrivateKey(1, *p) - s.Require().IsType(err, ErrDKGPrivateKeyExists) + s.Require().Equal(err.Error(), ErrDKGPrivateKeyExists.Error()) // Get it back. tmpPrv, err := dbInst.GetDKGPrivateKey(1) s.Require().NoError(err) |