def decide

cswap-bend-cli@0.1.0.0 · policy/decide.bend:430

import cswap-bend-cli@0.1.0.0/policy/decide.bend as Decide
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T
import cswap-bend-cli@0.1.0.0/policy/usage.bend as U

430# One autoswitch tick. `st` is autoswitch_state.json (last switch, where it
431# came from, what that account looked like), `mem` the engine's counters
432# (see `mem_after` for the next ones). Pure: the caller fetches usage,
433# applies the decision and records the switch.
434def decide(+active: Nat, +accounts: List<&2, T.Account>, +usage: List<&2, T.Usage>, +now: Nat, +cfg: T.Config, +st: T.State, +mem: T.Mem) -> T.Decision:
435  decide.acct(U.account.of(active, accounts), Env{active, accounts, usage, now, cfg, st, mem})

Uses (11)

Used by (1)