Skip to content

Commit

Permalink
Fix formating.
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Mar 15, 2024
1 parent f5d4f51 commit e08044a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,9 @@ impl Server {
} else {
info.inscription.content_type().map(str::to_string)
}
} else { info.inscription.content_type().map(str::to_string) };
} else {
info.inscription.content_type().map(str::to_string)
};

Ok(if accept_json {
Json(api::Inscription {
Expand Down
17 changes: 10 additions & 7 deletions tests/wallet/inscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2189,22 +2189,25 @@ fn inscription_with_delegate_returns_effective_content_type() {
let inscribe = CommandBuilder::new(format!(
"wallet inscribe --fee-rate 1.0 --delegate {delegate} --file meow.wav"
))
.write("meow.wav", [0; 2048])
.bitcoin_rpc_server(&bitcoin_rpc_server)
.ord_rpc_server(&ord_rpc_server)
.run_and_deserialize_output::<Inscribe>();
.write("meow.wav", [0; 2048])
.bitcoin_rpc_server(&bitcoin_rpc_server)
.ord_rpc_server(&ord_rpc_server)
.run_and_deserialize_output::<Inscribe>();

bitcoin_rpc_server.mine_blocks(1);

let inscription_id = inscribe.inscriptions[0].id;
let json_response = ord_rpc_server.json_request(format!("/inscription/{}", inscription_id));

let mut inscription_json: api::Inscription =
serde_json::from_str(&json_response.text().unwrap()).unwrap();
let inscription_json: api::Inscription =
serde_json::from_str(&json_response.text().unwrap()).unwrap();
assert_regex_match!(inscription_json.address.unwrap(), r"bc1p.*");

assert_eq!(inscription_json.content_type, Some("audio/wav".to_string()));
assert_eq!(inscription_json.effective_content_type, Some("text/plain;charset=utf-8".to_string()));
assert_eq!(
inscription_json.effective_content_type,
Some("text/plain;charset=utf-8".to_string())
);
}

#[test]
Expand Down

0 comments on commit e08044a

Please sign in to comment.