diff --git a/ethcore/src/account.rs b/ethcore/src/account.rs index 0d535f7ce..24386e839 100644 --- a/ethcore/src/account.rs +++ b/ethcore/src/account.rs @@ -35,6 +35,7 @@ impl Account { } /// General constructor. + #[allow(dead_code)] // Used only in test code for now. pub fn from_pod(pod: PodAccount) -> Account { Account { balance: pod.balance, @@ -110,6 +111,7 @@ impl Account { pub fn nonce(&self) -> &U256 { &self.nonce } /// return the code hash associated with this account. + #[allow(dead_code)] // Used only in test code for now. pub fn code_hash(&self) -> H256 { self.code_hash.clone().unwrap_or(SHA3_EMPTY) } @@ -126,6 +128,7 @@ impl Account { } /// Provide a byte array which hashes to the `code_hash`. returns the hash as a result. + #[allow(dead_code)] // Used only in test code for now. pub fn note_code(&mut self, code: Bytes) -> Result<(), H256> { let h = code.sha3(); match self.code_hash { @@ -159,18 +162,14 @@ impl Account { } } - /// return the storage root associated with this account. - pub fn base_root(&self) -> &H256 { &self.storage_root } - /// Determine whether there are any un-`commit()`-ed storage-setting operations. + #[allow(dead_code)] pub fn storage_is_clean(&self) -> bool { self.storage_overlay.borrow().iter().find(|&(_, &(f, _))| f == Filth::Dirty).is_none() } /// return the storage root associated with this account or None if it has been altered via the overlay. + #[allow(dead_code)] pub fn storage_root(&self) -> Option<&H256> { if self.storage_is_clean() {Some(&self.storage_root)} else {None} } - /// return the storage root associated with this account or None if it has been altered via the overlay. - pub fn recent_storage_root(&self) -> &H256 { &self.storage_root } - /// return the storage overlay. pub fn storage_overlay(&self) -> Ref> { self.storage_overlay.borrow() } diff --git a/ethcore/src/account_diff.rs b/ethcore/src/account_diff.rs index 411150739..72c331959 100644 --- a/ethcore/src/account_diff.rs +++ b/ethcore/src/account_diff.rs @@ -49,8 +49,9 @@ impl AccountDiff { } } - /// Determine difference between two optionally existance `Account`s. Returns None + /// Determine difference between two optionally existant `Account`s. Returns None /// if they are the same. + #[allow(dead_code)] // Used only in test code for now. pub fn diff_pod(pre: Option<&PodAccount>, post: Option<&PodAccount>) -> Option { match (pre, post) { (None, Some(x)) => Some(AccountDiff { diff --git a/ethcore/src/state.rs b/ethcore/src/state.rs index 3c12804b9..d285f0e0d 100644 --- a/ethcore/src/state.rs +++ b/ethcore/src/state.rs @@ -2,7 +2,6 @@ use common::*; use engine::Engine; use executive::Executive; use pod_account::*; -use pod_state::PodState; //use state_diff::*; // TODO: uncomment once to_pod() works correctly. /// Result type for the execution ("application") of a transaction. @@ -194,6 +193,7 @@ impl State { } /// Populate a PodAccount map from this state. + #[allow(dead_code)] // Used only in test code for now. pub fn to_hashmap_pod(&self) -> HashMap { // TODO: handle database rather than just the cache. self.cache.borrow().iter().fold(HashMap::new(), |mut m, (add, opt)| { @@ -273,6 +273,7 @@ use util::rlp::*; use util::uint::*; use account::*; use tests::helpers::*; +use pod_state::PodState; #[test] fn code_from_database() { diff --git a/ethcore/src/state_diff.rs b/ethcore/src/state_diff.rs index 1caa62ef1..b3bc4b4e5 100644 --- a/ethcore/src/state_diff.rs +++ b/ethcore/src/state_diff.rs @@ -9,6 +9,7 @@ pub struct StateDiff (BTreeMap); impl StateDiff { /// Calculate and return diff between `pre` state and `post` state. + #[allow(dead_code)] // Used only in test code for now. pub fn diff_pod(pre: &PodState, post: &PodState) -> StateDiff { StateDiff(pre.get().keys().merge(post.get().keys()).filter_map(|acc| AccountDiff::diff_pod(pre.get().get(acc), post.get().get(acc)).map(|d|(acc.clone(), d))).collect()) } diff --git a/ethcore/src/transaction.rs b/ethcore/src/transaction.rs index bc777d7ae..3b9d0e162 100644 --- a/ethcore/src/transaction.rs +++ b/ethcore/src/transaction.rs @@ -230,6 +230,7 @@ impl Transaction { } /// Do basic validation, checking for valid signature and minimum gas, + #[allow(dead_code)] // Used only in tests. TODO: consider use in block validation. pub fn validate(self, schedule: &Schedule, require_low: bool) -> Result { if require_low && !ec::is_low_s(&self.s) { return Err(Error::Util(UtilError::Crypto(CryptoError::InvalidSignature)));