gui+cli+core: anticipated-delivery warning, task #67 amount checks, CLI tools
GUI - "Building your will" row (owner request):
- when a rebuild anticipates the delivery date by one day, show
"Anticipated - new delivery date: <date>" on the "Building your will" row
instead of a plain "Ok";
- the detection compares the will's minimum locktime BEFORE and AFTER the
rebuild, so it also covers relative recipes ("1y"/"30d") that the previous
stored-vs-built comparison missed;
- the sign explanation stays on its own "Signing your will" row so it no
longer overwrites the anticipation warning.
Task #67 - "Checking variables" stuck on "Wait":
- core: Will.check_amounts only requires a fixed amount to be funded when it
is > 0, and only requires percentages to total 100% when the will actually
has percentage heirs; fixed-only / empty-wallet wills no longer raise;
- gui: the amount warning is written on the "Checking variables" row itself
(COLOR_WARNING) instead of being overwritten by the next row; the redundant
"adjustment of the amounts" sentence was dropped.
CLI - will-executor helpers:
- willexecutors_update accepts promo_code;
- willexecutors_select supports bulk apply with only_valid;
- willexecutors_export supports selected/valid subsets;
- import overwrites existing records with sane defaults;
- raise NoServersForChainError with a clear user-facing message; map
NotCompleteWill / HeirChange / WillexecutorChange in _user_facing.
Tests and docs:
- tests for the anticipation row, the CLI helpers and the amount checks;
- i18n catalogs refreshed; CHANGELOG section 67; agent task memory updated.
This commit is contained in:
@@ -823,11 +823,19 @@ class Will:
|
||||
for utxo in all_utxos:
|
||||
wallet_balance += utxo.value_sats()
|
||||
|
||||
if fixed_amount >= wallet_balance:
|
||||
if fixed_amount > 0 and fixed_amount >= wallet_balance:
|
||||
# Only a REAL fixed amount needs to be funded: with no fixed heirs
|
||||
# (all percentages) fixed_amount is 0 and ``0 >= 0`` would wrongly
|
||||
# flag an empty/fully-committed wallet as an amount error.
|
||||
raise FixedAmountException(
|
||||
f"Fixed amount({fixed_amount}) >= {wallet_balance}"
|
||||
)
|
||||
if perc_amount != 100:
|
||||
if perc_heirs and perc_amount != 100:
|
||||
# Percentages only have to add up to 100% when the will actually
|
||||
# uses percentage heirs. A will made ONLY of fixed-amount heirs has
|
||||
# no percentages, so perc_amount is 0 - which used to raise here and
|
||||
# left "Checking variables" stuck on "Wait" for every fixed-only
|
||||
# will (the build normalises the fixed shares anyway).
|
||||
raise PercAmountException(f"Perc amount({perc_amount}) =! 100%")
|
||||
|
||||
for url, wex in willexecutors.items():
|
||||
@@ -835,7 +843,7 @@ class Will:
|
||||
if max_fee is not None and int(wex["base_fee"]) > max_fee:
|
||||
raise WillExecutorFeeTooHighException(wex, max_fee)
|
||||
temp_balance = wallet_balance - int(wex["base_fee"])
|
||||
if fixed_amount >= temp_balance:
|
||||
if fixed_amount > 0 and fixed_amount >= temp_balance:
|
||||
raise FixedAmountException(
|
||||
f"Willexecutor{url} excess base fee({wex['base_fee']}), {fixed_amount} >={temp_balance}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user