extractFundAllocation extracts fund allocation data from transaction metadata. Parameters: - metadata map[string]interface{}: The transaction metadata. Returns: - []map[string]interface{}: The fund allocation data, or nil if not present.
(metadata map[string]interface{})
| 1189 | // Returns: |
| 1190 | // - []map[string]interface{}: The fund allocation data, or nil if not present. |
| 1191 | func (l *LedgerForge) extractFundAllocation(metadata map[string]interface{}) []map[string]interface{} { |
| 1192 | if metadata == nil { |
| 1193 | return nil |
| 1194 | } |
| 1195 | |
| 1196 | allocation, ok := metadata[LineageFundAllocation] |
| 1197 | if !ok { |
| 1198 | return nil |
| 1199 | } |
| 1200 | |
| 1201 | alloc, ok := allocation.([]interface{}) |
| 1202 | if !ok { |
| 1203 | return nil |
| 1204 | } |
| 1205 | |
| 1206 | result := make([]map[string]interface{}, 0, len(alloc)) |
| 1207 | for _, a := range alloc { |
| 1208 | if m, ok := a.(map[string]interface{}); ok { |
| 1209 | result = append(result, m) |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | return result |
| 1214 | } |
| 1215 | |
| 1216 | // commitShadowTransactions commits all inflight shadow transactions for a parent transaction. |
| 1217 | // It attempts to commit all shadows and returns an error if any fail (for outbox retry). |
no outgoing calls
no test coverage detected