You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Six write wrappers on AllwaysContractClient in allways/contract_client.py still hand-roll the four-line body that PR #91 standardized for the other 23 — the propose / challenge / finalize triples for reservation and swap-timeout extensions. They were left out because four of them pass wait_for_inclusion=False, a parameter _exec_logged doesn't currently accept:
Six wrappers, same ensure_initialized → exec_contract_raw → bt.logging.info → return shape _exec_logged already standardizes elsewhere. Each new propose/challenge/finalize flow (future extension types) resurrects the same five-line block.
Proposal
Extend _exec_logged (allways/contract_client.py:1009) with the one parameter that's keeping these six wrappers off the helper:
Default wait_for_inclusion=True preserves behavior for the 23 wrappers already routed through _exec_logged. The wait_for_inclusion=False cases are documented at allways/contract_client.py:529-535 as deliberate — idempotent calls deduped contract-side via ProposalAlreadyPending / ChallengeWindow*.
Single source of truth for write-side extrinsic submission — today these six are the only write paths that can drift independently from _exec_logged (e.g., if pre-flight balance probing or log wording evolves).
Lower-friction extension — future propose/challenge/finalize triples inherit the one-line shape instead of resurrecting the 5-line body.
Smaller surface area — ~20-25 net LOC removed, single file, no behavior change.
Problem
Six write wrappers on
AllwaysContractClientin allways/contract_client.py still hand-roll the four-line body that PR #91 standardized for the other 23 — the propose / challenge / finalize triples for reservation and swap-timeout extensions. They were left out because four of them passwait_for_inclusion=False, a parameter_exec_loggeddoesn't currently accept:Six wrappers, same
ensure_initialized → exec_contract_raw → bt.logging.info → returnshape_exec_loggedalready standardizes elsewhere. Each new propose/challenge/finalize flow (future extension types) resurrects the same five-line block.Proposal
Extend
_exec_logged(allways/contract_client.py:1009) with the one parameter that's keeping these six wrappers off the helper:Then collapse each wrapper to a single delegation:
Reservation extension:
propose_extend_reservation(no-wait),challenge_extend_reservation(no-wait),finalize_extend_reservation(waits)Timeout extension:
propose_extend_timeout(no-wait),challenge_extend_timeout(no-wait),finalize_extend_timeout(waits)Default
wait_for_inclusion=Truepreserves behavior for the 23 wrappers already routed through_exec_logged. Thewait_for_inclusion=Falsecases are documented at allways/contract_client.py:529-535 as deliberate — idempotent calls deduped contract-side viaProposalAlreadyPending/ChallengeWindow*.Why
_exec_loggedhelper refactor: fold extrinsic wrappers through a shared _exec_logged helper #91 — these six fell out of scope only because the helper lacked the kwarg they needed._exec_logged(e.g., if pre-flight balance probing or log wording evolves).