Page MenuHomePhabricator

[explorer] Search by block height
AbandonedPublicDraft

Authored by Fabien on Aug 11 2023, 20:58.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Only address and block/tx hash is currently supported in the search bar. This diff adds support for block height if other format did fail.

Test Plan

Preview the explorer and search for a block height.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
explorer_search_blockheight
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24744
Build 49080: Build Diff
Build 49079: arc lint + arc unit

Event Timeline

Tail of the build log:

#11 27.04    Compiling hex-literal v0.3.4
#11 27.06    Compiling ipnet v2.8.0
#11 27.15    Compiling utf8-width v0.1.6
#11 27.28    Compiling http-range-header v0.3.1
#11 27.38    Compiling maud_htmlescape v0.17.1
#11 27.51    Compiling hex v0.4.3
#11 27.59    Compiling bytemuck v1.13.1
#11 27.68    Compiling iana-time-zone v0.1.57
#11 27.75    Compiling color_quant v1.1.0
#11 27.83    Compiling bitcoinsuite-core v0.1.0 (https://github.com/LogosFoundation/bitcoinsuite?rev=dc6d80b#dc6d80b2)
#11 27.83    Compiling chrono v0.4.26
#11 28.12    Compiling image v0.24.7
#11 28.65    Compiling maud_macros v0.22.3
#11 29.90    Compiling tower-http v0.3.5
#11 30.83    Compiling reqwest v0.11.18
#11 31.26    Compiling html-escape v0.2.13
#11 31.36    Compiling bitcoinsuite-error v0.1.0 (https://github.com/LogosFoundation/bitcoinsuite?rev=dc6d80b#dc6d80b2)
#11 31.66    Compiling axum-core v0.2.9
#11 31.80    Compiling askama_derive v0.10.5
#11 32.19    Compiling secp256k1 v0.19.0
#11 32.67    Compiling futures-executor v0.3.28
#11 33.26    Compiling matchit v0.5.0
#11 33.41    Compiling arrayvec v0.7.4
#11 33.48    Compiling sync_wrapper v0.1.2
#11 33.63    Compiling qrcodegen v1.8.0
#11 33.68    Compiling bech32 v0.7.3
#11 33.71    Compiling bitcoin_hashes v0.9.7
#11 34.02    Compiling qrcode-generator v4.1.8
#11 34.14    Compiling num-format v0.4.4
#11 34.26    Compiling maud v0.22.3
#11 34.31    Compiling axum v0.5.17
#11 34.36    Compiling askama v0.10.5
#11 35.07    Compiling futures v0.3.28
#11 35.11    Compiling chrono-humanize v0.1.2
#11 35.29    Compiling base64 v0.13.1
#11 37.63    Compiling bitcoin v0.25.2
#11 40.78    Compiling explorer-server v0.1.0 (/usr/src/explorer/explorer-server)
#11 41.14 error[E0308]: mismatched types
#11 41.14    --> explorer-server/src/server.rs:528:41
#11 41.14     |
#11 41.14 528 |         if self.chronik.block_by_height(&block_height).await.is_ok() {
#11 41.14     |                         --------------- ^^^^^^^^^^^^^ expected `i32`, found `&u32`
#11 41.14     |                         |
#11 41.14     |                         arguments to this method are incorrect
#11 41.14     |
#11 41.14 note: method defined here
#11 41.14    --> /usr/local/cargo/git/checkouts/bitcoinsuite-16749eab091f344a/dc6d80b/bitcoinsuite-chronik-client/src/lib.rs:133:18
#11 41.14     |
#11 41.14 133 |     pub async fn block_by_height(&self, height: i32) -> Result<proto::Block> {
#11 41.14     |                  ^^^^^^^^^^^^^^^
#11 41.14 
#11 41.35 For more information about this error, try `rustc --explain E0308`.
#11 41.36 error: could not compile `explorer-server` (lib) due to previous error
#11 41.36 warning: build failed, waiting for other jobs to finish...
#11 ERROR: executor failed running [/bin/sh -c cargo build --release]: exit code: 101
------
 > [7/7] RUN cargo build --release:
------
executor failed running [/bin/sh -c cargo build --release]: exit code: 101
Build preview-explorer failed with exit code 1