aboutsummaryrefslogtreecommitdiffstats
path: root/trie/trie_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-09-26 02:49:02 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-09-28 16:27:28 +0800
commitcd791bd855b55b95afc8a5c8f56b8bf67863d099 (patch)
tree3955fe3abf4079eee5412119043ade1b7001bb61 /trie/trie_test.go
parent863d166c7b0250cf2e99c8aad69578cdd144d386 (diff)
downloaddexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar.gz
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar.bz2
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar.lz
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar.xz
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.tar.zst
dexon-cd791bd855b55b95afc8a5c8f56b8bf67863d099.zip
core, trie: replace state caches with trie journal
Diffstat (limited to 'trie/trie_test.go')
-rw-r--r--trie/trie_test.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/trie/trie_test.go b/trie/trie_test.go
index 121ba24c1..5a3ea1be9 100644
--- a/trie/trie_test.go
+++ b/trie/trie_test.go
@@ -76,8 +76,6 @@ func TestMissingNode(t *testing.T) {
updateString(trie, "123456", "asdfasdfasdfasdfasdfasdfasdfasdf")
root, _ := trie.Commit()
- ClearGlobalCache()
-
trie, _ = New(root, db)
_, err := trie.TryGet([]byte("120000"))
if err != nil {
@@ -109,7 +107,6 @@ func TestMissingNode(t *testing.T) {
}
db.Delete(common.FromHex("e1d943cc8f061a0c0b98162830b970395ac9315654824bf21b73b891365262f9"))
- ClearGlobalCache()
trie, _ = New(root, db)
_, err = trie.TryGet([]byte("120000"))
@@ -362,44 +359,6 @@ func TestLargeValue(t *testing.T) {
}
-type kv struct {
- k, v []byte
- t bool
-}
-
-func TestLargeData(t *testing.T) {
- trie := newEmpty()
- vals := make(map[string]*kv)
-
- for i := byte(0); i < 255; i++ {
- value := &kv{common.LeftPadBytes([]byte{i}, 32), []byte{i}, false}
- value2 := &kv{common.LeftPadBytes([]byte{10, i}, 32), []byte{i}, false}
- trie.Update(value.k, value.v)
- trie.Update(value2.k, value2.v)
- vals[string(value.k)] = value
- vals[string(value2.k)] = value2
- }
-
- it := NewIterator(trie)
- for it.Next() {
- vals[string(it.Key)].t = true
- }
-
- var untouched []*kv
- for _, value := range vals {
- if !value.t {
- untouched = append(untouched, value)
- }
- }
-
- if len(untouched) > 0 {
- t.Errorf("Missed %d nodes", len(untouched))
- for _, value := range untouched {
- t.Error(value)
- }
- }
-}
-
func BenchmarkGet(b *testing.B) { benchGet(b, false) }
func BenchmarkGetDB(b *testing.B) { benchGet(b, true) }
func BenchmarkUpdateBE(b *testing.B) { benchUpdate(b, binary.BigEndian) }