MCPcopy Create free account
hub / github.com/dfinity/orbit / from

Method from

core/station/impl/src/models/account.rs:270–279  ·  view source on GitHub ↗
(balance: &AccountBalance)

Source from the content-addressed store, hash-verified

268
269impl 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

Calls 1

timeFunction · 0.85

Tested by

no test coverage detected