onflow / flow-playground

Flow Playground front-end app 🤹‍♂️
https://play.flow.com
Apache License 2.0
116 stars 26 forks source link

BUG: Playground thinks that transactions with multiple Account entitlements have multiple signers #804

Closed joshuahannan closed 2 months ago

joshuahannan commented 2 months ago

Describe the bug When opening up a transaction with an account object with multiple entitlements, the playground incorrectly thinks that it requires multiple signers and won't let you submit the transaction without selecting a second signer.

To Reproduce

Expected behavior Expected to be able to sign with a single signer

Screenshots Screenshot 2024-09-17 at 5 02 43 PM

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

joshuahannan commented 2 months ago

@nialexsan It looks like you only made the fix for transactions with 2 entitlements. If I have a transaction with 3 entitlements, it still thinks that there should be three signers when there should only be one. Can we make sure that this is true for any number of entitlements?

nialexsan commented 2 months ago

@joshuahannan do you have a transaction snippet you're using?

jribbink commented 2 months ago

If possible I would strongly recommend using the Cadence parser https://www.npmjs.com/package/@onflow/cadence-parser. Regex parsing transaction args is just a nightmare and we've been down this rabit hole a bunch of times in Flow JS Testing and Flow Cadut.

That being said, those repos have had their regex updated for Cadence 1.0, so you can also look here for code for parsing the args @nialexsan

joshuahannan commented 2 months ago

I just forgot to do a hard refresh. My bad! I'll close this