Method
from
(balance: &AccountBalance)
Source from the content-addressed store, hash-verified
| 268 | |
| 269 | impl From<&AccountBalance> for BalanceQueryState { |
| 270 | fn from(balance: &AccountBalance) -> Self { |
| 271 | let balance_age_ms = crate::core::ic_cdk::api::time() |
| 272 | .saturating_sub(balance.last_modification_timestamp) |
| 273 | / 1_000_000; |
| 274 | if balance_age_ms <= ACCOUNT_BALANCE_FRESHNESS_IN_MS { |
| 275 | BalanceQueryState::Fresh |
| 276 | } else { |
| 277 | BalanceQueryState::Stale |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | #[cfg(test)] |
Callers
nothing calls this directly
Tested by
no test coverage detected