feat: flatten stripe_multichain helpers to kwargs; delete 4 wrappers - #37
Merged
Merged
Conversation
Flattens the 4 stripe_multichain builders:
- create_multichain_payment_intent(CreateMultichainPaymentIntentInput(...))
→ create_multichain_payment_intent(*, stripe, amount, currency="usd", networks=None, metadata=None, idempotency_key=None)
- create_pi_cache(PiCacheOptions(...))
→ create_pi_cache(*, redis_url=None, ttl_seconds=300, key_prefix="payto:")
- simulate_crypto_deposit(SimulateCryptoDepositInput(...))
→ simulate_crypto_deposit(*, payment_intent_id, network, stripe_secret_key, buyer_wallet=None, ...)
- simulate_deposit_if_test_mode(SimulateDepositIfTestModeInput(...))
→ simulate_deposit_if_test_mode(*, get_payment_intent_id, deposit_address, network, stripe_secret_key, ...)
Deleted from public exports: CreateMultichainPaymentIntentInput, PiCacheOptions,
SimulateCryptoDepositInput, SimulateDepositIfTestModeInput.
Kept (consumers pattern-match): PiCache, MultichainPaymentIntentResult,
StripeClientLike.
Tests: 1033 passed / 3 skipped, 95.15% coverage. Added 2 fill tests covering
optional kwargs (`transaction_hash` / `stripe_version` / `extra`) and the
error-swallow branch in `simulate_deposit_if_test_mode` so coverage stays
above the 95% floor after the dataclass-init lines went away.
ty + ruff clean. vulture: only known false positives (string-cast,
Protocol-method-param) remain.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Flattens the 4
stripe_multichainbuilders.create_multichain_payment_intent(CreateMultichainPaymentIntentInput(...))create_multichain_payment_intent(*, stripe, amount, currency="usd", networks=None, metadata=None, idempotency_key=None)create_pi_cache(PiCacheOptions(...))create_pi_cache(*, redis_url=None, ttl_seconds=300, key_prefix="payto:")simulate_crypto_deposit(SimulateCryptoDepositInput(...))simulate_crypto_deposit(*, payment_intent_id, network, stripe_secret_key, ...)simulate_deposit_if_test_mode(SimulateDepositIfTestModeInput(...))simulate_deposit_if_test_mode(*, get_payment_intent_id, deposit_address, network, stripe_secret_key, ...)Deleted from exports
CreateMultichainPaymentIntentInput,PiCacheOptions,SimulateCryptoDepositInput,SimulateDepositIfTestModeInput.Kept
PiCache,MultichainPaymentIntentResult,StripeClientLike.Coverage backfill
Added 2 small fill tests covering the optional
transaction_hash/stripe_version/extrakwargs (line 51, 53, 59) and theExceptionlog-swallow branch insimulate_deposit_if_test_mode(lines 102-114) so coverage stays at 95%+ after the dataclass-init lines collapsed.Test plan
uv run pytest tests/— 1033 passed / 3 skipped, 95.15% coverage (up from 95.04%)uv run ty check agentscore_commerce/— cleanuv run ruff check . && uv run ruff format .— cleanuv run vulture agentscore_commerce/ --min-confidence 80— only the known false positives remain