From 5ac126d02f784063b6cb0284504e23e8ce826d58 Mon Sep 17 00:00:00 2001 From: raph Date: Tue, 26 Nov 2024 00:00:05 +0100 Subject: [PATCH] Hide teleburn address (#4093) * Do not display teleburn address * Amend * Amend * Amend * Amend --- src/templates/inscription.rs | 48 +++++++++++++++---- templates/inscription.html | 12 ++++- tests/server.rs | 91 +++++++++++++++++++----------------- 3 files changed, 97 insertions(+), 54 deletions(-) diff --git a/src/templates/inscription.rs b/src/templates/inscription.rs index 2cfe83d836..d9e5ce2ba0 100644 --- a/src/templates/inscription.rs +++ b/src/templates/inscription.rs @@ -91,8 +91,16 @@ mod tests {
1{64}:1
offset
0
-
ethereum teleburn address
-
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
details
+
+
+ ... +
+
ethereum teleburn address
+
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
+
+
" .unindent() @@ -274,8 +282,16 @@ mod tests {
1{64}:1
offset
0
-
ethereum teleburn address
-
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
details
+
+
+ ... +
+
ethereum teleburn address
+
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
+
+
" .unindent() @@ -337,8 +353,16 @@ mod tests {
1{64}:1
offset
0
-
ethereum teleburn address
-
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
details
+
+
+ ... +
+
ethereum teleburn address
+
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
+
+
" .unindent() @@ -399,8 +423,16 @@ mod tests {
1{64}:1
offset
0
-
ethereum teleburn address
-
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
details
+
+
+ ... +
+
ethereum teleburn address
+
0xa1DfBd1C519B9323FD7Fd8e498Ac16c2E502F059
+
+
+
" .unindent() diff --git a/templates/inscription.html b/templates/inscription.html index fa50f66e4b..d201f9aa36 100644 --- a/templates/inscription.html +++ b/templates/inscription.html @@ -121,6 +121,14 @@

Inscription {{ self.number }}

{{ self.satpoint.outpoint }}
offset
{{ self.satpoint.offset }}
-
ethereum teleburn address
-
{{ teleburn::Ethereum::from(self.id) }}
+
details
+
+
+ ... +
+
ethereum teleburn address
+
{{ teleburn::Ethereum::from(self.id) }}
+
+
+
diff --git a/tests/server.rs b/tests/server.rs index 249b12b90b..e175a6ae02 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -233,52 +233,55 @@ fn inscription_page() { let (inscription, reveal) = inscribe(&core, &ord); - let ethereum_teleburn_address = CommandBuilder::new(format!("teleburn {inscription}")) - .core(&core) - .run_and_deserialize_output::() - .ethereum; + let response = ord.json_request(format!( + "/output/{}", + OutPoint { + txid: reveal, + vout: 0 + } + )); - TestServer::spawn_with_args(&core, &[]).assert_response_regex( + assert_eq!(response.status(), StatusCode::OK); + + let output: api::Output = serde_json::from_str(&response.text().unwrap()).unwrap(); + + TestServer::spawn_with_args(&core, &[]).assert_html( format!("/inscription/{inscription}"), - format!( - ".*.* -.*.* -.*.* -

Inscription 0

-.*.* -
-
id
-
{inscription}
-
address
-
bc1.*
-
value
-
10000
-
preview
-
link
-
content
-
link
-
content length
-
3 bytes
-
content type
-
text/plain;charset=utf-8
-
timestamp
-
-
height
-
2
-
fee
-
138
-
reveal transaction
-
{reveal}
-
location
-
{reveal}:0:0
-
output
-
{reveal}:0
-
offset
-
0
-
ethereum teleburn address
-
{ethereum_teleburn_address}
-
.*", - ), + Chain::Mainnet, + InscriptionHtml { + chain: Chain::Mainnet, + charms: 0, + child_count: 0, + children: Vec::new(), + fee: 138, + height: 2, + inscription: Inscription { + content_type: Some("text/plain;charset=utf-8".as_bytes().into()), + body: Some("foo".as_bytes().into()), + ..default() + }, + id: inscription, + number: 0, + next: None, + output: Some(TxOut { + value: Amount::from_sat(10000), + script_pubkey: output.script_pubkey, + }), + parents: Vec::new(), + previous: None, + rune: None, + sat: None, + satpoint: SatPoint { + outpoint: OutPoint { + txid: reveal, + vout: 0, + }, + offset: 0, + }, + timestamp: "1970-01-01 00:00:02+00:00" + .parse::>() + .unwrap(), + }, ); }