diff --git a/crates/context/config/src/client/env/proxy/types/icp.rs b/crates/context/config/src/client/env/proxy/types/icp.rs index 616f0e80b..4897c9a36 100644 --- a/crates/context/config/src/client/env/proxy/types/icp.rs +++ b/crates/context/config/src/client/env/proxy/types/icp.rs @@ -331,7 +331,7 @@ impl Into for ICProposalWithApprovals { impl From for Option { fn from(value: ICProposalWithApprovals) -> Self { Some(ProposalWithApprovals { - proposal_id: Repr::from(repr::Repr::new( + proposal_id: Repr::from(Repr::new( ProposalId::from_bytes(|bytes| { bytes.copy_from_slice(&value.proposal_id.0); Ok(32) diff --git a/crates/context/config/src/client/protocol/icp.rs b/crates/context/config/src/client/protocol/icp.rs index 54c5fa95e..6ed9389ef 100644 --- a/crates/context/config/src/client/protocol/icp.rs +++ b/crates/context/config/src/client/protocol/icp.rs @@ -30,21 +30,20 @@ impl AssociatedTransport for IcpTransport<'_> { #[serde(try_from = "serde_creds::Credentials")] pub struct Credentials { pub account_id: Principal, - pub public_key: Vec, - pub secret_key: SigningKey, + pub public_key: String, + pub secret_key: String, } mod serde_creds { use candid::Principal; - use ed25519_consensus::SigningKey; use serde::{Deserialize, Serialize}; use thiserror::Error; #[derive(Debug, Deserialize, Serialize)] pub struct Credentials { account_id: Principal, - public_key: Vec, - secret_key: SigningKey, + public_key: String, + secret_key: String, } #[derive(Copy, Clone, Debug, Error)] @@ -67,7 +66,7 @@ mod serde_creds { pub struct NetworkConfig { pub rpc_url: Url, pub account_id: Principal, - pub secret_key: SigningKey, + pub secret_key: String, } #[derive(Debug)] @@ -79,7 +78,7 @@ pub struct IcpConfig<'a> { struct Network { client: Agent, account_id: Principal, - secret_key: SigningKey, + secret_key: String, } #[derive(Clone, Debug)] diff --git a/crates/merod/src/cli/init.rs b/crates/merod/src/cli/init.rs index e65a2172c..78e92dc38 100644 --- a/crates/merod/src/cli/init.rs +++ b/crates/merod/src/cli/init.rs @@ -26,6 +26,7 @@ use calimero_store::Store; use clap::{Parser, ValueEnum}; use ed25519_consensus::SigningKey as IcpSigningKey; use eyre::{bail, Result as EyreResult, WrapErr}; +use hex::encode; use ic_agent::export::Principal; use ic_agent::identity::{BasicIdentity, Identity}; use libp2p::identity::Keypair; @@ -326,7 +327,7 @@ fn generate_local_signer( Ok(ClientLocalSigner { rpc_url, credentials: Credentials::Near(near_protocol::Credentials { - account_id: hex::encode(account_id).parse()?, + account_id: encode(account_id).parse()?, public_key, secret_key, }), @@ -359,8 +360,8 @@ fn generate_local_signer( rpc_url, credentials: Credentials::Icp(icp_protocol::Credentials { account_id, - public_key, - secret_key: signing_key, + public_key: encode(&account_id), + secret_key: encode(&signing_key), }), }) }