MCPcopy Create free account
hub / github.com/dfinity/orbit / get_artifact

Method get_artifact

core/control-panel/impl/src/controllers/artifact.rs:34–44  ·  view source on GitHub ↗

Returns the artifact with the given id if it exists.

(&self, input: GetArtifactInput)

Source from the content-addressed store, hash-verified

32
33 /// Returns the artifact with the given id if it exists.
34 pub async fn get_artifact(&self, input: GetArtifactInput) -> ApiResult<GetArtifactResponse> {
35 let artifact = self.artifact_service.find_by_id(
36 HelperMapper::to_uuid(input.artifact_id)
37 .expect("Invalid artifact id")
38 .as_bytes(),
39 )?;
40
41 Ok(GetArtifactResponse {
42 artifact: artifact.into(),
43 })
44 }
45}
46
47#[cfg(test)]

Callers 4

get_artifactFunction · 0.80
test_get_artifactFunction · 0.80
getArtifactMethod · 0.80

Calls 1

find_by_idMethod · 0.80

Tested by 2

test_get_artifactFunction · 0.64