Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #606 from ethcore/betafixnotfound
Browse files Browse the repository at this point in the history
Failing test.
  • Loading branch information
Gav Wood committed Mar 5, 2016
2 parents dd02d9b + e43c3eb commit 34ae8af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions util/src/journaldb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,28 @@ mod tests {
use super::*;
use hashdb::*;

#[test]
fn insert_same_in_fork() {
// history is 1
let mut jdb = JournalDB::new_temp();

let x = jdb.insert(b"X");
jdb.commit(1, &b"1".sha3(), None).unwrap();
jdb.commit(2, &b"2".sha3(), None).unwrap();
jdb.commit(3, &b"1002a".sha3(), Some((1, b"1".sha3()))).unwrap();
jdb.commit(4, &b"1003a".sha3(), Some((2, b"2".sha3()))).unwrap();

jdb.remove(&x);
jdb.commit(3, &b"1002b".sha3(), Some((1, b"1".sha3()))).unwrap();
let x = jdb.insert(b"X");
jdb.commit(4, &b"1003b".sha3(), Some((2, b"2".sha3()))).unwrap();

jdb.commit(5, &b"1004a".sha3(), Some((3, b"1002a".sha3()))).unwrap();
jdb.commit(6, &b"1005a".sha3(), Some((4, b"1003a".sha3()))).unwrap();

assert!(jdb.exists(&x));
}

#[test]
fn long_history() {
// history is 3
Expand Down

0 comments on commit 34ae8af

Please sign in to comment.