fcl-js
fcl-js copied to clipboard
PreAuthz Payer is appended to the payer array even if it is a different account
Problem
Previously when a payer was added to a transaction it overrode the current payer. With #1040 the payers became an array. Currently, when a new payer (meaning new address, not a different key) is added it is appended to the array instead of replacing it which is the previous default.
Is this one fixed? Been a while
@lukaracki Closed as resolved by https://github.com/onflow/fcl-js/issues/1262
I'm still getting "Payer cannot be different accounts" with fcl 1.2.0
The same error which I was getting that caused this exact issue to be raised. Here's the discord thread: https://discord.com/channels/613813861610684416/699275726704083064/981598487357575219
@gregsantos
Thanks @lukaracki Will have to dig into this again if you are still seeing the same issue. @bthaile Hoping maybe you have insight into this issue or potential fix.
Should we reopen this issue or make a new one?
Getting this error with 1.3.1 as well
@ShainDholakiya Do you have a snippet I could see to reproduce this?
Do not get the error anymore
How did you solve this? You managed to have your server account pay for the transaction while having the user give his account's Auth to the transaction script?
@justinbarry
I tested this again, looks like it works if you put the current user as the payer, but if the payer is the serverAuthorization it doesn't work (and it worked in pre 1.0 fcl):
works:
authorizations([authz, serverAuthorization]),
payer(authz),
proposer(authz),
doesn't:
authorizations([authz, serverAuthorization]),
payer(serverAuthorization),
proposer(authz),
don't know how or why it worked for me before but does not work anymore. signer
is the server auth
proposer: signer,
payer: fcl.authz,
authorizations: [fcl.authz, signer],
Can we get some attention on this issue? It is causing us to not use the latest fcl because we need this and that is not ideal.
@bjartek could you please test whether https://github.com/onflow/fcl-js/pull/1532 fixes your issue?
you can use these versions:
"@onflow/fcl": "1.6.0-accounts.1",
"@onflow/fcl-wc": "4.0.0-accounts.1",
"@onflow/sdk": "1.2.3-accounts.1",
"@onflow/transport-grpc": "1.2.2-accounts.0",
"@onflow/transport-http": "1.7.2-accounts.1",