From 0e11cf92fc8ee3e8d9e634984697b7389936f280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 13 Mar 2024 10:42:33 +0000 Subject: [PATCH] allow setting whole chain details in a single method --- common/network-defaults/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/network-defaults/src/lib.rs b/common/network-defaults/src/lib.rs index ffd5ff6384..608b6237c6 100644 --- a/common/network-defaults/src/lib.rs +++ b/common/network-defaults/src/lib.rs @@ -185,6 +185,12 @@ impl NymNetworkDetails { self } + #[must_use] + pub fn with_chain_details(mut self, chain_details: ChainDetails) -> Self { + self.chain_details = chain_details; + self + } + #[must_use] pub fn with_bech32_account_prefix>(mut self, prefix: S) -> Self { self.chain_details.bech32_account_prefix = prefix.into(); @@ -227,6 +233,12 @@ impl NymNetworkDetails { self } + #[must_use] + pub fn with_contracts(mut self, contracts: NymContracts) -> Self { + self.contracts = contracts; + self + } + #[must_use] pub fn with_mixnet_contract>(mut self, contract: Option) -> Self { self.contracts.mixnet_contract_address = contract.map(Into::into);