Skip to content

Commit

Permalink
Remove address
Browse files Browse the repository at this point in the history
  • Loading branch information
lifofifoX committed Feb 3, 2024
1 parent b8d8b59 commit cc832bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ impl Server {
}

async fn inscription_recursive(
Extension(server_config): Extension<Arc<ServerConfig>>,
Extension(index): Extension<Arc<Index>>,
Path(inscription_id): Path<InscriptionId>,
) -> ServerResult<Response> {
Expand Down Expand Up @@ -892,19 +891,8 @@ impl Server {
)
};

let address = output
.as_ref()
.and_then(|output| {
server_config
.chain
.address_from_script(&output.script_pubkey)
.ok()
})
.map(|address| address.to_string());

Ok(
Json(InscriptionRecursiveJson {
address,
charms: Charm::ALL
.iter()
.filter(|charm| charm.is_set(entry.charms))
Expand Down
1 change: 0 additions & 1 deletion src/templates/inscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub(crate) struct InscriptionHtml {

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct InscriptionRecursiveJson {
pub address: Option<String>,
pub charms: Vec<String>,
pub content_type: Option<String>,
pub content_length: Option<usize>,
Expand Down
7 changes: 2 additions & 5 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,12 @@ fn recursive_inscription_endpoint() {
"application/json"
);

let mut inscription_metadata_json: InscriptionRecursiveJson =
let inscription_recursive_json: InscriptionRecursiveJson =
serde_json::from_str(&response.text().unwrap()).unwrap();
assert_regex_match!(inscription_metadata_json.address.unwrap(), r"bc1p.*");
inscription_metadata_json.address = None;

pretty_assert_eq!(
inscription_metadata_json,
inscription_recursive_json,
InscriptionRecursiveJson {
address: None,
charms: vec!["coin".into(), "uncommon".into()],
content_type: Some("text/plain;charset=utf-8".to_string()),
content_length: Some(3),
Expand Down

0 comments on commit cc832bb

Please sign in to comment.