diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-26 06:09:38 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-26 06:09:38 +0800 |
commit | 3ebd7f1166f03f94117651d8e74b9603ee7d6966 (patch) | |
tree | 0b26904388619e1e36380a8a21d65476a9f0cc94 /ethutil | |
parent | 81ef40010f6f31bc94f654048b41fa3a9f9e07eb (diff) | |
download | dexon-3ebd7f1166f03f94117651d8e74b9603ee7d6966.tar.gz dexon-3ebd7f1166f03f94117651d8e74b9603ee7d6966.tar.zst dexon-3ebd7f1166f03f94117651d8e74b9603ee7d6966.zip |
State snapshotting
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/trie_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ethutil/trie_test.go b/ethutil/trie_test.go index 0be512d9f..d74d129ac 100644 --- a/ethutil/trie_test.go +++ b/ethutil/trie_test.go @@ -1,7 +1,7 @@ package ethutil import ( - _ "fmt" + "fmt" "reflect" "testing" ) @@ -26,7 +26,6 @@ func (db *MemDatabase) Delete(key []byte) error { delete(db.db, string(key)) return nil } -func (db *MemDatabase) GetKeys() []*Key { return nil } func (db *MemDatabase) Print() {} func (db *MemDatabase) Close() {} func (db *MemDatabase) LastKnownTD() []byte { return nil } @@ -171,3 +170,17 @@ func TestTrieIterator(t *testing.T) { t.Errorf("Expected cached nodes to be deleted") } } + +func TestHashes(t *testing.T) { + _, trie := New() + trie.Update("cat", "dog") + trie.Update("ca", "dude") + trie.Update("doge", "1234567890abcdefghijklmnopqrstuvwxxzABCEFGHIJKLMNOPQRSTUVWXYZ") + trie.Update("dog", "test") + trie.Update("test", "1234567890abcdefghijklmnopqrstuvwxxzABCEFGHIJKLMNOPQRSTUVWXYZ") + fmt.Printf("%x\n", trie.Root) + trie.Delete("dog") + fmt.Printf("%x\n", trie.Root) + trie.Delete("test") + fmt.Printf("%x\n", trie.Root) +} |