refactor: fold remaining extension-flow wrappers through _exec_logged#306
Open
hunnyboy1217 wants to merge 1 commit intoentrius:testfrom
Open
refactor: fold remaining extension-flow wrappers through _exec_logged#306hunnyboy1217 wants to merge 1 commit intoentrius:testfrom
hunnyboy1217 wants to merge 1 commit intoentrius:testfrom
Conversation
Extends _exec_logged with a wait_for_inclusion kwarg (default True) and collapses the six propose/challenge/finalize wrappers for reservation and swap-timeout extensions to single delegations. Default preserves behavior for the 23 existing callers; the four no-wait sites pass it explicitly. Closes entrius#305.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #305
Summary
Direct follow-on to #91, which standardized 23 write wrappers through
_exec_loggedbut left the six propose/challenge/finalize wrappers for reservation and swap-timeout extensions out of scope. Those six were skipped because four of them passwait_for_inclusion=False— a parameter the helper didn't accept.This PR extends
_exec_loggedwithwait_for_inclusion: bool = Trueand collapses the six remaining wrappers to singlereturn self._exec_logged(...)delegations. DefaultTruepreserves byte-identical behavior for the 23 callers already routed through the helper; the four no-wait sites pass the kwarg explicitly.Motivation
_exec_logged(e.g., if pre-flight balance probing or log wording evolves).wait_for_inclusion=Falsesemantics documented at allways/contract_client.py:529-535 are preserved.Changes
_exec_logged(L1009-L1027): addedwait_for_inclusion: bool = Truekwarg, threaded through toexec_contract_rawpropose_extend_reservation(no-wait),challenge_extend_reservation(no-wait),finalize_extend_reservation(waits)propose_extend_timeout(no-wait),challenge_extend_timeout(no-wait),finalize_extend_timeout(waits)Type of Change
Test plan
uv run pytest tests/— 411 passeduv run pytest tests/test_optimistic_extensions.py— 31 passed (covers all six wrappers)uv run ruff check allways/ neurons/— all checks passeduv run ruff format --check allways/contract_client.py— already formatteduv run pre-commit run --files allways/contract_client.py— all hooks passedwait_for_inclusionsemantics preserved — verified by diff review