From 8812a6ca862ba6e4fd0ddabbf8b9ea6b1a898416 Mon Sep 17 00:00:00 2001 From: cdvallone Date: Thu, 20 Jun 2024 09:37:37 -0400 Subject: [PATCH] comments --- wallet/keys/src/privkeygen.rs | 7 +++---- wallet/keys/src/pubkeygen.rs | 2 +- wallet/keys/src/xprv.rs | 11 ++++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wallet/keys/src/privkeygen.rs b/wallet/keys/src/privkeygen.rs index 34da6e255a..650b1d9dfb 100644 --- a/wallet/keys/src/privkeygen.rs +++ b/wallet/keys/src/privkeygen.rs @@ -43,13 +43,13 @@ impl PrivateKeyGenerator { } } -// CV-NOTE: pyo3 #[new] needs to be in block that has #[pymethods] applied directly +// NOTE: pyo3 #[new] needs to be in block that has #[pymethods] applied directly #[cfg(feature = "py-sdk")] #[pymethods] impl PrivateKeyGenerator { #[new] pub fn new_py(xprv: String, is_multisig: bool, account_index: u64, cosigner_index: Option) -> Result { - // CV-NOTE: accepting xprv as String instead of XPrvT due to challenges with XPrvT type when building python interface + // NOTE: accepting xprv as String instead of XPrvT due to challenges with XPrvT type when building python interface let xprv = XPrv::from_xprv_str(xprv)?; let xprv = xprv.inner(); let receive = xprv.clone().derive_path(&WalletDerivationManager::build_derivate_path( @@ -69,19 +69,18 @@ impl PrivateKeyGenerator { } } +// NOTE: Temporarily changed return type of these from Result to Result to demo shared fns #[cfg_attr(feature = "py-sdk", pymethods)] #[wasm_bindgen] impl PrivateKeyGenerator { #[wasm_bindgen(js_name=receiveKey)] pub fn receive_key(&self, index: u32) -> Result { - // CV-NOTE: Temporarily changed return type from Result to Result to demo shared fn let xkey = self.receive.derive_child(ChildNumber::new(index, false)?)?; Ok(PrivateKey::from(xkey.private_key()).to_hex()) } #[wasm_bindgen(js_name=changeKey)] pub fn change_key(&self, index: u32) -> Result { - // CV-NOTE: Temporarily changed return type from Result to Result to demo shared fn let xkey = self.change.derive_child(ChildNumber::new(index, false)?)?; Ok(PrivateKey::from(xkey.private_key()).to_hex()) } diff --git a/wallet/keys/src/pubkeygen.rs b/wallet/keys/src/pubkeygen.rs index 9980fc4001..573f801fb0 100644 --- a/wallet/keys/src/pubkeygen.rs +++ b/wallet/keys/src/pubkeygen.rs @@ -29,7 +29,7 @@ impl PublicKeyGenerator { Ok(Self { hd_wallet }) } - // CV-NOTE: commented out temporarily as this uses XPrvT + // NOTE: commented out temporarily as this uses XPrvT // #[wasm_bindgen(js_name=fromMasterXPrv)] // pub fn from_master_xprv( // xprv: &XPrvT, diff --git a/wallet/keys/src/xprv.rs b/wallet/keys/src/xprv.rs index 466aab194c..5c599eb91d 100644 --- a/wallet/keys/src/xprv.rs +++ b/wallet/keys/src/xprv.rs @@ -78,10 +78,11 @@ impl<'a> From<&'a XPrv> for &'a ExtendedPrivateKey { } } -/* CV-NOTE: - - Nelow is what I was testing. commented out because... - - It worked when building wasm modules (wasm/build-release, etc) - - Did not work when building python module (x-python/build-dev). #[wasm_bindgen] was not being applied to XPrvT. +/* NOTE: + This cfg_if is commented out because... + - It worked when building WASM modules (wasm/build-release, etc) + - Does not work when building Python module (x-python/build-dev). wasm_bindgen is applied by default to PrivateKeyGenerator + - Changed fn exposed to Python (PrivateKeyGenerator::new) to accept String instead */ // cfg_if::cfg_if! { // if #[cfg(feature = "py-sdk")] { @@ -96,7 +97,7 @@ impl<'a> From<&'a XPrv> for &'a ExtendedPrivateKey { // } // } -// CV-NOTE: see comment on block above +// NOTE: see comment on block above #[wasm_bindgen] extern "C" { #[wasm_bindgen(typescript_type = "XPrv | string")]