bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.8k stars 2.07k forks source link

[BWS] Record confirmations and reverts on EVM transaction proposals #3627

Closed leolambo closed 6 months ago

leolambo commented 10 months ago

We want to be able to know whether or not an Ethereum transaction in confirmed in order to determine if it should be considered pending. We also want to track when a transaction is reverted. This is done by leveraging the GET call to /v#/txproposals/ as a confirmations and status check.

Testing Confirmations:
Create and sign a EVM based transaction proposal as usual. allow a couple blocks to be mined. Trigger a getPendingTx call by opening your associated wallet (old wallet or app) confirmations should be set and reverted should be true on txp.

Testing Revert: Create EVM based transaction proposal that should revert (token not approved for multisend, lower gas value) Or replace an existing tx's txid with the id of a reverted tx and set isPending to true. Sign and allow a couple blocks to be mined. Trigger a getPendingTx call by opening your associated wallet (old wallet or app) confirmations should be set and reverted should be true on txp.