Invalidates an account's trusted-delegation classification. Uses the non-promoting `peek_mut`: invalidation is driven by every canonical state diff, so an account with frequent code churn must not promote itself to most-recently-used and displace fresher, fully-valid entries. A surviving partially-invalidated entry keeps its recency.
(&mut self, account: Address)
| 171 | /// promote itself to most-recently-used and displace fresher, fully-valid |
| 172 | /// entries. A surviving partially-invalidated entry keeps its recency. |
| 173 | pub fn invalidate_code(&mut self, account: Address) { |
| 174 | let remove = self.entries.peek_mut(&account).is_some_and(|entry| { |
| 175 | entry.1 = None; |
| 176 | entry.0.is_none() |
| 177 | }); |
| 178 | if remove { |
| 179 | self.entries.pop(&account); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /// Invalidates the account-state classification associated with `slot`. |
| 184 | /// |