diff --git a/Cargo.lock b/Cargo.lock index 8e47dc88f5..a6bf01c2f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -464,6 +464,7 @@ dependencies = [ "did_peer", "did_resolver_registry", "did_resolver_sov", + "display_as_json", "log", "public_key", "serde", diff --git a/aries/agents/rust/aries-vcx-agent/Cargo.toml b/aries/agents/rust/aries-vcx-agent/Cargo.toml index a646419e04..6ce5515b14 100644 --- a/aries/agents/rust/aries-vcx-agent/Cargo.toml +++ b/aries/agents/rust/aries-vcx-agent/Cargo.toml @@ -26,3 +26,4 @@ log = "0.4.17" uuid = "1.2.1" thiserror = "1.0.37" url = { version = "2.3.1", features = ["serde"] } +display_as_json = { path = "../../../../misc/display_as_json" } diff --git a/aries/agents/rust/aries-vcx-agent/src/agent/agent_config.rs b/aries/agents/rust/aries-vcx-agent/src/agent/agent_config.rs index 9d9c73cf01..42e52ff008 100644 --- a/aries/agents/rust/aries-vcx-agent/src/agent/agent_config.rs +++ b/aries/agents/rust/aries-vcx-agent/src/agent/agent_config.rs @@ -1,6 +1,8 @@ use aries_vcx_core::wallet::indy::{IssuerConfig, WalletConfig}; +use display_as_json::Display; +use serde::Serialize; -#[derive(Clone)] +#[derive(Clone, Serialize, Display)] pub struct AgentConfig { pub config_wallet: WalletConfig, pub config_issuer: IssuerConfig, diff --git a/aries/agents/rust/aries-vcx-agent/src/agent/init.rs b/aries/agents/rust/aries-vcx-agent/src/agent/init.rs index 58374fada0..efc5b5a152 100644 --- a/aries/agents/rust/aries-vcx-agent/src/agent/init.rs +++ b/aries/agents/rust/aries-vcx-agent/src/agent/init.rs @@ -19,6 +19,8 @@ use aries_vcx_core::{ use did_peer::resolver::PeerDidResolver; use did_resolver_registry::ResolverRegistry; use did_resolver_sov::resolution::DidSovResolver; +use display_as_json::Display; +use serde::Serialize; use crate::{ agent::{agent_config::AgentConfig, agent_struct::Agent}, @@ -37,17 +39,19 @@ use crate::{ }, }; +#[derive(Serialize, Display)] pub struct WalletInitConfig { pub wallet_name: String, pub wallet_key: String, pub wallet_kdf: String, } +#[derive(Serialize, Display)] pub struct PoolInitConfig { pub genesis_path: String, pub pool_name: String, } - +#[derive(Serialize, Display)] pub struct InitConfig { pub enterprise_seed: String, pub pool_config: PoolInitConfig, diff --git a/aries/messages/src/lib.rs b/aries/messages/src/lib.rs index 53622ad869..89c1eb8e74 100644 --- a/aries/messages/src/lib.rs +++ b/aries/messages/src/lib.rs @@ -13,6 +13,7 @@ pub mod msg_parts; pub mod msg_types; use derive_more::From; +use display_as_json::Display; use misc::utils; use msg_fields::protocols::{ cred_issuance::{v1::CredentialIssuanceV1, v2::CredentialIssuanceV2, CredentialIssuance}, @@ -55,7 +56,7 @@ use crate::{ /// /// It also automatically appends the correct `@type` field when serializing /// a message. -#[derive(Clone, Debug, From, PartialEq)] +#[derive(Clone, Debug, Display, From, PartialEq)] pub enum AriesMessage { Routing(Forward), Connection(Connection),