makoto / blockparty

NO BLOCK NO PARTY
MIT License
164 stars 41 forks source link

change paritipantsIndex from hashmap to array #95

Open makoto opened 6 years ago

makoto commented 6 years ago

I changed participantsIndex from hashmap to array. This has a slight penalty on gas cost (contract create 1686592 -> 1764065, and register 119996 -> 120265), but it enables me to get the whole array using getParticipants function. I believe that this was impossible with hashmap. This change should retain the interface exactly as is.

makoto commented 6 years ago

One of the problems is that this actually breaks compatibility with old contract as the old contract does not have getParticipants. if I change dapp js to use getParticipants, it won't work against old contract anymore.