Page MenuHomePhabricator

[explorer] Render token icon next to token inputs, outputs, and in token summary table
ClosedPublic

Authored by bytesofman on Aug 9 2024, 00:47.

Details

Summary

Render the token icon next to token inputs and outputs, including the mint baton. Also render in the token summary table and the eTokens table on the address page.

Note: a blockie is generated server-side for tokens that do not have an icon.

Test Plan

cargo run, check out the genesis tx for some tokens with and without icons.

image.png (598×987 px, 87 KB)

Diff Detail

Repository
rABC Bitcoin ABC
Branch
render-token-icon-on-output
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29913
Build 59361: Build Diff
Build 59360: arc lint + arc unit

Event Timeline

bytesofman published this revision for review.Aug 9 2024, 00:49

image.png (699×978 px, 99 KB)

web/explorer/explorer-server/templates/components/input.html
44

the base URL should be stored as a constant somewhere, I'm not (yet) sure how to best do this in rust

Fabien requested changes to this revision.Aug 10 2024, 08:43

Any chance we can have the icon also on transactions page (or is there any reason why you didn't do it) ?

web/explorer/explorer-server/templates/components/input.html
44

you need to add the url in the model (templating.rs) and fill it with the constant when the model is constructed (in server.rs)

This revision now requires changes to proceed.Aug 10 2024, 08:43

use constant for token server url, add to Address page, ensure size constraint

Any chance we can have the icon also on transactions page (or is there any reason why you didn't do it) ?

added to the Address page

I looked at also adding it to the transactions table -- e.g. on the block page -- this though requires a different implementation. I don't think it would be that complicated, but might need to repeat the url constant as this table is built by a JS file and not the template. I don't think we really need it there though.

bytesofman edited the test plan for this revision. (Show Details)
bytesofman edited the summary of this revision. (Show Details)

Any chance we can have the icon also on transactions page (or is there any reason why you didn't do it) ?

added to the Address page

I looked at also adding it to the transactions table -- e.g. on the block page -- this though requires a different implementation. I don't think it would be that complicated, but might need to repeat the url constant as this table is built by a JS file and not the template. I don't think we really need it there though.

We can always add it later if we want to, the diff looks good and is already an improvement.

This revision is now accepted and ready to land.Aug 12 2024, 08:04