Page MenuHomePhabricator

[ecash-herald] Tighter token send descriptions
ClosedPublic

Authored by bytesofman on Aug 30 2023, 12:37.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCa1699180470e: [ecash-herald] Tighter token send descriptions
Summary

The address info on token send txs is not really useful and can be found by investigating the txid. Remove this info so token send msgs simply provide amount and token ticker.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
better-token-msgs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24926
Build 49440: Build Diffecash-herald-tests
Build 49439: arc lint + arc unit

Event Timeline

PiRK requested changes to this revision.Aug 31 2023, 06:15
PiRK added a subscriber: PiRK.
PiRK added inline comments.
apps/ecash-herald/src/parse.js
1390–1405 ↗(On Diff #42013)

This else block is now exactly the same code as the previous block, except for a local variable name and the input data (tokenReceivingOutputs vs tokenChangeOutputs)

It could be refactored to deduplicate the common code out out the branching, and just keep the branching to assign the input data

let tokenOutputs = tokenReceivingOutputs;
// Parse token self-send txs
if (tokenReceivingOutputs.size === 0) {
    tokenOutputs = tokenChangeOutputs;
}
This revision now requires changes to proceed.Aug 31 2023, 06:15

good catch, much better approach

This revision is now accepted and ready to land.Sep 1 2023, 05:26