Page MenuHomePhabricator

[explorer] Support multi-token transactions
ClosedPublic

Authored by tobias_ruck on Aug 20 2024, 15:27.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC3dfcb1da12d6: [explorer] Support multi-token transactions
Summary

The explorer was built under the assumption that every transaction only has one token ID. However, ALP allows multiple different tokens in one transaction, and even SLP can have arbitrarily many different tokens as inputs.

This diff adds support for transactions with multiple tokens:

  1. By showing a list of token IDs along with the transaction ID (instead of just one token ID)
  2. Shows "Multi eToken Transaction" if there are multiple tokens in the transaction (instead of just showing the first token ticker)
  3. Shows a token_info_table for each involved token (not just the first one)
  4. Shows the correct input / output token ticker and icon (instead of always showing the first token ticker + icon, which is incorrect)

Otherwise, the behavior is unchanged.

Depends on D16662.

Test Plan
  1. cargo run
  2. Ensure txs are rendered correctly, e.g. 99d965ef70ac5c620906b72d7900721aea35295bf613aefe9f7ef91c83039a71, which now shows token inputs correctly

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer-support-multi-token-txs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30044
Build 59622: Build Diff
Build 59621: arc lint + arc unit

Event Timeline

rebase, fix token_input and token_output

The code looks good as far as I can tell, but I'm having trouble running the test plan to check the result.

We figured out my issue for running the explorer, I wasn't running cargo run in the right folder.
The result looks good, each UTXO shows the correct token now.

This revision is now accepted and ready to land.Aug 21 2024, 14:40