Skip to content

Commit

Permalink
added suggested error handling & rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoni9n committed Feb 14, 2025
1 parent a242887 commit a14e246
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 0 additions & 4 deletions docs/src/guides/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5129,8 +5129,4 @@ curl -s -H "Accept: application/json" \

See [Recursion](../inscriptions/recursion.md) for an explanation of these.

<<<<<<< HEAD
{{#include ../inscriptions/recursion.md:35:3483}}
=======
{{#include ../inscriptions/recursion.md:35:925}}
>>>>>>> 57a17c76 (Amend)
13 changes: 13 additions & 0 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ pub struct InscriptionRecursive {
pub address: Option<String>,
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct ChildInscriptionRecursive {
pub charms: Vec<Charm>,
pub fee: u64,
pub height: u32,
pub id: InscriptionId,
pub number: i32,
pub output: OutPoint,
pub sat: Option<ordinals::Sat>,
pub satpoint: SatPoint,
pub timestamp: i64,
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct RelativeInscriptionRecursive {
pub charms: Vec<Charm>,
Expand Down
6 changes: 3 additions & 3 deletions src/subcommand/server/r.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub(super) async fn children_inscriptions_paginated(
.flatten()
.unwrap();

api::ChildInscriptionRecursive {
api::RelativeInscriptionRecursive {
charms: Charm::charms(entry.charms),
fee: entry.fee,
height: entry.height,
Expand Down Expand Up @@ -451,7 +451,7 @@ pub async fn parent_inscriptions_recursive_paginated(
let parents = ids
.into_iter()
.map(
|inscription_id| -> ServerResult<api::ChildInscriptionRecursive> {
|inscription_id| -> ServerResult<api::RelativeInscriptionRecursive> {
let entry = index
.get_inscription_entry(inscription_id)?
.ok_or_not_found(|| format!("inscription {inscription_id}"))?;
Expand All @@ -460,7 +460,7 @@ pub async fn parent_inscriptions_recursive_paginated(
.get_inscription_satpoint_by_id(inscription_id)?
.ok_or_not_found(|| format!("satpoint for inscription {inscription_id}"))?;

Ok(api::ChildInscriptionRecursive {
Ok(api::RelativeInscriptionRecursive {
charms: Charm::charms(entry.charms),
fee: entry.fee,
height: entry.height,
Expand Down

0 comments on commit a14e246

Please sign in to comment.