Closed LefterisJP closed 3 years ago
right now we use infuras API to make sure tx's were confirmed.. ill have to double check but i dont tihnk it provides the dropped/replaced tx info
from dashboard.utils import get_web3
web3 = get_web3(network)
tx = web3.eth.getTransactionReceipt(txid)
print(tx)
yields
In [6]: from dashboard.utils import get_web3
...:
...: web3 = get_web3(network)
...: tx = web3.eth.getTransactionReceipt(txid)
...: print(tx)
...:
...:
None
hmmm etherscan API doesnt provide replacement tx info either.. https://bits.owocki.com/wbukX6rQ
Handling validity of on-chain transactions can be tricky and unfortunately differs per ethereum client implementation.
If the transaction receipt of a transaction is None you have to assume it's not mined.
it'd be great if there was an easy way to get the replacment tx ID programmatically.. looks like etherscans API doesnt show this (even though their UI does)
Perhaps we can ask their opinion on this. If it would also be possible for them to expose this via their API?
If you are not the one sending the pending transaction, so that you also get the new hash for the replaced transaction I am not really sure how to query for the new transaction either programmatically.
Even if say you kept the nonce of the pending transaction, I am not aware of a way to query a transaction for an address by nonce. I guess only archive nodes that index a lot more data per account may have this data. Unless I am missing something obvious in the JSON RPC spec
ill ask them here => https://twitter.com/owocki/status/1217193346763911168
Nice! I think you may have also already seen it but two services came up in Twitter:
nice; blocknative looks the most promising to me.
i think the best move from here might be to get someone to pull down their python API and have a go at this :)
Describe the bug
When a transaction for a gitcoin grant is dropped and replaced by a new one the contribution is still shown as pending in the UI.
To Reproduce
Try to contribute to a grant with a very low gas price.
The transaction will appear as pending in the UI https://etherscan.io/tx/0x5af35de793075687920707dd0d9dca439657bfd27d4582615fc48b71ca148fb4
Then resend it with higher gas price https://etherscan.io/tx/0x964395e297269d6ab30c7ab7d807668599af7da9875b96cc583142d8846f9fa0
It will succeed but in the UI the transaction will still appear as pending.
Expected behavior
After a transaction has been dropped and successfully replaced I would expect it to no longer be pending in the UI.