feat: display links to sibling blocks, if any

closes #2
This commit is contained in:
danda 2024-12-18 13:43:14 +08:00
parent ebcfdb947c
commit f293d4e6bb
3 changed files with 36 additions and 19 deletions

3
Cargo.lock generated
View File

@ -1948,7 +1948,7 @@ dependencies = [
[[package]] [[package]]
name = "neptune-cash" name = "neptune-cash"
version = "0.0.10" version = "0.0.10"
source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=dbc660634c27cdd2c65ed760dadc123c244d6cd1#dbc660634c27cdd2c65ed760dadc123c244d6cd1" source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=74853d165d1def59ebb799d4679b522acd28116a#74853d165d1def59ebb799d4679b522acd28116a"
dependencies = [ dependencies = [
"aead", "aead",
"aes-gcm", "aes-gcm",
@ -2021,6 +2021,7 @@ dependencies = [
"html-escaper", "html-escaper",
"lettre", "lettre",
"neptune-cash", "neptune-cash",
"rand",
"readonly", "readonly",
"serde", "serde",
"serde_json", "serde_json",

View File

@ -13,8 +13,8 @@ tokio = { version = "1.37.0", features = ["full", "tracing"] }
tracing = "0.1.40" tracing = "0.1.40"
tracing-subscriber = "0.3.18" tracing-subscriber = "0.3.18"
# dbc660634c27cdd2c65ed760dadc123c244d6cd1 = betanet # 74853d165d1def59ebb799d4679b522acd28116a = betanet
neptune-cash = {git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "dbc660634c27cdd2c65ed760dadc123c244d6cd1"} neptune-cash = {git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "74853d165d1def59ebb799d4679b522acd28116a"}
tarpc = { version = "^0.34", features = [ tarpc = { version = "^0.34", features = [
"tokio1", "tokio1",
"serde-transport", "serde-transport",

View File

@ -27,22 +27,6 @@
<td>Digest</td> <td>Digest</td>
<td class="mono">{{self.block_info.digest.to_hex()}}</td> <td class="mono">{{self.block_info.digest.to_hex()}}</td>
</tr> </tr>
<tr>
<td>Canonical
<span class="tooltip">🛈
<span class="tooltiptext">
The canonical blockchain is the chain with the most accumulated proof-of-work and is considered the official record of transaction history.
</span>
</span>
</td>
<td>
%% if self.block_info.is_canonical {
This block is a link in the canonical blockchain.
%% } else {
This block is not in the canonical blockchain.
%% }
</td>
</tr>
<tr> <tr>
<td>Created</td> <td>Created</td>
<td>{{self.block_info.timestamp.standard_format()}}</td> <td>{{self.block_info.timestamp.standard_format()}}</td>
@ -67,6 +51,38 @@ This block is not in the canonical blockchain.
<td>Fee</td> <td>Fee</td>
<td>{{self.block_info.fee}}</td> <td>{{self.block_info.fee}}</td>
</tr> </tr>
<tr>
<td>Canonical
<span class="tooltip">🛈
<span class="tooltiptext">
The canonical blockchain is the chain with the most accumulated proof-of-work and is considered the
official record of transaction history.
</span>
</span>
</td>
<td>
%% if self.block_info.is_canonical {
This block is in the canonical blockchain.
%% } else {
This block is not in the canonical blockchain.
%% }
</td>
</tr>
<tr>
<td>Sibling Blocks
<span class="tooltip">🛈
<span class="tooltiptext">
Blocks that exist at the same height as this block. Only one sibling can be in the canonical blockchain.
</span>
</span>
</td>
<td class="mono">
%% for sibling_digest in self.block_info.sibling_blocks.iter().map(|d| d.to_hex()) {
<a href='/block/digest/{{sibling_digest}}'>{{sibling_digest}}</a><br/>
%% }
</td>
</tr>
</table> </table>
</article> </article>