Add an account with default account data. Skip if the account already exists.
(&mut self, key: &Account)
| 34 | /// Add an account with default account data. |
| 35 | /// Skip if the account already exists. |
| 36 | pub(crate) fn add_empty_account(&mut self, key: &Account) -> Result<bool> { |
| 37 | let should_add = self.get_account(key).is_err(); |
| 38 | if should_add { |
| 39 | self.add_account(key, &AccountData::new(None))?; |
| 40 | } |
| 41 | |
| 42 | Ok(should_add) |
| 43 | } |
| 44 | |
| 45 | pub fn add_contract_account(&mut self, key: &Account, data: Bytes) -> Result<Account> { |
| 46 | let nonce = self.get_account(key)?.nonce; |
no test coverage detected