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

Wrongly marking a transaction as "reverted" when it didn't #81

Open
tmilar opened this issue Sep 1, 2020 · 0 comments · May be fixed by #82
Open

Wrongly marking a transaction as "reverted" when it didn't #81

tmilar opened this issue Sep 1, 2020 · 0 comments · May be fixed by #82
Labels
bug Something isn't working

Comments

@tmilar
Copy link

tmilar commented Sep 1, 2020

Running some tests on Ropsten network, seems to happen when the network is slow, a transaction is being wrongly marked as Reverted status, when it didn't.

For example, tx hash 0x3cc266a2d188e26eed3033f34eafa8f7f583d40f09db76dfb8430557ddb23a66, took about 1-2 mins to get up to 4 block confirmations.

When debugging this, I've noticed that in txUtils.ts, the response of await eth.getTransaction(hash), was including a defined blockNumber value, which means it has been "received by the network" - ie. not pending/queued/replaced. But later on, the call to await eth.getTransactionReceipt(hash) still returned null because the tx was still pending, ie. the block was not yet mined, according to web3 docs https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#gettransactionreceipt .

However in the next conditional, the if receipt == null considers it as being "reverted" which is not correct. By the docs, if the tx would've reverted, it would just have a status false (or true if confirmed).

tmilar added a commit to tmilar/decentraland-dapps that referenced this issue Sep 1, 2020
@nicosantangelo nicosantangelo added the bug Something isn't working label Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants