This PR adds a fourth status to the transactions: dropped. Currently we make no difference between failed and dropped transactions so we can't give proper feedback and instructions to the users on what to do (ie. if we knew a transaction was dropped we could point them to retry the transaction with a higher fee).
waitForCompletion: this will always return a transaction, that can be success, failed or dropped (before it only returned success or failed transactions).
getConfirmedTransaction: this function works the same as before, returning a promise of the confirmed transaction and throwing otherwise, but the difference is that now there are two types of errors: FailedTransactionError and DroppedTransactionError. The former includes a MinedTransaction (which contains a receipt) the latter includes a DroppedTransaction (only hash and status).
This PR adds a fourth status to the transactions:
dropped
. Currently we make no difference between failed and dropped transactions so we can't give proper feedback and instructions to the users on what to do (ie. if we knew a transaction was dropped we could point them to retry the transaction with a higher fee).waitForCompletion
: this will always return a transaction, that can besuccess
,failed
ordropped
(before it only returnedsuccess
orfailed
transactions).getConfirmedTransaction
: this function works the same as before, returning a promise of theconfirmed
transaction and throwing otherwise, but the difference is that now there are two types of errors:FailedTransactionError
andDroppedTransactionError
. The former includes aMinedTransaction
(which contains a receipt) the latter includes aDroppedTransaction
(only hash and status).I added tests for the dropped/failed scenarios