Skip to content

Commit

Permalink
Updated 'ListOfFunders()'.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurigabrich committed Mar 24, 2020
1 parent 2891061 commit 745b46c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions neo-dapp/microgrid-dapp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() ][];
Expand All @@ -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() ][];
Expand All @@ -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;
}


Expand Down

0 comments on commit 745b46c

Please sign in to comment.