Page MenuHomePhabricator

[Chronik] Add `TokenTxEntry::burn_summary` for a nice human-readable burn summary
ClosedPublic

Authored by tobias_ruck on Jan 5 2024, 21:00.

Details

Summary

SLP/ALP txs can have problems for many reasons, so we add burn_summary, which returns a human-readable string of exactly what went wrong.

Test Plan

cargo test -p bitcoinsuite-slp --lib test_burn_summary

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronik-slp-burn_summary
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26191
Build 51954: Build Diffchronik-client-integration-tests · build-chronik
Build 51953: arc lint + arc unit

Event Timeline

Only style nits

chronik/bitcoinsuite-slp/src/burn_summary.rs
16–20

Style suggestion, I leave that up to you

25–33

Style nit: could be a single return statement

31

Style nit: could be a single if

106
This revision is now accepted and ready to land.Jan 8 2024, 10:13
chronik/bitcoinsuite-slp/src/burn_summary.rs
16–20

this looks like Python, not Rust; there's no ternary operator in Rust (not even a Pythonesque one)

25–33

I'll see how this formats

31

I think it's more readable this way; I could also just make it a big predicate

106

Actually this would create an Unexpected burn: ; expected X... message