diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-08-15 14:04:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-15 14:04:35 +0800 |
commit | 3a9b545b0f33435c277fcede2251e4b5ae800d40 (patch) | |
tree | 7848c5f02a3e2e145a038ec206e95d6230ab5d45 /core/negative-ack_test.go | |
parent | c4bfb69724f5fb777fbf5fc272dc65a0f9d1f368 (diff) | |
download | tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar.gz tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar.bz2 tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar.lz tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar.xz tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.tar.zst tangerine-consensus-3a9b545b0f33435c277fcede2251e4b5ae800d40.zip |
test: refine test utility (#61)
* Add functionality to test.App
* Add test utility to generate slices of types.ValidatorID
Diffstat (limited to 'core/negative-ack_test.go')
-rw-r--r-- | core/negative-ack_test.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/negative-ack_test.go b/core/negative-ack_test.go index 87fcea0..990871e 100644 --- a/core/negative-ack_test.go +++ b/core/negative-ack_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/dexon-foundation/dexon-consensus-core/common" + "github.com/dexon-foundation/dexon-consensus-core/core/test" "github.com/dexon-foundation/dexon-consensus-core/core/types" ) @@ -84,10 +84,7 @@ func genTimestamp(vids []types.ValidatorID, a []int) map[types.ValidatorID]time. } func genTestNegativeAck(num int) (*negativeAck, []types.ValidatorID) { - vids := []types.ValidatorID{} - for i := 0; i < num; i++ { - vids = append(vids, types.ValidatorID{Hash: common.NewRandomHash()}) - } + vids := test.GenerateRandomValidatorIDs(num) n := newNegativeAck(vids[0]) for i := 1; i < num; i++ { n.addValidator(vids[i]) |