refactor(cast): deduplicate Tempo boilerplate - #15748
Merged
mattsse merged 5 commits intoJul 21, 2026
Merged
Conversation
Four mechanical extractions, behavior unchanged: - The Tempo provider construction was spelled out at 33 call sites across the cast commands; `tempo_provider(&config)` in the shared tempo module owns it, the keychain doctor's error-matching variant included. - `print_payload` existed as three identical copies in the tip403, receive-policy and storage-credits commands; one copy lives in the shared tempo module. - Seven keychain hardfork gates repeated the same check-and-bail block; `ensure_tempo_hardfork` owns it, and `ensure_tempo_precompile_active` merges the near-identical T6/T7 precompile guards of the receive-policy and storage-credits commands, code-presence fallback included. - Inside `send_tip20_transaction`, the sponsor fee-token-and-attach block was copied in three of the four send paths and the signer resolution in two; `attach_sponsor` and `resolve_send_signer` own them. The four send paths themselves stay separate, they dispatch differently.
0xMars42
requested review from
0xrusowsky,
DaniPopes,
figtracer,
grandizzy,
mablr,
mattsse and
stevencartavia
as code owners
July 15, 2026 05:44
stevencartavia
previously approved these changes
Jul 15, 2026
figtracer
reviewed
Jul 15, 2026
Restore the inline provider construction at its call sites, including the doctor error-matching variant and the session tests. The call sites are back to what master has.
0xMars42
force-pushed
the
refactor/cast-tempo-boilerplate
branch
from
July 16, 2026 19:17
5d227d0 to
ea3ef9c
Compare
stevencartavia
approved these changes
Jul 21, 2026
mattsse
approved these changes
Jul 21, 2026
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.
Motivation
Cast-side counterpart of #15641. The Tempo commands in cast repeat the same blocks: the payload query commands each branch the same way between JSON and human output, the keychain hardfork gates repeat the same check-and-bail block seven times, and
send_tip20_transactioncopies its sponsor attachment and signer resolution across its send paths.Solution
Three mechanical extractions into the shared cast tempo module, behavior unchanged:
print_payloadowns the JSON-or-human output branch shared by the payload query commands (tip403 info/check, receive-policy get/validate/receipt, storage-credits balance/mode/budget).ensure_tempo_precompile_activemerges the near-identical T6/T7 precompile guards of the receive-policy and storage-credits commands, code-presence fallback included.attach_sponsorandresolve_send_signerown the sponsor fee-token-and-attach block (copied in three of the four send paths) and the signer resolution (copied in two). The four send paths themselves stay separate, they dispatch differently.PR Checklist