Shigoto-dev19 / ZK-Battleships-Solana

First decentralized & private Battleships game on Solana. Honorable Mention recognition in Solana Grizzlython Hackathon
https://solana.com/news/solana-grizzlython-winners?utm_source=Iterable&utm_medium=email&utm_campaign=campaign_6567415#:~:text=Pet%20Legends-,Zk%20Battleships,-Little%20Bonkers
23 stars 4 forks source link

Move to constructor #13

Open ananas-block opened 1 year ago

ananas-block commented 1 year ago

https://github.com/Shigoto-dev19/ZK-Battleships-Solana/blob/6653dee2976ecbdcff0a48529c79a9b5dd4e7685/src/battleShipClient.ts#L87

https://github.com/Shigoto-dev19/ZK-Battleships-Solana/blob/master/src/battleShipClient.ts#L93

should be: this.F.toObject(this.boardHash)

Shigoto-dev19 commented 1 year ago

you mean i change it from static to public

Shigoto-dev19 commented 1 year ago

i get that you want to use it as an input in the constructor, so it can be instantiated once in the test and used for both classes. what i did, is that i instanitiated F for each class once when a play hosts or joins. To me i wanted the class initialization clean with no util as an input.