Page MenuHomePhabricator

[Cashtab] [p4 match wif to address] Refactor burnEtoken()s utxo input collation and signing approach
AbandonedPublic

Authored by emack on Aug 26 2022, 11:38.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

Depends on D11872

As per T2599, this is part of a stacked diff to sign utxos for non-eToken txs by matching wit to address.

This diff refactors the XEC utxo collation approach for the burnToken() function and aligns the signing approach for both XEC and eToken UTXOs.

Test Plan

npm test
burn a portion of an existing token and verify the correct XEC and eToken change and eToken balance update
burn the entirty of an existing token and verify the correct XEC change and nil remainder balance for the eToken

Diff Detail

Event Timeline

emack requested review of this revision.Aug 26 2022, 11:38

Looks good but some issues to address.

  1. Changing the name of the function from burnEToken to burnToken is for the best, but this should be handled in its own diff or its own part of this stack
  2. Function should not accept both wallet and slpBalancesAndUtxos as parameters, as the wallet object should be the only reference for slpBalancesAndUtxos (in its state field)

These changes should be distinct from this diff

web/cashtab/src/hooks/useBCH.js
1158 ↗(On Diff #34740)

Same issue as part 3 -- we should not be accepting both wallet and slpBalancesAndUtxos as parameters. Accept wallet only and extract slpBalancesAndUtxos from there.

This revision now requires changes to proceed.Aug 29 2022, 17:48
  1. Reverted burnToken back to burnEtoken
  2. slpBalancesAndUtxos input param will be deprecated as part 8
  3. burnEtoken rename to burnToken will be part 9
This revision is now accepted and ready to land.Aug 30 2022, 17:01

Due to mixed arcanist version issues, this stack landed in full when p1 landed

Please abandon

This revision now requires changes to proceed.Sep 20 2022, 21:26