Skip to content

Commit

Permalink
Add delegate value to recursive inscription endpoint (#3751)
Browse files Browse the repository at this point in the history
  • Loading branch information
phorkish authored May 24, 2024
1 parent b0a26e2 commit 7ba899a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/inscriptions/recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ percentile in sats/vB.
"charms": [],
"content_type": "image/png",
"content_length": 144037,
"delegate": null,
"fee": 36352,
"height": 209,
"id": "3bd72a7ef68776c9429961e43043ff65efa7fb2d8bb407386a9e3b19f149bc36i0",
Expand Down
1 change: 1 addition & 0 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub struct InscriptionRecursive {
pub charms: Vec<Charm>,
pub content_type: Option<String>,
pub content_length: Option<usize>,
pub delegate: Option<InscriptionId>,
pub fee: u64,
pub height: u32,
pub id: InscriptionId,
Expand Down
8 changes: 8 additions & 0 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ impl Server {
charms: Charm::charms(entry.charms),
content_type: inscription.content_type().map(|s| s.to_string()),
content_length: inscription.content_length(),
delegate: inscription.delegate(),
fee: entry.fee,
height: entry.height,
id: inscription_id,
Expand Down Expand Up @@ -6376,6 +6377,13 @@ next
server.assert_response(format!("/content/{id}"), StatusCode::OK, "foo");

server.assert_response(format!("/preview/{id}"), StatusCode::OK, "foo");

assert_eq!(
server
.get_json::<api::InscriptionRecursive>(format!("/r/inscription/{id}"))
.delegate,
Some(delegate)
);
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ fn recursive_inscription_endpoint() {
charms: vec![Charm::Coin, Charm::Uncommon],
content_type: Some("text/plain;charset=utf-8".to_string()),
content_length: Some(3),
delegate: None,
fee: 138,
height: 2,
id: inscription.id,
Expand Down

0 comments on commit 7ba899a

Please sign in to comment.