diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-08-30 15:09:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 15:09:15 +0800 |
commit | 8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8 (patch) | |
tree | b9ea30e61b410557cc87aa4d828c4cb3cf771984 /core/test/revealer_test.go | |
parent | 1f34da04eb9d80648349140eb1442cab87ba5cd8 (diff) | |
download | tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar.gz tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar.bz2 tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar.lz tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar.xz tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.tar.zst tangerine-consensus-8cb1d5c4f3f7f93d8b2c54addf5c2caced0a1eb8.zip |
core: tune total ordering performance (#81)
- Replace map with slice
Compared to slice, accessing to map is slower and
the memory usage is inefficient.
Diffstat (limited to 'core/test/revealer_test.go')
-rw-r--r-- | core/test/revealer_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/test/revealer_test.go b/core/test/revealer_test.go index 8087136..032cab3 100644 --- a/core/test/revealer_test.go +++ b/core/test/revealer_test.go @@ -45,9 +45,10 @@ func (s *RevealerTestSuite) SetupSuite() { // Randomly generate blocks. gen := NewBlocksGenerator(nil, stableRandomHash) - err = gen.Generate( + validators, err := gen.Generate( validatorCount, blockCount, nil, s.db) s.Require().Nil(err) + s.Require().Len(validators, validatorCount) // Cache the count of total generated block. iter, err := s.db.GetAll() |