lfglabs-dev / api.starknet.quest

starknet.quest rust backend
7 stars 28 forks source link

feat: add multiple winners #176

Closed ayushtom closed 10 months ago

ayushtom commented 10 months ago

In this PR - we have added a mechanism where we fetch num_of_winners (assume 10) with some extra number(assume 5) so that we have more addresses incase any of the addresses repeat. we generate the winners from each quest using the above two values and get total winners (10 + 5=15) for each quest inside the boost with the help of mongo_db. After this is done we run a loop till we generate num_of_winners from the list of winners generated by mongo_db. If the address already exists then we skip it and use other address. Incase the address is not repeated , it comes into the winners_array which is the final list of winners