pacu / zwcd

Zcash Wallet Community Developer tasks
MIT License
2 stars 0 forks source link

Implement Reorg Changes Outbound Tx Index #43

Closed pacu closed 8 months ago

pacu commented 9 months ago

Reorg Changes Outbound Tx Index

An outbound, unconfirmed transaction in a specific block changes height in the event of a reorg

The wallet handles this change, reflects it appropriately in local storage, and funds remain spendable post confirmation.

Pre-conditions:

  1. Setup w/ default dataset
  2. applyStaged(received_Tx_height)
  3. sync up to received_Tx_height
  4. create transaction
  5. stage 10 empty blocks
  6. submit tx at sentTxHeight
    • a. getIncomingTx
    • b. stageTransaction(sentTx, sentTxHeight)
    • c. applyheight(sentTxHeight + 1 )
  7. sync to sentTxHeight + 2
  8. stage sentTx and otherTx at sentTxheight
  9. applyStaged(sentTx + 2)
  10. sync up to received_Tx_height + 2
  11. verify that the sent tx is mined and balance is correct
  12. applyStaged(sentTx + 10)
  13. verify that there's no more pending transaction
pacu commented 8 months ago

https://github.com/zingolabs/zingolib/pull/627

completed but fails due to bugs already reported