-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(labels): add labels package to handle labeling on-chain transact…
…ions fix(actions.go): change label used for labeling opening transaction to use Opening label from labels package fix(actions.go): change label used for labeling claim by CSV transaction to use ClaimByCsv label from labels package fix(actions.go): change label used for labeling claim by cooperative close transaction to use ClaimByCoop label from labels package fix(actions.go): add label to opening transaction in ValidateTxAndPayClaimInvoiceAction
- Loading branch information
1 parent
eea02b3
commit ba1fd4e
Showing
2 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package labels | ||
|
||
import "fmt" | ||
|
||
const ( | ||
// peerswapLabelPattern is the pattern that peerswap uses to label on-chain transactions. | ||
peerswapLabelPattern = "peerswap -- %s(swap id=%s)" | ||
// opening is the label used for the opening transaction. | ||
opening = "Opening" | ||
// claimByInvoice is the label used for the claim by invoice transaction. | ||
claimByInvoice = "ClaimByInvoice" | ||
// claimByCoop is the label used for the claim by cooperative close transaction. | ||
claimByCoop = "ClaimByCoop" | ||
// ClaimByCsv is the label used for the claim by CSV transaction. | ||
claimByCsv = "ClaimByCsv" | ||
) | ||
|
||
// Opening returns the label used for the opening transaction. | ||
func Opening(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, opening, swapID) | ||
} | ||
|
||
// ClaimByInvoice returns the label used for the claim by invoice transaction. | ||
func ClaimByInvoice(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByInvoice, swapID) | ||
} | ||
|
||
// ClaimByCoop returns the label used for the claim by cooperative close transaction. | ||
func ClaimByCoop(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByCoop, swapID) | ||
} | ||
|
||
// ClaimByCsv returns the label used for the claim by CSV transaction. | ||
func ClaimByCsv(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByCsv, swapID) | ||
} |
This file contains 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