Skip to content

Commit

Permalink
fix: return type
Browse files Browse the repository at this point in the history
  • Loading branch information
frdomovic committed Dec 7, 2024
1 parent 3c18039 commit 1ca1b7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions contracts/icp/context-config/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn application_revision(context_id: ICRepr<ContextId>) -> u64 {
}

#[ic_cdk::query]
fn proxy_contract(context_id: ICRepr<ContextId>) -> String {
fn proxy_contract(context_id: ICRepr<ContextId>) -> Principal {
with_state(|configs| {
let context = configs
.contexts
Expand All @@ -42,7 +42,6 @@ fn proxy_contract(context_id: ICRepr<ContextId>) -> String {

context.proxy.clone()
})
.to_string()
}

#[ic_cdk::query]
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -72,7 +72,8 @@ impl Method<Icp> for ProxyContractRequest {
}

fn decode(response: Vec<u8>) -> eyre::Result<Self::Returns> {
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)
}
}

0 comments on commit 1ca1b7d

Please sign in to comment.