Page MenuHomePhabricator

[explorer] Render cashaddr for all inputs and outputs on transaction page
ClosedPublic

Authored by bytesofman on Aug 8 2024, 23:48.

Details

Summary

The block explorer has logic which changes the address format of the outputScript depending on whether or not the input or output sent or received tokens in the given tx.

While it is arguably nice to see that some outputs are token outputs, imo this is already shown enough by showing the token icon and the amount. Forcing the address to render as an etoken: address is confusing.

Address conversion is still possible with the explorer on the address page.

Test Plan

cargo run, no errors, check a token tx, note all inputs and outputs have ecash: prefixed addresses on the tx page

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer-no-auto-etokenaddr
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32213
Build 63916: Build Diffbuild-explorer
Build 63915: arc lint + arc unit

Event Timeline

remove copy paste change from separate diff

bytesofman published this revision for review.Aug 8 2024, 23:53
Fabien requested changes to this revision.Aug 10 2024, 08:40

I don't think this is a good change. It seems more useful and more the expected behavior for a token transaction to show the token address, and the simplification is not a big gain in this case. I get the point that you can select your address format in the address page but I don't think it compensates for the annoyance.

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

update logic lost in rebase

Tail of the build log:

warning: ecash-secp256k1-sys@0.10.0:    41 | #define EXPECT(x,c) __builtin_expect((x),(c))
warning: ecash-secp256k1-sys@0.10.0:       |                                       ^
warning: ecash-secp256k1-sys@0.10.0: ../../../src/secp256k1/src/modules/schnorrsig/main_impl.h:222:5: note: in expansion of macro 'ARG_CHECK'
warning: ecash-secp256k1-sys@0.10.0:   222 |     ARG_CHECK(pubkey != NULL);
warning: ecash-secp256k1-sys@0.10.0:       |     ^~~~~~~~~
   Compiling karyon_jsonrpc_macro v0.2.1 (https://github.com/karyontech/karyon.git?rev=c019ca3273a89afb34e2aa429386851f45cfa5d1#c019ca32)
   Compiling axum-core v0.2.9
   Compiling toml_datetime v0.6.8
   Compiling serde_spanned v0.6.8
   Compiling serde_path_to_error v0.1.16
   Compiling pyo3 v0.23.3
   Compiling base64 v0.22.1
   Compiling matchit v0.7.3
   Compiling matchit v0.5.0
   Compiling winnow v0.6.20
   Compiling qrcodegen v1.8.0
   Compiling bitcoin_hashes v0.9.7
   Compiling wasm-bindgen v0.2.92
   Compiling arrayvec v0.7.6
   Compiling bech32 v0.7.3
   Compiling num-format v0.4.4
   Compiling qrcode-generator v4.1.9
   Compiling wasm-bindgen-macro v0.2.92
   Compiling axum v0.7.9
   Compiling askama v0.10.5
   Compiling maud v0.22.3
   Compiling tower-http v0.5.2
   Compiling chronik_lib v0.1.0 (/work/chronik/chronik-lib)
   Compiling chrono-humanize v0.1.2
   Compiling base64 v0.13.1
   Compiling indoc v2.0.5
   Compiling unindent v0.2.3
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling toml_edit v0.22.22
   Compiling pyo3-macros v0.23.3
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.27
   Compiling axum v0.5.17
   Compiling toml v0.8.19
   Compiling bitcoin v0.25.2
   Compiling bitcoinsuite-chronik-client v0.1.0 (/work/modules/bitcoinsuite-chronik-client)
   Compiling chronik-plugin-impl v0.1.0 (/work/chronik/chronik-plugin-impl)
   Compiling explorer-server v0.1.0 (/work/web/explorer/explorer-server)
error[E0425]: cannot find function `destination_from_script` in module `filters`
  --> web/explorer/explorer-server/src/templating.rs:33:10
   |
33 | #[derive(Template)]
   |          ^^^^^^^^ not found in `filters`
   |
   = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this function
   |
1  + use crate::blockchain::destination_from_script;
   |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `explorer-server` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Build build-explorer failed with exit code 101
Fabien requested changes to this revision.Sat, Jan 25, 21:55

Clearing my queue

This revision now requires changes to proceed.Sat, Jan 25, 21:55
This revision is now accepted and ready to land.Mon, Jan 27, 09:35