Extract helper methods for readability across chain providers and axon handlers#18
Open
bittoby wants to merge 2 commits intoentrius:testfrom
Open
Extract helper methods for readability across chain providers and axon handlers#18bittoby wants to merge 2 commits intoentrius:testfrom
bittoby wants to merge 2 commits intoentrius:testfrom
Conversation
8aaa519 to
20b3123
Compare
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.
Summary
Several long methods had too many responsibilities packed into one function, making them hard to follow. This PR pulls out focused helper methods without changing any behavior.
What changed
bitcoin.py
_rpc_resolve_sender()— extracts the sender address lookup from the first vin inside_rpc_verify_transaction_blockstream_calc_confirmations()— extracts the tip-height fetch and confirmation math from_blockstream_verify_transaction_resolve_sender_utxos()— extracts address matching and UTXO fetching fromsend_amount_lightweight(was ~45 lines deep)_select_utxos()— extracts greedy coin selection and fee calculation fromsend_amount_lightweight_broadcast_tx()— extracts the Blockstream broadcast call fromsend_amount_lightweightsubtensor.py
_match_transfer()— extracts the extrinsic-matching logic from the inner loop ofverify_transactionaxon_handlers.py
_load_swap_commitment()— consolidates the duplicated commitment read + chain validation inhandle_swap_reserveandhandle_swap_confirm_resolve_swap_direction()— extracts deposit/fulfillment address resolution and rate lookup fromhandle_swap_confirmNo behavioral changes, no new dependencies, just reorganization.