Skip to content

Commit

Permalink
Link address on inscription.html (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoni9n authored Jun 6, 2024
1 parent 398180a commit 2347118
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/templates/inscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ mod tests {
<dl>
.*
<dt>address</dt>
<dd class=monospace>bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</dd>
<dd class=monospace><a href=/address/bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4>bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</a></dd>
<dt>value</dt>
<dd>1</dd>
.*
Expand Down
2 changes: 1 addition & 1 deletion templates/inscription.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1>Inscription {{ self.number }}</h1>
%% if let Some(output) = &self.output {
%% if let Ok(address) = self.chain.address_from_script(&output.script_pubkey ) {
<dt>address</dt>
<dd class=monospace>{{ address }}</dd>
<dd class=monospace><a href=/address/{{address}}>{{ address }}</a></dd>
%% }
<dt>value</dt>
<dd>{{ output.value }}</dd>
Expand Down
4 changes: 2 additions & 2 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn inscription_page() {
<dt>id</dt>
<dd class=monospace>{inscription}</dd>
<dt>address</dt>
<dd class=monospace>bc1.*</dd>
<dd class=monospace><a href=/address/bc1.*>bc1.*</a></dd>
<dt>value</dt>
<dd>10000</dd>
<dt>preview</dt>
Expand Down Expand Up @@ -219,7 +219,7 @@ fn inscription_page_after_send() {
ord.assert_response_regex(
format!("/inscription/{inscription}"),
format!(
r".*<h1>Inscription 0</h1>.*<dt>address</dt>\s*<dd class=monospace>bc1qcqgs2pps4u4yedfyl5pysdjjncs8et5utseepv</dd>.*<dt>location</dt>\s*<dd class=monospace>{txid}:0:0</dd>.*",
r".*<h1>Inscription 0</h1>.*<dt>address</dt>\s*<dd class=monospace><a href=/address/bc1qcqgs2pps4u4yedfyl5pysdjjncs8et5utseepv>bc1qcqgs2pps4u4yedfyl5pysdjjncs8et5utseepv</a></dd>.*<dt>location</dt>\s*<dd class=monospace>{txid}:0:0</dd>.*",
),
)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/wallet/batch_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,15 @@ inscriptions:
format!("/inscription/{}", output.inscriptions[0].id),
".*
<dt>address</dt>
<dd class=monospace>bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</dd>.*",
<dd class=monospace><a href=/address/bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4>bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4</a></dd>.*",
);

ord.assert_response_regex(
format!("/inscription/{}", output.inscriptions[1].id),
format!(
".*
<dt>address</dt>
<dd class=monospace>{}</dd>.*",
<dd class=monospace><a href=/address/{0}>{0}</a></dd>.*",
core.state().change_addresses[0],
),
);
Expand All @@ -593,7 +593,7 @@ inscriptions:
format!("/inscription/{}", output.inscriptions[2].id),
".*
<dt>address</dt>
<dd class=monospace>bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k</dd>.*",
<dd class=monospace><a href=/address/bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k>bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k</a></dd>.*",
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/wallet/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn send_inscription_by_sat() {
ord.assert_response_regex(
format!("/inscription/{inscription}"),
format!(
".*<h1>Inscription 0</h1>.*<dt>address</dt>.*<dd class=monospace>{address}</dd>.*<dt>location</dt>.*<dd class=monospace>{send_txid}:0:0</dd>.*",
".*<h1>Inscription 0</h1>.*<dt>address</dt>.*<dd class=monospace><a href=/address/{address}>{address}</a></dd>.*<dt>location</dt>.*<dd class=monospace>{send_txid}:0:0</dd>.*",
),
);
}
Expand Down

0 comments on commit 2347118

Please sign in to comment.