From c81768bb14f7efd454edeea1384bead1416f033f Mon Sep 17 00:00:00 2001 From: Chandra Penke Date: Wed, 24 Apr 2024 15:05:48 -0700 Subject: [PATCH] fix: add back missing method (#7) --- crates/dscvr-canister-agent/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/dscvr-canister-agent/src/lib.rs b/crates/dscvr-canister-agent/src/lib.rs index 447ed1a..ce179d0 100644 --- a/crates/dscvr-canister-agent/src/lib.rs +++ b/crates/dscvr-canister-agent/src/lib.rs @@ -94,6 +94,18 @@ impl CanisterAgent { } } + pub async fn new_replica( + caller: Arc, + replica: &str, + canister_id: &str, + ) -> Result { + let agent = Self { + agent: agent_impl::replica_impl::new(caller, replica).await?, + canister_id: Principal::from_text(canister_id)?, + }; + Ok(agent) + } + pub async fn clone_with_identity(&self, identity: Arc) -> Result { Ok(Self { agent: self.agent.clone_with_identity(identity).await?,