mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
refactor(folio): name the balance property for the bound it asserts
it stopped being an equality and became |delta| <= typed, so the old name demanded more than the property does. renamed with the ci gate's GATED_PROPERTIES in the same commit so the gate never sees a name it does not know.
This commit is contained in:
1 parent
6a7764eac7
commit
112d347432
8 files changed
+57
-57
No files matched your search
@@ -602,7 +602,7 @@ export function committedTransactionsExceedSubmits(args: {
|
||||
// submit action can commit one transaction, so the account's balance cannot
|
||||
// move by more than the amount that submit typed.
|
||||
//
|
||||
// An UPPER BOUND, not the equality submitChangesBalanceByTypedAmount uses, and
|
||||
// An UPPER BOUND, not the equality submitChangesBalanceByAtMostTypedAmount uses, and
|
||||
// that is what makes a one-action window safe. A balance that has not moved is
|
||||
// a commit still in flight (createTransaction runs in a coroutine), a submit
|
||||
// the app rejected, or a tap that never landed, and none of those is evidence
|
||||
@@ -621,7 +621,7 @@ export function committedTransactionsExceedSubmits(args: {
|
||||
// mirrors parseCents), so every rejected amount and every amount too large to
|
||||
// hold exactly arrives here as 0 and is vacuous.
|
||||
//
|
||||
// The float guards are the ones submitChangesBalanceByTypedAmount explains:
|
||||
// The float guards are the ones submitChangesBalanceByAtMostTypedAmount explains:
|
||||
// each balance and the typed amount lose precision on their own past
|
||||
// Number.MAX_SAFE_INTEGER. Their difference needs none, because a difference
|
||||
// that is really within a safe typedAmount is itself safe and comes out exact.
|
||||
@@ -723,7 +723,7 @@ export function parseTypedAmount(text: string | undefined | null): number {
|
||||
// evidence about the amount typed into any one submit, so anything other than
|
||||
// exactly one submit action in the window is vacuous. Exactly one still catches
|
||||
// the bug: the double-tap is a single action.
|
||||
export function submitChangesBalanceByTypedAmount(args: {
|
||||
export function submitChangesBalanceByAtMostTypedAmount(args: {
|
||||
route: string | null;
|
||||
lastAction: ObservedAction | null;
|
||||
submitsInWindow: number;
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
readHomeCards,
|
||||
readHomeTotalBalance,
|
||||
routeOfFrame,
|
||||
submitChangesBalanceByTypedAmount,
|
||||
submitChangesBalanceByAtMostTypedAmount,
|
||||
} from "./predicates";
|
||||
import type { Account, CardReading, TxnCount } from "./predicates";
|
||||
|
||||
@@ -264,12 +264,12 @@ const newAccountBalanceIsZero = always(
|
||||
// predicate skips off-Home landings where totalBalance.current is the carrier.
|
||||
//
|
||||
// The name is the property's, and the gate keys on it, so it stays; what it
|
||||
// demands is the bound, for the reason submitChangesBalanceByTypedAmount gives:
|
||||
// demands is the bound, for the reason submitChangesBalanceByAtMostTypedAmount gives:
|
||||
// a total that has not re-rendered yet has not moved, and an equality convicts a
|
||||
// healthy app for a frame that has not caught up.
|
||||
const submitMovesBalanceByTypedAmount = always(
|
||||
const submitMovesBalanceByAtMostTypedAmount = always(
|
||||
next(() =>
|
||||
submitChangesBalanceByTypedAmount({
|
||||
submitChangesBalanceByAtMostTypedAmount({
|
||||
route: route.current,
|
||||
lastAction: lastAction.current,
|
||||
submitsInWindow: submitsInWindow.current,
|
||||
@@ -367,7 +367,7 @@ const addTxn = whenRoute(route, ["home", "ledger", "add-transaction"], () => {
|
||||
|
||||
export const properties = {
|
||||
newAccountBalanceIsZero,
|
||||
submitMovesBalanceByTypedAmount,
|
||||
submitMovesBalanceByAtMostTypedAmount,
|
||||
submitCommitsOneTransactionPerAction,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user