setTransactionStatus determines and sets the appropriate status for a transaction. It evaluates the transaction's scheduled time and current status to set the correct status. If the transaction is scheduled for the future, it sets StatusScheduled. If the transaction has no status, it sets StatusQueu
(transaction *model.Transaction)
| 2008 | // Parameters: |
| 2009 | // - transaction *model.Transaction: The transaction for which to set the status. |
| 2010 | func setTransactionStatus(transaction *model.Transaction) { |
| 2011 | if !transaction.ScheduledFor.IsZero() { |
| 2012 | transaction.Status = StatusScheduled |
| 2013 | } else if transaction.Status == "" { |
| 2014 | transaction.Status = StatusQueued |
| 2015 | } |
| 2016 | } |
| 2017 | |
| 2018 | // setTransactionMetadata initializes and sets the required metadata for a transaction. |
| 2019 | // calculates the transaction hash, and sets the precise amount based on the transaction's precision. |
no outgoing calls
no test coverage detected