Skip to content

Commit 3f10607

Browse files
authored
fix: store inscription content as is (#391)
1 parent 2dba824 commit 3f10607

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/ordhook-core/src/db/models/db_inscription.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ impl DbInscription {
4343
tx_index: usize,
4444
timestamp: u32,
4545
) -> Self {
46-
// Remove null bytes from `content` and `content_type`
47-
let mut content = hex::decode(&reveal.content_bytes[2..]).unwrap();
48-
content.retain(|&x| x != 0);
46+
// Remove null bytes from `content_type`
4947
let mut content_type_bytes = reveal.content_type.clone().into_bytes();
5048
content_type_bytes.retain(|&x| x != 0);
5149
let content_type = String::from_utf8(content_type_bytes).unwrap();
@@ -62,7 +60,7 @@ impl DbInscription {
6260
mime_type: content_type.split(';').nth(0).unwrap().to_string(),
6361
content_type,
6462
content_length: PgBigIntU32(reveal.content_length as u32),
65-
content,
63+
content: hex::decode(&reveal.content_bytes[2..]).unwrap(),
6664
fee: PgNumericU64(reveal.inscription_fee),
6765
curse_type: reveal.curse_type.as_ref().map(|c| match c {
6866
OrdinalInscriptionCurseType::DuplicateField => "duplicate_field".to_string(),

0 commit comments

Comments
 (0)