Fix state not using "account_starting_nonce" (#1830)
* failng test * use account_starting_nonce instead of zero * simplier test * jsons are getting closer * incorrect test client and incorrect tests fix * null_morden is using 0x0 starting nonce * replaced json with the correct one * superwhatever line
This commit is contained in:
@@ -310,7 +310,7 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
|
||||
fn nonce(&self, address: &Address, id: BlockID) -> Option<U256> {
|
||||
match id {
|
||||
BlockID::Latest => Some(self.nonces.read().get(address).cloned().unwrap_or_else(U256::zero)),
|
||||
BlockID::Latest => Some(self.nonces.read().get(address).cloned().unwrap_or(self.spec.params.account_start_nonce)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ impl State {
|
||||
/// Get the nonce of account `a`.
|
||||
pub fn nonce(&self, a: &Address) -> U256 {
|
||||
self.ensure_cached(a, false,
|
||||
|a| a.as_ref().map_or(U256::zero(), |account| *account.nonce()))
|
||||
|a| a.as_ref().map_or(self.account_start_nonce, |account| *account.nonce()))
|
||||
}
|
||||
|
||||
/// Mutate storage of account `address` so that it is `value` for `key`.
|
||||
|
||||
Reference in New Issue
Block a user