feat(message): add Action::AddBondInvoice#146
Conversation
Introduce a dedicated Action::AddBondInvoice variant so that mostrod can distinguish a taker's bond-payout invoice from a buyer's trade payout invoice without inferring intent from order state. Mirrors the existing AddInvoice / PayBondInvoice split. verify() accepts AddBondInvoice under the same payload rules as AddInvoice (id required, PaymentRequest payload), and get_payment_request() now surfaces the bolt11 for this action. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA new ChangesAddBondInvoice Action Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Action::AddBondInvoicevariant so mostrod can distinguish a taker's bond-payout invoice from a buyer's trade payout invoice without inferring intent from order state.AddInvoice/PayBondInvoicesplit: same payload shape (Payload::PaymentRequest), same id requirement, distinct kebab-case discriminator (add-bond-invoice).MessageKind::verifyandMessageKind::get_payment_requestupdated to recognize the new action; docs onPayload::PaymentRequestupdated accordingly.BondResolutionrejection test list, plus a dedicatedtest_add_bond_invoice_wire_format_and_verifycovering accept/reject cases, kebab-case wire format, JSON roundtrip, andget_payment_request.Motivation
In mostrod,
add_bond_invoice_actioncurrently receivesAction::AddInvoicefrom users and has to disambiguate a bond-payout invoice from a trade buyer invoice based on order state. A distinct action discriminator removes that ambiguity at the protocol level.Test plan
cargo buildcargo test --lib message::— all 18 message tests pass, including the new oneAction::AddBondInvoice🤖 Generated with Claude Code
Summary by CodeRabbit