Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions packages/rs-sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,27 +240,6 @@ impl Sdk {
.expect("mock should be created")
}

/// Retrieve object `O` from proof contained in `request` (of type `R`) and `response`.
///
/// This method is used to retrieve objects from proofs returned by Dash Platform.
///
/// ## Generic Parameters
///
/// - `R`: Type of the request that was used to fetch the proof.
/// - `O`: Type of the object to be retrieved from the proof.
pub(crate) async fn parse_proof<R, O: FromProof<R> + MockResponse>(
&self,
request: O::Request,
response: O::Response,
) -> Result<Option<O>, Error>
where
O::Request: Mockable + TransportRequest,
{
self.parse_proof_with_metadata(request, response)
.await
.map(|result| result.0)
}

/// Return freshness criteria (height tolerance and time tolerance) for given request method.
///
/// Note that if self.metadata_height_tolerance or self.metadata_time_tolerance_ms is None,
Expand All @@ -279,29 +258,6 @@ impl Sdk {
}
}

/// Retrieve object `O` from proof contained in `request` (of type `R`) and `response`.
///
/// This method is used to retrieve objects from proofs returned by Dash Platform.
///
/// ## Generic Parameters
///
/// - `R`: Type of the request that was used to fetch the proof.
/// - `O`: Type of the object to be retrieved from the proof.
pub(crate) async fn parse_proof_with_metadata<R, O: FromProof<R> + MockResponse>(
&self,
request: O::Request,
response: O::Response,
) -> Result<(Option<O>, ResponseMetadata), Error>
where
O::Request: Mockable + TransportRequest,
{
let (object, metadata, _proof) = self
.parse_proof_with_metadata_and_proof(request, response)
.await?;

Ok((object, metadata))
}

/// Verify response metadata against the current state of the SDK.
pub fn verify_response_metadata(
&self,
Expand Down
Loading