pacu / zwcd

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

Implement ReOrg Changes Inbound Tx Mined Height for Zingo #42

Closed pacu closed 8 months ago

pacu commented 9 months ago

In this test a reorg changes the mined height of an incoming transaction. Wallet should recover from that event and show the correct balance

pre-condition: know balances before tx at received_Tx_height arrives

  1. Setup w/ default dataset
  2. applyStaged(received_Tx_height)
  3. sync up to received_Tx_height
    • a. verify that balance is previous balance + tx amount
  4. get that transaction hex encoded data
  5. stage 5 empty blocks w/heights received_Tx_height to received_Tx_height + 3
  6. stage tx at received_Tx_height + 3
    • a. applyheight(received_Tx_height + 1)
  7. sync to received_Tx_height + 1
  8. assert that reorg happened at received_Tx_height
  9. verify that balance equals initial balance
  10. sync up to received_Tx_height + 3
  11. verify that balance equals initial balance + tx amount
pacu commented 8 months ago

implemented in https://github.com/zingolabs/zingolib/pull/625