diff --git a/ethcore/src/state_db.rs b/ethcore/src/state_db.rs index a5823f50b..de5a3f75b 100644 --- a/ethcore/src/state_db.rs +++ b/ethcore/src/state_db.rs @@ -477,7 +477,7 @@ mod tests { let mut batch = DBTransaction::new(); // blocks [ 3a(c) 2a(c) 2b 1b 1a(c) 0 ] - // balance [ 5 5 4 3 2 2 ] + // balance [ 5 5 4 3 2 2 ] let mut s = state_db.boxed_clone_canon(&root_parent); s.add_to_account_cache(address, Some(Account::new_basic(2.into(), 0.into())), false); s.journal_under(&mut batch, 0, &h0).unwrap(); diff --git a/ethstore/src/dir/vault.rs b/ethstore/src/dir/vault.rs index 31c99fcc4..a7b351643 100755 --- a/ethstore/src/dir/vault.rs +++ b/ethstore/src/dir/vault.rs @@ -296,6 +296,7 @@ mod test { assert!(check_vault_name("vault_with_underscores")); assert!(check_vault_name("vault-with-dashes")); assert!(check_vault_name("vault-with-digits-123")); + assert!(check_vault_name("vault中文名字")); } #[test] diff --git a/util/src/journaldb/archivedb.rs b/util/src/journaldb/archivedb.rs index 1f9381c99..9099ff03b 100644 --- a/util/src/journaldb/archivedb.rs +++ b/util/src/journaldb/archivedb.rs @@ -239,6 +239,21 @@ mod tests { jdb.commit_batch(3, &b"3".sha3(), Some((0, b"0".sha3()))).unwrap(); assert!(jdb.contains(&h)); jdb.commit_batch(4, &b"4".sha3(), Some((1, b"1".sha3()))).unwrap(); + assert!(jdb.contains(&h)); + } + + #[test] + #[should_panic] + fn multiple_owed_removal_not_allowed() { + let mut jdb = ArchiveDB::new_temp(); + let h = jdb.insert(b"foo"); + jdb.commit_batch(0, &b"0".sha3(), None).unwrap(); + assert!(jdb.contains(&h)); + jdb.remove(&h); + jdb.remove(&h); + // commit_batch would call journal_under(), + // and we don't allow multiple owned removals. + jdb.commit_batch(1, &b"1".sha3(), None).unwrap(); } #[test]