HomePhabricator

[explorer] Add test chains address support to the explorer

Description

[explorer] Add test chains address support to the explorer

Summary:
The explorer is currently hard-coded to use the ecash: prefix. This diffs adds on optional chain parameter to the config.toml that can be set to "testnet" to use the ectest prefix instead.

Depends on D14450 for the search bar to work.

Test Plan:

cd explorer-server && cargo test

Add chain: "testnet" to the config.toml file, then cargo run. Check the addresses are now displayed using the ectest: prefix. Navigate through the transaction and address pages, and use the search bar to check it works as expected.
Repeat with chain: "regtest".

Try again with a wrong chain name, check that cargo run aborts with a meaningful error message.

Reviewers: #bitcoin_abc, tobias_ruck

Reviewed By: #bitcoin_abc, tobias_ruck

Differential Revision: https://reviews.bitcoinabc.org/D14451

Details

Provenance
FabienAuthored on Sep 5 2023, 19:09
FabienPushed on Sep 7 2023, 14:07
Reviewer
Restricted Project
Differential Revision
D14451: [explorer] Add test chains address support to the explorer
Parents
rABC0dba8ff6c835: [avalanche] Reject blocks that don't have the staking rewards output
Branches
Unknown
Tags
Unknown