Add empty account existence test from beta. (#2769)

* add bloom filter existence test from beta

* fix U256 instantiation for master
This commit is contained in:
Robert Habermeier 2016-10-21 20:36:40 +02:00 committed by Arkadiy Paronyan
parent f58bdf2ccf
commit 49ef9a1aa4

View File

@ -1671,6 +1671,21 @@ fn remove() {
assert_eq!(state.nonce(&a), U256::from(0u64)); assert_eq!(state.nonce(&a), U256::from(0u64));
} }
#[test]
fn empty_account_exists() {
let a = Address::zero();
let path = RandomTempPath::new();
let db = get_temp_state_db_in(path.as_path());
let (root, db) = {
let mut state = State::new(db, U256::from(0), Default::default());
state.add_balance(&a, &U256::default()); // create an empty account
state.commit().unwrap();
state.drop()
};
let state = State::from_existing(db, root, U256::from(0u8), Default::default()).unwrap();
assert!(state.exists(&a));
}
#[test] #[test]
fn remove_from_database() { fn remove_from_database() {
let a = Address::zero(); let a = Address::zero();