virto-network / open-runtime-module-library

Substrate Open Runtime Module Library
Apache License 2.0
0 stars 1 forks source link

Partial refund when resolving disputes #13

Closed olanod closed 2 years ago

olanod commented 2 years ago

Based on a question from @JosephKnecht-lab in his external review, we could consider having a method for dispute resolvers to be able to split resources between the buyer and seller in case the current all-or-nothing approach is not enough.

olanod commented 2 years ago

I'm thinking to use this as a starting point to do do some refactoring to simplify our API, we can start by first introducing an internal settle_payment(from: AccountId, recipient: AccountId, recipient_share: Percent) method that is used by some of our existing extrinsics. E.g. cancel is a settle_payment(from, recipient, Percent::zero()) or release a settle_payment(from, recipient, Percent::one()). Later instead of resolve_cancel_payment and resolve_release_payment we expose the settle_payment directly.