bcnmy / docs

Biconomy official documentation
https://docs.biconomy.io/
MIT License
15 stars 28 forks source link

Better highlight the 'success' flag in responses #207

Closed joepegler closed 6 months ago

joepegler commented 6 months ago

We're getting lots of reports from v4 users who are receiving a tx hash and assuming that their code is working, but they are also receiving "success" === "false" from the userOp hash without realising.

In our docs we need to better inform devs to check that success == 'true' in the responseafter they've sent a transaction. For example here, and the rest of the tutorials

See the test here as an example of how the check can be performed

We will add this check in our tests too more thoroughly so that readers of the tests notice how to measure the success of a tx.

TLDR:

Change

    const { receipt: { transactionHash }  } = await wait();

for

    const { success } = await response.wait();

throughout the docs where appropriate

himanshugarg06 commented 6 months ago

what does success flag indicate? and if the user is getting the transactionHash why is the success flag false?

VGabriel45 commented 6 months ago

what does success flag indicate? and if the user is getting the transactionHash why is the success flag false?

The success flag indicated if the user operation has failed or if it is successful. The transaction hash is returned whenever, even if user op fails or not, the user operation execution will not revert the transaction, that is why we need to check the flag for success not the transaction hash.