aboutsummaryrefslogtreecommitdiffstats
path: root/trie/trie_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/trie_test.go')
-rw-r--r--trie/trie_test.go18
1 files changed, 1 insertions, 17 deletions
diff --git a/trie/trie_test.go b/trie/trie_test.go
index 60307dba8..01ae3a4e7 100644
--- a/trie/trie_test.go
+++ b/trie/trie_test.go
@@ -377,7 +377,7 @@ func (randTest) Generate(r *rand.Rand, size int) reflect.Value {
if len(allKeys) < 2 || r.Intn(100) < 10 {
// new key
key := make([]byte, r.Intn(50))
- randRead(r, key)
+ r.Read(key)
allKeys = append(allKeys, key)
return key
}
@@ -401,22 +401,6 @@ func (randTest) Generate(r *rand.Rand, size int) reflect.Value {
return reflect.ValueOf(steps)
}
-// rand.Rand provides a Read method in Go 1.7 and later, but
-// we can't use it yet.
-func randRead(r *rand.Rand, b []byte) {
- pos := 0
- val := 0
- for n := 0; n < len(b); n++ {
- if pos == 0 {
- val = r.Int()
- pos = 7
- }
- b[n] = byte(val)
- val >>= 8
- pos--
- }
-}
-
func runRandTest(rt randTest) bool {
db, _ := ethdb.NewMemDatabase()
tr, _ := New(common.Hash{}, db)