MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / createQueueCopy

Function createQueueCopy

transaction.go:2064–2070  ·  view source on GitHub ↗

createQueueCopy creates a new copy of a transaction specifically for queueing. It generates new identifiers and maintains the relationship with the original transaction. Parameters: - persistedTxn *model.Transaction: The persisted transaction to copy. - originalRef string: The original reference to

(persistedTxn *model.Transaction, originalRef string)

Source from the content-addressed store, hash-verified

2062// Returns:
2063// - *model.Transaction: A pointer to the new queue copy of the transaction.
2064func createQueueCopy(persistedTxn *model.Transaction, originalRef string) *model.Transaction {
2065 queueTxn := *persistedTxn
2066 queueTxn.TransactionID = model.GenerateUUIDWithSuffix("txn")
2067 queueTxn.ParentTransaction = persistedTxn.TransactionID
2068 queueTxn.Reference = fmt.Sprintf("%s_q", originalRef)
2069 return &queueTxn
2070}
2071
2072// updateSplitTransactions updates the metadata of split transactions to maintain their relationships.
2073// It sets the parent transaction ID and creates linked references for each split transaction.

Calls 1

GenerateUUIDWithSuffixFunction · 0.92

Tested by 3

TestQueueTransactionFlowFunction · 0.68
BenchmarkCreateQueueCopyFunction · 0.68