diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index e84a96ac2..b4e9178f1 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -1671,6 +1671,21 @@ fn remove() { 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] fn remove_from_database() { let a = Address::zero();