From 745b46c4c037ae9acc1fff0f2dc57dd15f7b4a84 Mon Sep 17 00:00:00 2001 From: Yuri Gabrich Date: Tue, 24 Mar 2020 09:31:56 -0300 Subject: [PATCH] Updated 'ListOfFunders()'. --- neo-dapp/microgrid-dapp.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/neo-dapp/microgrid-dapp.cs b/neo-dapp/microgrid-dapp.cs index e265bca..b331140 100644 --- a/neo-dapp/microgrid-dapp.cs +++ b/neo-dapp/microgrid-dapp.cs @@ -837,7 +837,7 @@ public static object PowerUpResult( string id, string ppID = null ) return "There is nothing more to be done."; } - // To return the IDs of each PP to be later used on other functions. + // To return the IDs of each PP. private static byte[][] ListOfPPs() { byte[][] ppIDs = new byte[ (int)NumOfPP() ][]; @@ -850,7 +850,7 @@ private static byte[][] ListOfPPs() return ppIDs; } - // To return the address of each member to be later used on other functions. + // To return the address of each member. private static byte[][] ListOfMembers() { byte[][] addresses = new byte[ (int)NumOfMemb() ][]; @@ -864,9 +864,22 @@ private static byte[][] ListOfMembers() } // To return a list of members that have financed a new PP. - private static byte[][] ListOfFunders( string PPid ) + private static byte[][] ListOfFunders( string ppID ) { - return new byte[][] { "Only for tests purposes.".AsByteArray() }; + byte[][] funders = new byte[ (int)GetCrowd(ppID, "contributions") ][]; + + int num = 0; + foreach (byte[] member in ListOfMembers()) + { + var bid = GetBid( ppID, member ); + + if (bid != 0) + { + funders[num] = member; + num++; + } + } + return funders; }