Skip to content

Commit

Permalink
improve comments and add withdrawal reason
Browse files Browse the repository at this point in the history
  • Loading branch information
havan committed Dec 3, 2024
1 parent 5b38da6 commit 732aadc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 12 deletions.
11 changes: 8 additions & 3 deletions proto/cmp/services/cancellation/v1/accept.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ message AcceptCancellationRequest {
// Cancellation token ID
uint64 token_id = 2;

// Refund amount to validate the acceptance on-chain
// Refund amount that must match the original cancellation proposal for on-chain
// validation. The transaction will fail if the amounts don't match. This is used
// to prevent front-running attacks.
cmp.types.v2.Price refund_amount = 3;
}

Expand All @@ -26,7 +28,10 @@ message AcceptCancellationResponse {
// Response header
cmp.types.v1.ResponseHeader header = 1;

// Transaction ID on-chain for the cancellation proposal acceptance. This
// transaction proves the acceptance of the proposal on-chain to avoid disputes.
// Transaction ID on-chain for the cancellation proposal acceptance.
// This transaction can be verified on-chain to:
// 1. Prove the exact time of acceptance
// 2. Validate the accepted refund amount
// 3. Prevent disputes about acceptance terms
string transaction_id = 2;
}
7 changes: 5 additions & 2 deletions proto/cmp/services/cancellation/v1/counter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ message CounterCancellationResponse {
// Response header
cmp.types.v1.ResponseHeader header = 1;

// Transaction ID on-chain for the cancellation proposal counter. This transaction
// proves the counter of the proposal on-chain to avoid disputes.
// Transaction ID on-chain for the cancellation proposal counter.
// This transaction can be verified on-chain to:
// 1. Prove the exact time of the counter proposal
// 2. Validate the counter refund amount
// 3. Prevent disputes about counter terms
string transaction_id = 2;
}
8 changes: 6 additions & 2 deletions proto/cmp/services/cancellation/v1/initiate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ message InitiateCancellationResponse {
cmp.types.v1.ResponseHeader header = 1;

// Transaction ID on-chain for the cancellation proposal initiation. This
// transaction proves the initiation of the cancellation proposal on-chain to
// avoid disputes.
// transaction proves the initiation of the cancellation proposal on-chain.
//
// This transaction can be verified on-chain to:
// 1. Prove the exact time of initiation of the cancellation proposal
// 2. Validate the refund amount
// 3. Prevent disputes about the cancellation terms
string transaction_id = 2;
}
8 changes: 6 additions & 2 deletions proto/cmp/services/cancellation/v1/reject.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ message RejectCancellationResponse {
// Response Header
cmp.types.v1.ResponseHeader header = 1;

// Transaction ID on-chain for the cancellation proposal rejection. This
// transaction proves the rejection of the proposal on-chain to avoid disputes.
// Transaction ID on-chain for the cancellation proposal rejection.
//
// This transaction can be verified on-chain to:
// 1. Prove the exact time of the rejection
// 2. Validate the rejection reason
// 3. Prevent disputes about the cancellation
string transaction_id = 2;
}
13 changes: 10 additions & 3 deletions proto/cmp/services/cancellation/v1/withdraw.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package cmp.services.cancellation.v1;

import "cmp/services/cancellation/v1/reason.proto";
import "cmp/types/v1/common.proto";

// Request for withdrawal of an active cancellation proposal
Expand All @@ -11,15 +12,21 @@ message WithdrawCancellationRequest {

// Cancellation token ID
uint64 token_id = 2;

// Withdrawal reason
cmp.services.cancellation.v1.WithdrawalReason reason = 3;
}

// Response for withdrawal of an active cancellation proposal
message WithdrawCancellationResponse {
// Response header
cmp.types.v1.ResponseHeader header = 1;

// Transaction ID on-chain for withdrawing the cancellation proposal. This
// transaction proves the withdrawal of the cancellation proposal on-chain to
// avoid disputes.
// Transaction ID on-chain for withdrawing the cancellation proposal.
//
// This transaction can be verified on-chain to:
// 1. Prove the exact time of withdrawal
// 2. Validate the accepted refund amount
// 3. Prevent disputes about acceptance terms
string transaction_id = 2;
}

0 comments on commit 732aadc

Please sign in to comment.