diff --git a/src/subcommand/server/templates/content.rs b/src/subcommand/server/templates/content.rs index 947829e3dd..34196647cc 100644 --- a/src/subcommand/server/templates/content.rs +++ b/src/subcommand/server/templates/content.rs @@ -9,9 +9,9 @@ impl<'a> Display for ContentHtml<'a> { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self.content { Some(Content::Text(text)) => { - write!(f, "

")?; + write!(f, "

")?;
         text.escape(f, false)?;
-        write!(f, "

") + write!(f, "
") } Some(Content::Image) => write!(f, "", self.inscription_id), None => write!(f, "

UNKNOWN

"), diff --git a/src/subcommand/server/templates/home.rs b/src/subcommand/server/templates/home.rs index 101831845c..394e7eb908 100644 --- a/src/subcommand/server/templates/home.rs +++ b/src/subcommand/server/templates/home.rs @@ -64,7 +64,7 @@ mod tests { .to_string(), "

Bitcoin-native NFTs

.*

Latest Inscriptions

-

HELLOWORLD

+
HELLOWORLD

Status

diff --git a/src/subcommand/server/templates/inscription.rs b/src/subcommand/server/templates/inscription.rs index 81eafd95d4..6b612eaeec 100644 --- a/src/subcommand/server/templates/inscription.rs +++ b/src/subcommand/server/templates/inscription.rs @@ -37,7 +37,9 @@ mod tests { .to_string(), "

Inscription ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc

-

HELLOWORLD

+ +
HELLOWORLD
+
content size
10 bytes
@@ -45,8 +47,10 @@ mod tests {
text/plain;charset=utf-8
genesis height
0
+
genesis transaction
+
ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc
location
-
1111111111111111111111111111111111111111111111111111111111111111:1:0
+
1111111111111111111111111111111111111111111111111111111111111111:1:0
" .unindent() @@ -68,7 +72,9 @@ mod tests { .to_string(), "

Inscription ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc

+ +
content size
100 bytes
@@ -76,8 +82,10 @@ mod tests {
image/png
genesis height
0
+
genesis transaction
+
ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc
location
-
1111111111111111111111111111111111111111111111111111111111111111:1:0
+
1111111111111111111111111111111111111111111111111111111111111111:1:0
" .unindent() @@ -99,12 +107,16 @@ mod tests { .to_string(), "

Inscription ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc

+

UNKNOWN

+
genesis height
0
+
genesis transaction
+
ec90757eb3b164aa43fc548faa2fa0c52025494f2c15d5ddf11260b4034ac6dc
location
-
1111111111111111111111111111111111111111111111111111111111111111:1:0
+
1111111111111111111111111111111111111111111111111111111111111111:1:0
" .unindent() diff --git a/src/subcommand/server/templates/sat.rs b/src/subcommand/server/templates/sat.rs index 90e1a24c18..bfd586f434 100644 --- a/src/subcommand/server/templates/sat.rs +++ b/src/subcommand/server/templates/sat.rs @@ -109,7 +109,7 @@ mod tests {
rarity
mythic
time
1970-01-01 00:00:00
inscription
-

HELLOWORLD

+
HELLOWORLD
prev next @@ -151,7 +151,7 @@ mod tests {
rarity
mythic
time
1970-01-01 00:00:00
inscription
-

<script>alert('HELLOWORLD');</script>

+
<script>alert('HELLOWORLD');</script>
prev next diff --git a/static/index.css b/static/index.css index d511e33aa1..2fa55c936c 100644 --- a/static/index.css +++ b/static/index.css @@ -168,7 +168,7 @@ a.mythic { width: 23%; margin: 1%; overflow: hidden; - border-radius: 10%; + border-radius: 2%; } .inscriptions a img { @@ -177,3 +177,18 @@ a.mythic { min-width: 100%; image-rendering: pixelated; } + +.content { + display: flex; + justify-content: center; +} + +.content img { + min-width: 50%; + image-rendering: pixelated; +} + +a.content { + color: inherit; + text-decoration: none; +} diff --git a/templates/inscription.html b/templates/inscription.html index 8235615d73..16da066aa2 100644 --- a/templates/inscription.html +++ b/templates/inscription.html @@ -1,5 +1,7 @@

Inscription {{ self.inscription_id }}

+ {{ self.inscription.content_html(self.inscription_id) }} +
%% if let Some(content_size) = self.inscription.content_size() {
content size
@@ -11,6 +13,8 @@

Inscription {{ self.inscription_id }}

%% }
genesis height
{{ self.genesis_height }}
+
genesis transaction
+
{{ self.inscription_id }}
location
-
{{ self.satpoint }}
+
{{ self.satpoint }}
diff --git a/templates/sat.html b/templates/sat.html index 61d8f448fd..11f1293cb0 100644 --- a/templates/sat.html +++ b/templates/sat.html @@ -13,7 +13,7 @@

Sat {{ self.sat.n() }}

time
{{ self.blocktime }}
%% if let Some((inscription_id, inscription)) = &self.inscription {
inscription
-
{{ inscription.content_html(*inscription_id) }}
+
{{ inscription.content_html(*inscription_id) }}
%% } %% if self.sat.n() > 0 { diff --git a/templates/transaction.html b/templates/transaction.html index 80fa59d61b..032abc1369 100644 --- a/templates/transaction.html +++ b/templates/transaction.html @@ -1,7 +1,7 @@

Transaction {{self.txid}}

%% if let Some(inscription) = &self.inscription {

Inscription

- + {{ inscription.content_html(self.txid) }} %% } diff --git a/tests/server.rs b/tests/server.rs index 25ea3b932e..c907fce300 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -56,7 +56,9 @@ fn inscription_page() { &format!( ".*.*

Inscription {reveal_tx}

-

HELLOWORLD

+ +
HELLOWORLD
+
content size
10 bytes
@@ -64,8 +66,10 @@ fn inscription_page() {
text/plain;charset=utf-8
genesis height
2
+
genesis transaction
+
{reveal_tx}
location
-
{reveal_tx}:0:0
+
{reveal_tx}:0:0
.*", ), ); @@ -90,13 +94,7 @@ fn inscription_appears_on_reveal_transaction_page() { TestServer::spawn_with_args(&rpc_server, &[]).assert_response_regex( &format!("/tx/{}", reveal_tx), - &format!( - ".*

Transaction .*

.* -

Inscription

- -

HELLOWORLD

-
.*", - ), + ".*

Transaction .*

.*HELLOWORLD.*", ); } @@ -121,17 +119,8 @@ fn inscription_page_after_send() { ord_server.assert_response_regex( &format!("/inscription/{reveal_txid}"), &format!( - ".*

Inscription {reveal_txid}

-

HELLOWORLD

-
-
content size
-
10 bytes
-
content type
-
text/plain;charset=utf-8
-
genesis height
-
2
-
location
-
{reveal_txid}:0:0
+ ".*

Inscription {reveal_txid}

.*HELLOWORLD.*
.*
location
+
{reveal_txid}:0:0
.*", ), ); @@ -150,17 +139,11 @@ fn inscription_page_after_send() { ord_server.assert_response_regex( &format!("/inscription/{reveal_txid}"), &format!( - ".*

Inscription {reveal_txid}

-

HELLOWORLD

+ ".*

Inscription {reveal_txid}

.*HELLOWORLD.*
-
content size
-
10 bytes
-
content type
-
text/plain;charset=utf-8
-
genesis height
-
2
+ .*
location
-
{}:0:0
+
{}:0:0
.*", txid.trim(), ), diff --git a/tests/wallet.rs b/tests/wallet.rs index 543aee1d24..4e2faa9a11 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -89,17 +89,14 @@ fn send_works_on_signet() { ord_server.assert_response_regex( &format!("/inscription/{reveal_txid}"), &format!( - ".*

Inscription {reveal_txid}

-.* -
+ ".*

Inscription {reveal_txid}

.*
.*
content size
520 bytes
content type
image/png
-
genesis height
-
2
+ .*
location
-
{send_txid}:0:0
+
{send_txid}:0:0
.*", ), @@ -153,19 +150,7 @@ fn send_inscribed_sat() { ord_server.assert_response_regex( &format!("/inscription/{reveal_txid}"), &format!( - ".*

Inscription {reveal_txid}

-.* -
-
content size
-
520 bytes
-
content type
-
image/png
-
genesis height
-
2
-
location
-
{send_txid}:0:0
-
-.*", + ".*

Inscription {reveal_txid}

.*
location
.*
{send_txid}:0:0
.*", ), ); } @@ -263,7 +248,7 @@ fn inscribe() { TestServer::spawn_with_args(&rpc_server, &["--index-sats"]).assert_response_regex( "/sat/5000000000", - ".*
inscription
\n

HELLOWORLD

.*", + ".*
inscription
\n
.*
HELLOWORLD
.*
.*", ); TestServer::spawn_with_args(&rpc_server, &[]).assert_response_regex( @@ -306,7 +291,7 @@ fn inscribe_png() { let rpc_server = test_bitcoincore_rpc::spawn_with(Network::Regtest, "ord"); let txid = rpc_server.mine_blocks(1)[0].txdata[0].txid(); - CommandBuilder::new(format!( + let stdout = CommandBuilder::new(format!( "--chain regtest --index-sats wallet inscribe --satpoint {txid}:0:0 --file degenerate.png" )) .write("degenerate.png", [1; 520]) @@ -314,13 +299,17 @@ fn inscribe_png() { .stdout_regex("commit\t[[:xdigit:]]{64}\nreveal\t[[:xdigit:]]{64}\n") .run(); + let txid = reveal_txid_from_inscribe_stdout(&stdout); + rpc_server.mine_blocks(1); let ord_server = TestServer::spawn_with_args(&rpc_server, &["--index-sats"]); ord_server.assert_response_regex( "/sat/5000000000", - ".*
inscription
\n
inscription\n
inscription\n

HELLOWORLD

.*", - ); + TestServer::spawn_with_args(&rpc_server, &["--index-sats"]) + .assert_response_regex("/sat/5000000000", ".*HELLOWORLD.*"); TestServer::spawn_with_args(&rpc_server, &[]).assert_response_regex( &format!("/inscription/{}", reveal_txid_from_inscribe_stdout(&stdout)), @@ -687,7 +674,8 @@ fn inscribe_gif() { .rpc_server(&rpc_server) .stdout_regex("commit\t[[:xdigit:]]{64}\nreveal\t[[:xdigit:]]{64}\n") .run(); - let inscription_id = reveal_txid_from_inscribe_stdout(&stdout); + + let txid = reveal_txid_from_inscribe_stdout(&stdout); rpc_server.mine_blocks(1); @@ -695,6 +683,8 @@ fn inscribe_gif() { ord_server.assert_response_regex( "/sat/5000000000", - &format!(".*
inscription
\n
inscription\n