MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / getEventFromStatus

Function getEventFromStatus

webhooks.go:48–65  ·  view source on GitHub ↗

getEventFromStatus maps a transaction status to a corresponding event string. Parameters: - status string: The status of the transaction. Returns: - string: The corresponding event string for the transaction status.

(status string)

Source from the content-addressed store, hash-verified

46// Returns:
47// - string: The corresponding event string for the transaction status.
48func getEventFromStatus(status string) string {
49 switch strings.ToLower(status) {
50 case strings.ToLower(StatusQueued):
51 return "transaction.queued"
52 case strings.ToLower(StatusApplied):
53 return "transaction.applied"
54 case strings.ToLower(StatusScheduled):
55 return "transaction.scheduled"
56 case strings.ToLower(StatusInflight):
57 return "transaction.inflight"
58 case strings.ToLower(StatusVoid):
59 return "transaction.void"
60 case strings.ToLower(StatusRejected):
61 return "transaction.rejected"
62 default:
63 return "transaction.unknown"
64 }
65}
66
67// processHTTP sends a webhook notification via HTTP POST request.
68//

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected