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

Method buildFundAllocationList

lineage.go:781–797  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

779// Returns:
780// - []map[string]interface{}: The fund allocation list for metadata.
781func (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.

Callers 1

Calls 1

findMappingByShadowIDMethod · 0.95

Tested by

no test coverage detected