Closed cytadela8 closed 6 years ago
Root hash is wrong when we update a key when there exists a longer key:
Steps to reproduce:
db = MerklePatriciaTree.DB.ETS.random_ets_db() trie1 = Trie.new(db) trie2 = Trie.new(db) trie1 = Trie.update(trie1, "key", "oldvalue") trie1 = Trie.update(trie1, "key_loner", "loner_key_value") trie1 = Trie.update(trie1, "key", "newvalue") trie2 = Trie.update(trie2, "key", "newvalue") trie2 = Trie.update(trie2, "key_loner", "loner_key_value") trie1.root_hash == trie2.root_hash
Result: false
false
Expected result: true
true
I added a test that fails.
Note: Ethereum tests also fail - #10
Root hash is wrong when we update a key when there exists a longer key:
Steps to reproduce:
Result:
false
Expected result:
true
I added a test that fails.
Note: Ethereum tests also fail - #10