From 1ca1b7db841ef3ba3e3e4190c6573816e10a73ed Mon Sep 17 00:00:00 2001 From: Fran Domovic Date: Sat, 7 Dec 2024 02:36:05 +0100 Subject: [PATCH] fix: return type --- contracts/icp/context-config/src/query.rs | 3 +-- .../config/src/client/env/config/query/proxy_contract.rs | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/icp/context-config/src/query.rs b/contracts/icp/context-config/src/query.rs index 4ad1532e4..0c5f534a9 100644 --- a/contracts/icp/context-config/src/query.rs +++ b/contracts/icp/context-config/src/query.rs @@ -33,7 +33,7 @@ fn application_revision(context_id: ICRepr) -> u64 { } #[ic_cdk::query] -fn proxy_contract(context_id: ICRepr) -> String { +fn proxy_contract(context_id: ICRepr) -> Principal { with_state(|configs| { let context = configs .contexts @@ -42,7 +42,6 @@ fn proxy_contract(context_id: ICRepr) -> String { context.proxy.clone() }) - .to_string() } #[ic_cdk::query] diff --git a/crates/context/config/src/client/env/config/query/proxy_contract.rs b/crates/context/config/src/client/env/config/query/proxy_contract.rs index 85e7220d2..79c087af7 100644 --- a/crates/context/config/src/client/env/config/query/proxy_contract.rs +++ b/crates/context/config/src/client/env/config/query/proxy_contract.rs @@ -1,4 +1,4 @@ -use candid::{Decode, Encode}; +use candid::{Decode, Encode, Principal}; use serde::Serialize; use starknet::core::codec::Encode as StarknetEncode; use starknet_crypto::Felt; @@ -72,7 +72,8 @@ impl Method for ProxyContractRequest { } fn decode(response: Vec) -> eyre::Result { - let value = Decode!(&response, Self::Returns)?; - Ok(value) + let value: Principal = Decode!(&response, Principal)?; + let value_as_string = value.to_text(); + Ok(value_as_string) } }