tumbler.persistence
tumbler.persistence
YAML persistence for tumbler plans.
Plans live under <data_dir>/schedules/<wallet_name>.yaml. The file is the
canonical source of truth for an in-progress tumble; the runner overwrites it
on every state transition and reads it on startup to resume.
Attributes
SCHEDULES_SUBDIR = 'schedules'
module-attribute
Classes
PlanCorruptError
Bases: ValueError
Raised when an on-disk plan cannot be parsed or validated.
Source code in tumbler/src/tumbler/persistence.py
28 29 | |
PlanNotFoundError
Bases: FileNotFoundError
Raised when no plan exists for the given wallet.
Source code in tumbler/src/tumbler/persistence.py
24 25 | |
Functions:
delete_plan(wallet_name: str, data_dir: Path | str | None = None) -> bool
Remove a wallet's plan file. Returns True if a file was removed,
False if no plan existed.
Source code in tumbler/src/tumbler/persistence.py
108 109 110 111 112 113 114 115 116 117 118 | |
load_plan(wallet_name: str, data_dir: Path | str | None = None) -> Plan
Load a plan for wallet_name. Raises if missing or corrupt.
Source code in tumbler/src/tumbler/persistence.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
plan_path(wallet_name: str, data_dir: Path | str | None = None) -> Path
Return the absolute path where wallet_name's plan is stored.
Source code in tumbler/src/tumbler/persistence.py
44 45 46 47 48 49 50 51 52 53 54 55 56 | |
save_plan(plan: Plan, data_dir: Path | str | None = None) -> Path
Atomically write plan to disk and return the path.
The write is atomic against concurrent readers: we write to a sibling
temp file in the same directory and then os.replace it.
Source code in tumbler/src/tumbler/persistence.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |