{"action":"opened","issue":{"url":"https://api.github.com/repos/aeternity/elixir-merkle-patricia-tree/issues/13","repository_url":"https://api.github.com/repos/aeternity/elixir-merkle-patricia-tree","labels_url":"https://api.github.com/repos/aeternity/elixir-merkle-patricia-tree/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/aeternity/elixir-merkle-patricia-tree/issues/13/comments","events_url":"https://api.github.com/repos/aeternity/elixir-merkle-patricia-tree/issues/13/events","html_url":"https://github.com/aeternity/elixir-merkle-patricia-tree/issues/13","id":359087606,"node_id":"MDU6SXNzdWUzNTkwODc2MDY=","number":13,"title":"Updating key when longer key exists","user":{"login":"cytadela8","id":3736271,"node_id":"MDQ6VXNlcjM3MzYyNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/3736271?v=4","gravatar_id":"","url":"https://api.github.com/users/cytadela8","html_url":"https://github.com/cytadela8","followers_url":"https://api.github.com/users/cytadela8/followers","following_url":"https://api.github.com/users/cytadela8/following{/other_user}","gists_url":"https://api.github.com/users/cytadela8/gists{/gist_id}","starred_url":"https://api.github.com/users/cytadela8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cytadela8/subscriptions","organizations_url":"https://api.github.com/users/cytadela8/orgs","repos_url":"https://api.github.com/users/cytadela8/repos","events_url":"https://api.github.com/users/cytadela8/events{/privacy}","received_events_url":"https://api.github.com/users/cytadela8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T14:59:52Z","updated_at":"2018-09-11T14:59:52Z","closed_at":null,"author_association":"MEMBER","body":"Root hash is wrong when we update a key when there exists a longer key:\r\n\r\nSteps to reproduce:\r\n```\r\ndb = MerklePatriciaTree.DB.ETS.random_ets_db()\r\ntrie1 = Trie.new(db)\r\ntrie2 = Trie.new(db)\r\ntrie1 = Trie.update(trie1, \"key\", \"oldvalue\")\r\ntrie1 = Trie.update(trie1, \"key_loner\", \"loner_key_value\")\r\ntrie1 = Trie.update(trie1, \"key\", \"newvalue\")\r\ntrie2 = Trie.update(trie2, \"key\", \"newvalue\")\r\ntrie2 = Trie.update(trie2, \"key_loner\", \"loner_key_value\")\r\ntrie1.root_hash == trie2.root_hash\r\n```\r\n\r\nResult: `false`\r\n\r\nExpected result: `true`\r\n\r\nI added a test that fails.\r\n\r\n_Note: Ethereum tests also fail - #10_"}}
{"actor":{"display_login":"cytadela8"}}