Repository navigation
Distinguish shipment decode failures and validate escrow funding inputs - #1909
Merged
mftee merged 1 commit intoNov 22, 2026
Conversation
|
@BashMan11 is attempting to deploy a commit to the Mftee's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@BashMan11 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Closed
3 tasks
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
Work for the four issues assigned to @BashMan11.
DocumentError::ShipmentDecodeFailedis appended as code 13; only the inner conversion failure oftry_get_shipmentmaps to it, while an unknown shipment id still maps toShipmentNotFound. Existing discriminants are unchanged.register_documentnow rejectsShipmentStatus::Cancelledwith the newShipmentCancelled(14). The crate README documents the status matrix: all document types are allowed for Created/Accepted/InTransit/Delivered, and for Completed (post-delivery invoices/proofs) and Disputed (evidence), but never for Cancelled.resolve_dispute_split(shipment_id, carrier_amount)with0 <= carrier_amount <= amount. It transfers the carrier share and the remainder to the shipper in one call, records the split underDataKey::EscrowSplit, and exposesget_dispute_split. The booleanresolve_disputeentrypoint is kept for ABI compatibility; README signatures now match the code.DataKey::ShipmentContractis set,fund_escrownow loads the shipment through a mirrored#[contractclient]and requiresAcceptedstatus, matching carrier and matchingShipment.price. New error codes 12–15 cover lookup/decode failure, wrong status, carrier mismatch and amount mismatch. With no link configured the trusted/off-chain behaviour is unchanged and documented.Per scope, no test files were added or changed.
Closes #1858
Closes #1859
Closes #1860
Closes #1861