Page MenuHomePhabricator

[Cashtab] [chronik utxo handling p11] chronik token burns
ClosedPublic

Authored by bytesofman on Sep 13 2022, 23:49.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC976b15fc2ee3: [Cashtab] [chronik utxo handling p11] chronik token burns
Summary

T2447

Depends on D11978

Support for token burn transactions with chronik utxo format

A number of issues had to be resolved for this to work. Potentially could have stacked into more diffs, however these issues were discovered incrementally, and this diff implements only the changes necessary for token burn txs to work.

Issues resolved

  1. BCH.SLP.TokenType1.generateBurnOpReturn requires token utxo inputs to have a certain format. The new finalizeSlpUtxos function was created to match this format. Tasks were also opened in phab to correct this software package issue.
  2. The burnToken function has the same change issue that was resolved in D11926. Patched.
  3. Formatting issues for finding the correct info in a chronik utxo vs bch-api utxo
Test Plan

Review the code changes and unit tests.
npm start
Do a few token burn transactions + review at block explorer to confirm correct fee, change, inputs and outputs

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested changes to this revision.EditedSep 20 2022, 07:40
emack added a subscriber: emack.

The burn tx in the explorer is all good, however since we're fixing related issues it's worth patching the burn amount in this diff, with another diff (separate to this stack) to work on conditional formatting (so it shows Burnt rather than Sent in Tx History) later on. Looking through the old poc (D11011) the correct burn amount is obtained either via total output token amount minus total input token amount, OR make a call to the SlpBurn interface in Chronik.

This revision now requires changes to proceed.Sep 20 2022, 07:40

The burn tx in the explorer is all good, however since we're fixing related issues it's worth patching the burn amount in this diff, with another diff (separate to this stack) to work on conditional formatting (so it shows Burnt rather than Sent in Tx History) later on. Looking through the old poc (D11011) the correct burn amount is obtained either via total output token amount minus total input token amount, OR make a call to the SlpBurn interface in Chronik.

Handled with T2682

We will need to completely overhaul the tx history parsing after this stack lands in what will likely be another sizable stack. Will reserve this fix for that.

This revision is now accepted and ready to land.Sep 20 2022, 13:28