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

Unnessary function #5

Closed ananas-block closed 1 year ago

ananas-block commented 1 year ago

https://github.com/Shigoto-dev19/ZK-Battleships-Solana/blob/39e42bc8ee11b75b3559b9ad005c97b33dc9baf3/src/utils.ts#L60

Shigoto-dev19 commented 1 year ago

I wrote this to avoid block-redeclaration errors, when proof and public signals are called in the same block having the same name makes error

ananas-block commented 1 year ago

you can call the variables differently, but this should not be an issue with the client class

Shigoto-dev19 commented 1 year ago

it is an object result, i tried that even when coding elgamal test. ill try a different solution

ananas-block commented 1 year ago

shouldn't be necessary anyway

ananas-block commented 1 year ago

let {proof1, publicInputs1} = snarkjs.fullProve(); might work but you should generate two proofs in the same function

let proofAndPublicInputs = snarkjs.fullProve(); will work for sure

Shigoto-dev19 commented 1 year ago

I am leaving the function, it makes things more clearer and practical, one method is to use proof and public signals as variables and change their values whenever fullprove is called, the names always stay netural, for me it is a matter of two lines that facilitate the fullprove procedure, I started doing what u wrote but i didn't see it useful. If you see that it makes difference, I can do it again