#How to test transactions and account balances
4 messages · Page 1 of 1 (latest)
I would suggest you going in a way of prepaid balance way. User send balance prior and utilize this balance while interacting with the contract. Because of average of 3min block time it won't be viable for you to ask for new onchain tx for every action. When you have the balance you can serialize many transactions.
Thanks! I'm not sure I completely understand. Can you point me to a reference or doc that explains this concept?
I assume this is more about testing than about creating something with ideal UX, so I'd not worry about avoiding slow block times.
I think you can achieve what you want by doing something like the deposit() method here: https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp#signing-transactions-and-explicit-account-updates
i.e., include logic like this in your method that makes a move.
(note: this.sender is not constrained in the proof to be the actual tx sender. it's an unconstrained public key the prover could choose. zkApp proofs can, in general, not make any assertions about the sender. but that doesn't usually matter though)