feat: display coinbase amount, other misc

Closes #5
Addresses #6

changes:
 * field Mining Reward --> Coinbase. (actual reward)
 * add field Expected Coinbase  (expected/calced reward)
     this field only displays if different from actual coinbase.
 * add field Cumulative Proof-of-Work
 * change tooltip 🛈   -->  ⓘ .  for mobile devices. (hopefully)
 * css: make tooltip text bold, so the ⓘ  is stronger.
This commit is contained in:
danda 2024-12-20 21:58:59 +08:00
parent f293d4e6bb
commit dd7e80298d
6 changed files with 36 additions and 13 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=74853d165d1def59ebb799d4679b522acd28116a#74853d165d1def59ebb799d4679b522acd28116a" source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=9602321148095f9991808780b406c1789f9a3a4f#9602321148095f9991808780b406c1789f9a3a4f"
dependencies = [ dependencies = [
"aead", "aead",
"aes-gcm", "aes-gcm",
@ -2021,7 +2021,6 @@ 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"
# 74853d165d1def59ebb799d4679b522acd28116a = betanet # 9602321148095f9991808780b406c1789f9a3a4f = betanet
neptune-cash = {git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "74853d165d1def59ebb799d4679b522acd28116a"} neptune-cash = {git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "9602321148095f9991808780b406c1789f9a3a4f"}
tarpc = { version = "^0.34", features = [ tarpc = { version = "^0.34", features = [
"tokio1", "tokio1",
"serde-transport", "serde-transport",

View File

@ -58,6 +58,7 @@ div.indent {
display: inline-block; display: inline-block;
bottom: 0.1em; bottom: 0.1em;
transition: 0s; transition: 0s;
font-weight: bold;
} }
/* Tooltip text */ /* Tooltip text */
@ -73,6 +74,7 @@ div.indent {
padding: 5px; padding: 5px;
border-radius: 6px; border-radius: 6px;
border: solid 1px rgb(1, 220, 220); border: solid 1px rgb(1, 220, 220);
font-weight: normal;
/* Position the tooltip text - see examples below! */ /* Position the tooltip text - see examples below! */
position: absolute; position: absolute;

View File

@ -44,16 +44,38 @@
<td>{{self.block_info.difficulty}}</td> <td>{{self.block_info.difficulty}}</td>
</tr> </tr>
<tr> <tr>
<td>Mining Reward</td> <td>Cumulative Proof-Of-Work
<td>{{self.block_info.mining_reward}}</td> <span class="tooltip">
<span class="tooltiptext">estimated total # of hashes performed by miners from genesis block to this block.</span>
</span>
</td>
<td>{{self.block_info.cumulative_proof_of_work}}</td>
</tr> </tr>
<tr>
<td>Coinbase
<span class="tooltip">
<span class="tooltiptext">Total block reward amount paid to the miner(s) that found this block.</span>
</span>
</td>
<td>{{self.block_info.coinbase_amount}}</td>
</tr>
%% if self.block_info.coinbase_amount != self.block_info.expected_coinbase_amount() {
<tr>
<td>Expected Coinbase
<span class="tooltip">
<span class="tooltiptext">Expected (maximum) block reward amount paid to the miner(s) that find a block at this block-height.</span>
</span>
</td>
<td>{{self.block_info.expected_coinbase_amount()}}</td>
</tr>
%% }
<tr> <tr>
<td>Fee</td> <td>Fee</td>
<td>{{self.block_info.fee}}</td> <td>{{self.block_info.fee}}</td>
</tr> </tr>
<tr> <tr>
<td>Canonical <td>Canonical
<span class="tooltip">🛈 <span class="tooltip">
<span class="tooltiptext"> <span class="tooltiptext">
The canonical blockchain is the chain with the most accumulated proof-of-work and is considered the The canonical blockchain is the chain with the most accumulated proof-of-work and is considered the
official record of transaction history. official record of transaction history.
@ -62,15 +84,15 @@
</td> </td>
<td> <td>
%% if self.block_info.is_canonical { %% if self.block_info.is_canonical {
This block is in the canonical blockchain. Yes. This block is in the canonical blockchain.
%% } else { %% } else {
This block is not in the canonical blockchain. No. This block is not in the canonical blockchain.
%% } %% }
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Sibling Blocks <td>Sibling Blocks
<span class="tooltip">🛈 <span class="tooltip">
<span class="tooltiptext"> <span class="tooltiptext">
Blocks that exist at the same height as this block. Only one sibling can be in the canonical blockchain. Blocks that exist at the same height as this block. Only one sibling can be in the canonical blockchain.
</span> </span>

View File

@ -22,7 +22,7 @@ The blockchain tip is at height: {{self.tip_height}}
<form action="/rqs" method="get"> <form action="/rqs" method="get">
<input type="hidden" name="block" value="" /> <input type="hidden" name="block" value="" />
<input type="hidden" name="_ig" value="l"/> <input type="hidden" name="_ig" value="l"/>
<span class="tooltip">🛈 <span class="tooltip">
<span class="tooltiptext"> <span class="tooltiptext">
Provide a numeric block height or hexadecimal digest identifier to lookup any block in the Neptune blockchain. Provide a numeric block height or hexadecimal digest identifier to lookup any block in the Neptune blockchain.
</span> </span>
@ -44,7 +44,7 @@ Quick Lookup:
<summary>UTXO Lookup</summary> <summary>UTXO Lookup</summary>
<form action="/rqs" method="get"> <form action="/rqs" method="get">
<input type="hidden" name="_ig" value="l" /> <input type="hidden" name="_ig" value="l" />
<span class="tooltip">🛈 <span class="tooltip">
<span class="tooltiptext"> <span class="tooltiptext">
An Unspent Transaction Output (UTXO) index can be found in the output of <i>neptune-cli wallet-status</i>. Look for the field: <b>aocl_leaf_index</b> An Unspent Transaction Output (UTXO) index can be found in the output of <i>neptune-cli wallet-status</i>. Look for the field: <b>aocl_leaf_index</b>
</span> </span>

View File

@ -12,7 +12,7 @@
<article> <article>
<summary> <summary>
<span class="tooltip">🛈 <span class="tooltip">
<span class="tooltiptext"> <span class="tooltiptext">
UTXO = Unspent Transaction Output. It represents an output of transaction A which can also be an input to transaction B. UTXO = Unspent Transaction Output. It represents an output of transaction A which can also be an input to transaction B.
</span> </span>