This PR changes the way we get transactions. The biggest change it's that it removes the retry logic that was causing LOTS of false dropped transaction.
Instead here we are using the network to figure out the status of the transaction, by using the account's current nonce.
The previous status types were confirmed, pending and failed. I changed failed for reverted and added dropped, replaced and queued, so we can be able to give more feedback to the users regarding the status of their transactions.
I removed the helpers isFailure, isDropped, isTxDropped and waitForCompletion since they are redundant now (all the use cases can be fulfilled with getTransaction and getConfirmedTransaction).
The way getTransaction works hasn't changed for the end user, it returns a tx or null if the transaction is not known by the node. The difference is that the tx now has more possible statuses.
The way getConfirmedTransaction works is still the same for the end user, it waits for the confirmed tx and throws if the transactions is reverted or dropped/replaced. The main difference is that now it doesn't use a retry logic to drop the transaction, it checks against the network.
I also added a few handy methods like eth.getCurrentNonce, eth.getBlockNumber, eth.getBlock, and eth.getTransactionsByAccount
This PR changes the way we get transactions. The biggest change it's that it removes the retry logic that was causing LOTS of false dropped transaction.
Instead here we are using the network to figure out the status of the transaction, by using the account's current nonce.
The previous status types were
confirmed
,pending
andfailed
. I changedfailed
forreverted
and addeddropped
,replaced
andqueued
, so we can be able to give more feedback to the users regarding the status of their transactions.I removed the helpers
isFailure
,isDropped
,isTxDropped
andwaitForCompletion
since they are redundant now (all the use cases can be fulfilled withgetTransaction
andgetConfirmedTransaction
).The way
getTransaction
works hasn't changed for the end user, it returns atx
ornull
if the transaction is not known by the node. The difference is that thetx
now has more possible statuses.The way
getConfirmedTransaction
works is still the same for the end user, it waits for the confirmed tx and throws if the transactions is reverted or dropped/replaced. The main difference is that now it doesn't use a retry logic to drop the transaction, it checks against the network.I also added a few handy methods like
eth.getCurrentNonce
,eth.getBlockNumber
,eth.getBlock
, andeth.getTransactionsByAccount
HOW TO TEST
You can test these features by testing this PR https://github.com/decentraland/gate/pull/21