buildFundAllocationList builds a list of fund allocations for metadata storage. Parameters: - allocations []Allocation: The calculated allocations. - mappings []model.LineageMapping: The lineage mappings. - precision float64: The precision multiplier. Returns: - []map[string]interface{}: The fund
(allocations []Allocation, mappings []model.LineageMapping, precision float64)
| 779 | // Returns: |
| 780 | // - []map[string]interface{}: The fund allocation list for metadata. |
| 781 | func (l *LedgerForge) buildFundAllocationList(allocations []Allocation, mappings []model.LineageMapping, precision float64) []map[string]interface{} { |
| 782 | fundAllocation := make([]map[string]interface{}, 0, len(allocations)) |
| 783 | |
| 784 | for _, alloc := range allocations { |
| 785 | mapping := l.findMappingByShadowID(mappings, alloc.BalanceID) |
| 786 | if mapping == nil { |
| 787 | continue |
| 788 | } |
| 789 | |
| 790 | fundAllocation = append(fundAllocation, map[string]interface{}{ |
| 791 | "provider": mapping.Provider, |
| 792 | "amount": alloc.Amount, |
| 793 | }) |
| 794 | } |
| 795 | |
| 796 | return fundAllocation |
| 797 | } |
| 798 | |
| 799 | // getIdentityIdentifier generates a unique identifier string for an identity. |
| 800 | // It uses the identity's name (first/last or organization) combined with a portion of the ID. |
no test coverage detected