Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more elegant way to check transactions status #162

Open
shunjizhan opened this issue Dec 24, 2024 · 1 comment
Open

more elegant way to check transactions status #162

shunjizhan opened this issue Dec 24, 2024 · 1 comment

Comments

@shunjizhan
Copy link

shunjizhan commented Dec 24, 2024

in the counter example, we indirectly check if the tx has succeeded by polling the contract state

let counterAfter = await counter.getCounter();
while (counterAfter === counterBefore) {
  counterAfter = await counter.getCounter();
}

However, this might not be the best universal way to check tx status. For example:

  • what if I have a method that increase counter by 1 with 50% chance, do nothing with 50% chance? Polling contract state will run into infinite loop in this case.
  • what if the transaction failed?

In evm we usually have an explicit contract receipt to show if a tx has been mined. It also contains info such as if the tx succeeded or not. If there anything similar in TON blockchain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@shunjizhan and others