From a627cb77eb4b1888e6eb3a8349d378b18a9261cf Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 15 Oct 2024 10:16:00 -0700 Subject: [PATCH 01/13] add PasswordError and bound to python --- src/errors.rs | 34 +++++++++++++++++++++++++++++++++- src/keyfile.rs | 12 ++++++------ src/lib.rs | 1 + 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 0ee77e83..3e95fa3b 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -2,13 +2,14 @@ use pyo3::exceptions::PyException; use pyo3::prelude::*; use std::{error, fmt}; +// KeyFileError #[pyclass(extends=PyException)] #[derive(Debug)] pub struct KeyFileError { pub message: String, } -/// Error thrown when the keyfile is corrupt, non-writable, non-readable or the password used to decrypt is invalid. +/// Error thrown when the keyfile is corrupt, non-writable, non-readable. #[pymethods] impl KeyFileError { #[new] @@ -31,6 +32,7 @@ impl fmt::Display for KeyFileError { impl error::Error for KeyFileError {} +// ConfigurationError #[pyclass(extends=PyException)] #[derive(Debug)] pub struct ConfigurationError { @@ -59,3 +61,33 @@ impl fmt::Display for ConfigurationError { } impl error::Error for ConfigurationError {} + +// PasswordError +#[pyclass(extends=PyException)] +#[derive(Debug)] +pub struct PasswordError { + pub message: String, +} + +/// PasswordError occurs if the password used for decryption is invalid. +#[pymethods] +impl PasswordError { + #[new] + #[pyo3(signature = (message=None))] + pub fn new(message: Option) -> Self { + let msg = message.unwrap_or_default(); + PasswordError { message: msg } + } + + pub fn __str__(&self) -> String { + self.message.clone() + } +} + +impl fmt::Display for PasswordError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "PasswordError: {}", self.message) + } +} + +impl error::Error for PasswordError {} diff --git a/src/keyfile.rs b/src/keyfile.rs index 90a7a27f..38cdc150 100644 --- a/src/keyfile.rs +++ b/src/keyfile.rs @@ -19,7 +19,7 @@ use passwords::analyzer; use passwords::scorer; use serde_json::json; -use crate::errors::KeyFileError; +use crate::errors::{KeyFileError, PasswordError}; use crate::keypair::Keypair; use crate::utils; @@ -414,7 +414,7 @@ pub fn decrypt_keyfile_data( .ok_or(PyErr::new::("Invalid nonce."))?; let ciphertext = &data[secretbox::NONCEBYTES..]; secretbox::open(ciphertext, &nonce, key) - .map_err(|_| PyErr::new::("Wrong password for nacl decryption.")) + .map_err(|_| PyErr::new::("Wrong password for nacl decryption.")) } // decrypt of keyfile_data with legacy way @@ -428,7 +428,7 @@ pub fn decrypt_keyfile_data( let keyfile_data_str = from_utf8(keyfile_data)?; fernet .decrypt(keyfile_data_str) - .map_err(|_| PyErr::new::("Wrong password for nacl decryption.")) + .map_err(|_| PyErr::new::("Wrong password for legacy decryption.")) } let mut password = password; @@ -453,21 +453,21 @@ pub fn decrypt_keyfile_data( if keyfile_data_is_encrypted_nacl(py, keyfile_data)? { let key = derive_key(password.as_bytes()); let decrypted_data = nacl_decrypt(keyfile_data, &key) - .map_err(|_| PyErr::new::("Wrong password for decryption."))?; + .map_err(|_| PyErr::new::("Wrong password for decryption."))?; return Ok(PyBytes::new_bound(py, &decrypted_data).into_py(py)); } // Ansible Vault decryption if keyfile_data_is_encrypted_ansible(py, keyfile_data)? { let decrypted_data = decrypt_vault(keyfile_data, password.as_str()) - .map_err(|_| PyErr::new::("Wrong password for decryption."))?; + .map_err(|_| PyErr::new::("Wrong password for decryption."))?; return Ok(PyBytes::new_bound(py, &decrypted_data).into_py(py)); } // Legacy decryption if keyfile_data_is_encrypted_legacy(py, keyfile_data)? { let decrypted_data = legacy_decrypt(&password, keyfile_data) - .map_err(|_| PyErr::new::("Wrong password for decryption."))?; + .map_err(|_| PyErr::new::("Wrong password for decryption."))?; return Ok(PyBytes::new_bound(py, &decrypted_data).into_py(py)); } diff --git a/src/lib.rs b/src/lib.rs index 98db472d..c54af28c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,7 @@ fn register_errors_module(main_module: &Bound<'_, PyModule>) -> PyResult<()> { let errors_module = PyModule::new_bound(main_module.py(), "errors")?; errors_module.add_class::()?; errors_module.add_class::()?; + errors_module.add_class::()?; main_module.add_submodule(&errors_module) } From 21b5a89d98057a3d7716e8d985b36d5498f07486 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 15 Oct 2024 10:16:07 -0700 Subject: [PATCH 02/13] formatter --- src/wallet.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/wallet.rs b/src/wallet.rs index 69169bb4..36d5470a 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -34,7 +34,11 @@ pub fn display_mnemonic_msg(mnemonic: String, key_type: &str) { } // Function to safely retrieve attribute as Option from passed python object -fn get_attribute_string(py: Python, obj: &Bound, attr_name: &str) -> PyResult> { +fn get_attribute_string( + py: Python, + obj: &Bound, + attr_name: &str, +) -> PyResult> { match obj.getattr(attr_name) { Ok(attr) => { if attr.is_none() { @@ -82,9 +86,8 @@ impl Wallet { hotkey: Option, path: Option, config: Option, - py: Python + py: Python, ) -> PyResult { - // default config's values if config and config.wallet exist let mut conf_name: Option = None; let mut conf_hotkey: Option = None; @@ -128,7 +131,10 @@ impl Wallet { let final_path = if let Some(path) = path { path } else if let Some(conf_path) = conf_path { - conf_path.strip_prefix("~/").unwrap_or(&conf_path).to_string() + conf_path + .strip_prefix("~/") + .unwrap_or(&conf_path) + .to_string() } else { BT_WALLET_PATH.to_string() }; @@ -183,8 +189,8 @@ impl Wallet { env::var("BT_WALLET_NAME").unwrap_or_else(|_| BT_WALLET_NAME.to_string()); let default_hotkey = env::var("BT_WALLET_HOTKEY").unwrap_or_else(|_| BT_WALLET_HOTKEY.to_string()); - let default_path = - env::var("BT_WALLET_PATH").unwrap_or_else(|_| format!("~/{}", BT_WALLET_PATH.to_string())); + let default_path = env::var("BT_WALLET_PATH") + .unwrap_or_else(|_| format!("~/{}", BT_WALLET_PATH.to_string())); let prefix_str = if let Some(value) = prefix { format!("\"{}\"", value) From b61872e3a1bb8c131e6d467968fc8be6da3a88c7 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 15 Oct 2024 10:20:15 -0700 Subject: [PATCH 03/13] add `from bittensor_wallet.errors import PasswordError` --- bittensor_wallet/errors/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bittensor_wallet/errors/__init__.py b/bittensor_wallet/errors/__init__.py index 9bd501f8..2e86768c 100644 --- a/bittensor_wallet/errors/__init__.py +++ b/bittensor_wallet/errors/__init__.py @@ -2,3 +2,4 @@ ConfigurationError = _.ConfigurationError KeyFileError = _.KeyFileError +PasswordError = _.PasswordError From cc1e4970accfc1b04b7949ec9fb1d83442bbad19 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 16 Oct 2024 13:48:36 -0700 Subject: [PATCH 04/13] return encrypted password, remove debug --- pyproject.toml | 2 +- src/keyfile.rs | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 310ab6e9..7957bb65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ dependencies = [ "termcolor", "eth-utils<2.3.0", "password_strength", - "cryptography~=42.0.5", + "cryptography~=43.0.1", "ansible~=6.7", "ansible_vault~=2.1", "munch~=2.5.0", diff --git a/src/keyfile.rs b/src/keyfile.rs index 38cdc150..5f84d810 100644 --- a/src/keyfile.rs +++ b/src/keyfile.rs @@ -498,10 +498,6 @@ fn encrypt_password(key: String, value: String) -> String { let encrypted_char = (c as u8) ^ (key.chars().nth(i % key.len()).unwrap() as u8); encrypted.push(encrypted_char as char); } - println!( - ">>> key: {}, value: {}, encrypted: {}", - key, value, encrypted - ); encrypted } @@ -1048,7 +1044,7 @@ impl Keyfile { /// Saves the key's password to the associated local environment variable. #[pyo3(signature = (password=None))] - fn save_password_to_env(&self, password: Option, py: Python) -> PyResult { + fn save_password_to_env(&self, password: Option, py: Python) -> PyResult { // checking the password let password = match password { Some(pwd) => pwd, @@ -1056,7 +1052,7 @@ impl Keyfile { Ok(pwd) => pwd, Err(e) => { utils::print(format!("Error asking password: {:?}.\n", e)); - return Ok(false); + return Ok("".parse()?); } }, }; @@ -1066,21 +1062,21 @@ impl Keyfile { // encrypt password let encrypted_password = encrypt_password(self.env_var_name()?, password); // store encrypted password - env::set_var(&env_var_name, encrypted_password); + env::set_var(&env_var_name, &encrypted_password); let message = format!( "The password has been saved to environment variable '{}'.\n", env_var_name ); utils::print(message); - Ok(true) + Ok(encrypted_password) } Err(e) => { utils::print(format!( "Error saving environment variable name: {:?}.\n", e )); - Ok(false) + Ok("".parse()?) } } } From f420553622077108fc5aca68fea25912b9df9073 Mon Sep 17 00:00:00 2001 From: Roman <167799377+roman-opentensor@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:22:09 -0800 Subject: [PATCH 05/13] [fix] Use user home directory for wallet path (#59) * Updates local -> environment vars in changelog * closes GH #51 (#56) * [fix] Use userhome for default wallet path ~ (#57) * use userhome for default path ~ * bump ver * expand path on init and use as _path --------- Co-authored-by: ibraheem-opentensor <165814940+ibraheem-opentensor@users.noreply.github.com> Co-authored-by: ibraheem-opentensor Co-authored-by: Cameron Fairchild --- CHANGELOG.MD | 2 +- Cargo.lock | 12 +++++++++++- Cargo.toml | 3 ++- pyproject.toml | 2 +- src/constants.rs | 2 +- src/keyfile.rs | 24 ++++++++++++------------ src/wallet.rs | 40 ++++++++++++++-------------------------- 7 files changed, 42 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f10b30e9..f87d4391 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,7 +4,7 @@ ## What's Changed -* Add the ability to use local variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 +* Add the ability to use environment variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 * fix/roman/fix-config-parsing by @roman-opentensor in https://github.com/opentensor/btwallet/pull/47 **Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.1...v2.0.2 diff --git a/Cargo.lock b/Cargo.lock index e9dcfccf..9ab102c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,7 +352,7 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bittensor_wallet" -version = "2.0.0" +version = "2.0.3" dependencies = [ "ansible-vault", "base64 0.22.1", @@ -371,6 +371,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", + "shellexpand", "sodiumoxide", "sp-core", ] @@ -2230,6 +2231,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "dirs", +] + [[package]] name = "shlex" version = "1.3.0" diff --git a/Cargo.toml b/Cargo.toml index 95e1ab94..e75f16c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bittensor_wallet" -version = "2.0.0" +version = "2.0.3" edition = "2021" [lib] @@ -27,6 +27,7 @@ base64 = "0.22.1" scrypt = "0.11.0" pkcs8 = "0.10.2" schnorrkel = "0.11.4" +shellexpand = "3.1.0" [features] extension-module = ["pyo3/extension-module"] diff --git a/pyproject.toml b/pyproject.toml index 7957bb65..ebc9d2da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bittensor-wallet" -version = "2.0.2" +version = "2.0.3" description = "" readme = "README.md" license = {file = "LICENSE"} diff --git a/src/constants.rs b/src/constants.rs index e54b3b1f..3368116a 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,3 +1,3 @@ pub const BT_WALLET_NAME: &str = "default"; pub const BT_WALLET_HOTKEY: &str = "default"; -pub const BT_WALLET_PATH: &str = ".bittensor/wallets/"; +pub const BT_WALLET_PATH: &str = "~/.bittensor/wallets/"; diff --git a/src/keyfile.rs b/src/keyfile.rs index 5f84d810..c6a7bbe8 100644 --- a/src/keyfile.rs +++ b/src/keyfile.rs @@ -9,7 +9,7 @@ use std::env; use std::fs; use std::io::{Read, Write}; use std::os::unix::fs::PermissionsExt; -use std::path::Path; +use std::path::PathBuf; use std::str::from_utf8; use ansible_vault::{decrypt_vault, encrypt_vault}; @@ -515,6 +515,7 @@ fn decrypt_password(data: String, key: String) -> String { #[pyclass(subclass)] pub struct Keyfile { path: String, + _path: PathBuf, name: String, should_save_to_env: bool, } @@ -524,10 +525,11 @@ impl Keyfile { #[new] #[pyo3(signature = (path, name=None, should_save_to_env=false))] pub fn new(path: String, name: Option, should_save_to_env: bool) -> PyResult { - let path = expand_tilde(&path); + let expanded_path: PathBuf = PathBuf::from(expand_tilde(&path)); let name = name.unwrap_or_else(|| "Keyfile".to_string()); Ok(Keyfile { path, + _path: expanded_path, name, should_save_to_env, }) @@ -649,9 +651,7 @@ impl Keyfile { /// Creates directories for the path if they do not exist. pub fn make_dirs(&self) -> PyResult<()> { - // convert String to Path - let path: &Path = self.path.as_ref(); - if let Some(directory) = path.parent() { + if let Some(directory) = self._path.parent() { // check if the dir is exit already if !directory.exists() { // create the dir if not @@ -666,7 +666,7 @@ impl Keyfile { /// Returns: /// readable (bool): ``True`` if the file is readable. pub fn exists_on_device(&self) -> PyResult { - Ok(Path::new(&self.path).exists()) + Ok(self._path.exists()) } /// Returns ``True`` if the file under path is readable. @@ -677,7 +677,7 @@ impl Keyfile { } // get file metadata - let metadata = fs::metadata(&self.path).map_err(|e| { + let metadata = fs::metadata(&self._path).map_err(|e| { PyErr::new::(format!("Failed to get metadata for file: {}.", e)) })?; @@ -699,7 +699,7 @@ impl Keyfile { } // get file metadata - let metadata = fs::metadata(&self.path).map_err(|e| { + let metadata = fs::metadata(&self._path).map_err(|e| { PyErr::new::(format!("Failed to get metadata for file: {}", e)) })?; @@ -989,7 +989,7 @@ impl Keyfile { } // open and read the file - let mut file = fs::File::open(&self.path) + let mut file = fs::File::open(&self._path) .map_err(|e| PyErr::new::(format!("Failed to open file: {}.", e)))?; let mut data_vec = Vec::new(); file.read_to_end(&mut data_vec) @@ -1025,7 +1025,7 @@ impl Keyfile { .write(true) .create(true) .truncate(true) // cleanup if rewrite - .open(&self.path) + .open(&self._path) .map_err(|e| PyErr::new::(format!("Failed to open file: {}.", e)))?; // write data @@ -1034,9 +1034,9 @@ impl Keyfile { .map_err(|e| PyErr::new::(format!("Failed to write to file: {}.", e)))?; // set permissions - let mut permissions = fs::metadata(&self.path)?.permissions(); + let mut permissions = fs::metadata(&self._path)?.permissions(); permissions.set_mode(0o600); // just for owner - fs::set_permissions(&self.path, permissions).map_err(|e| { + fs::set_permissions(&self._path, permissions).map_err(|e| { PyErr::new::(format!("Failed to set permissions: {}.", e)) })?; Ok(()) diff --git a/src/wallet.rs b/src/wallet.rs index 36d5470a..bd1f65d3 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -4,6 +4,7 @@ use pyo3::types::{IntoPyDict, PyString, PyType}; use colored::Colorize; use std::env; +use std::path::PathBuf; use crate::config::Config; use crate::constants::{BT_WALLET_HOTKEY, BT_WALLET_NAME, BT_WALLET_PATH}; @@ -12,10 +13,6 @@ use crate::keyfile::Keyfile; use crate::keypair::Keypair; use crate::utils::{self, is_valid_bittensor_address_or_public_key}; -use dirs::home_dir; - -type PyRuntimeError = KeyFileError; - /// Display the mnemonic and a warning message to keep the mnemonic safe. #[pyfunction] #[pyo3(signature = (mnemonic, key_type))] @@ -65,6 +62,8 @@ pub struct Wallet { pub path: String, pub hotkey: String, + _path: PathBuf, + _coldkey: Option, _coldkeypub: Option, _hotkey: Option, @@ -132,17 +131,18 @@ impl Wallet { path } else if let Some(conf_path) = conf_path { conf_path - .strip_prefix("~/") - .unwrap_or(&conf_path) - .to_string() } else { BT_WALLET_PATH.to_string() }; + let expanded_path: PathBuf = PathBuf::from(shellexpand::tilde(&final_path).to_string()); + Ok(Wallet { name: final_name, hotkey: final_hotkey, - path: final_path, + path: final_path.clone(), + + _path: expanded_path, _coldkey: None, _coldkeypub: None, @@ -152,14 +152,14 @@ impl Wallet { fn __str__(&self) -> PyResult { Ok(format!( - "Wallet (Name: '{:}', Hotkey: '{:}', Path: '~/{:}')", + "Wallet (Name: '{:}', Hotkey: '{:}', Path: '{:}')", self.name, self.hotkey, self.path )) } fn __repr__(&self) -> PyResult { Ok(format!( - "name: '{:}', hotkey: '{:}', path: '~/{:}'", + "name: '{:}', hotkey: '{:}', path: '{:}'", self.name, self.hotkey, self.path )) } @@ -389,12 +389,8 @@ except argparse.ArgumentError: /// Created Hot Keyfile for Keypair #[pyo3(signature = (save_hotkey_to_env=false))] pub fn create_hotkey_file(&self, save_hotkey_to_env: bool) -> PyResult { - // get home dir - let home = home_dir() - .ok_or_else(|| PyErr::new::("Failed to get user home directory."))?; - // concatenate wallet path - let wallet_path = home.join(&self.path).join(&self.name); + let wallet_path = self._path.join(&self.name); // concatenate hotkey path let hotkey_path = wallet_path.join("hotkeys").join(&self.hotkey); @@ -415,12 +411,8 @@ except argparse.ArgumentError: /// Created Cold Keyfile for Keypair #[pyo3(signature = (save_coldkey_to_env=false))] pub fn create_coldkey_file(&self, save_coldkey_to_env: bool) -> PyResult { - // get home dir - let home = home_dir() - .ok_or_else(|| PyErr::new::("Failed to get user home directory."))?; - // concatenate wallet path - let wallet_path = home.join(&self.path).join(&self.name); + let wallet_path = PathBuf::from(&self._path).join(&self.name); // concatenate coldkey path let coldkey_path = wallet_path.join("coldkey"); @@ -434,12 +426,8 @@ except argparse.ArgumentError: /// Property that returns the coldkeypub file. #[getter] pub fn coldkeypub_file(&self) -> PyResult { - // get home dir - let home = home_dir() - .ok_or_else(|| PyErr::new::("Failed to get user home directory."))?; - // concatenate wallet path - let wallet_path = home.join(&self.path).join(&self.name); + let wallet_path = self._path.join(&self.name); // concatenate hotkey path let coldkeypub_path = wallet_path.join("coldkeypub.txt"); @@ -834,7 +822,7 @@ except argparse.ArgumentError: let keypair = Keypair::new(ss58_address, public_key, None, 42, None, 1)?; - self.set_coldkeypub(keypair, overwrite, false, py)?; + self.set_coldkeypub(keypair, false, overwrite, py)?; Ok(self.clone()) } From 045d0e6e30d37b49ff6fc9b15522ccd4248f3253 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 16:34:13 -0500 Subject: [PATCH 06/13] Fix ruff (#62) --- bittensor_wallet/__init__.py | 20 ++++++++++---------- tests/test_keyfile.py | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/bittensor_wallet/__init__.py b/bittensor_wallet/__init__.py index 78d83762..b58bbfee 100644 --- a/bittensor_wallet/__init__.py +++ b/bittensor_wallet/__init__.py @@ -1,16 +1,16 @@ from bittensor_wallet.bittensor_wallet import ( # classes - Config, - Keyfile, - Keypair, - Wallet, + Config as Config, + Keyfile as Keyfile, + Keypair as Keypair, + Wallet as Wallet, # modules - config, - errors, - keyfile, - keypair, - utils, - wallet, + config as config, + errors as errors, + keyfile as keyfile, + keypair as keypair, + utils as utils, + wallet as wallet, ) __version__ = "2.0.0" diff --git a/tests/test_keyfile.py b/tests/test_keyfile.py index 182e9f1f..2663c701 100644 --- a/tests/test_keyfile.py +++ b/tests/test_keyfile.py @@ -23,7 +23,6 @@ import pytest from bip39 import bip39_validate -from jedi.common import monkeypatch from bittensor_wallet.errors import ConfigurationError, KeyFileError from bittensor_wallet.keyfile import Keyfile From 3bb3172d2c0ba2979a5bae3e0045596c6aa922eb Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 16:57:09 -0500 Subject: [PATCH 07/13] add rustup to CI (#63) * add rustup to CI * make rustup accept all * add to path --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0dfd44d..c2e10538 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,8 @@ jobs: - run: name: Set Up Virtual Environment command: | + curl https://sh.rustup.rs -sSf | sh -s -- -y + . "$HOME/.cargo/env" python -m venv .venv . .venv/bin/activate python -m pip install --upgrade pip From 44f6beea90a2537ad26d43f5b3717da1a953c2ee Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:12:00 -0500 Subject: [PATCH 08/13] Update CHANGELOG.MD --- CHANGELOG.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index f87d4391..5db9643c 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -5,6 +5,7 @@ ## What's Changed * Add the ability to use environment variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 +* Fix wallet paths outside userhome by @camfairchild in https://github.com/opentensor/btwallet/pull/59 * fix/roman/fix-config-parsing by @roman-opentensor in https://github.com/opentensor/btwallet/pull/47 **Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.1...v2.0.2 From 3a8356840523bd0673c6ebe0a40e8acdbfde0434 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:12:09 -0500 Subject: [PATCH 09/13] Update CHANGELOG.MD --- CHANGELOG.MD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 5db9643c..e2032af6 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -6,6 +6,8 @@ * Add the ability to use environment variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 * Fix wallet paths outside userhome by @camfairchild in https://github.com/opentensor/btwallet/pull/59 +* fix https://github.com/opentensor/btwallet/issues/51 by @camfairchild in https://github.com/opentensor/btwallet/pull/56 +* password fixes by @roman-opentensor * fix/roman/fix-config-parsing by @roman-opentensor in https://github.com/opentensor/btwallet/pull/47 **Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.1...v2.0.2 From bfa1b88b1eb949733c1979bc49853e5edbe7a5db Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:43:01 -0500 Subject: [PATCH 10/13] fix changelog --- CHANGELOG.MD | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index e2032af6..a366d28c 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,13 +1,21 @@ # Changelog -## 2.0.2 /2024-10-10 +## 2.1.0 /2024-11-12 ## What's Changed -* Add the ability to use environment variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 +* Fix hot/coldkey passwords in env by @roman-opentensor in https://github.com/opentensor/btwallet/pull/55 * Fix wallet paths outside userhome by @camfairchild in https://github.com/opentensor/btwallet/pull/59 * fix https://github.com/opentensor/btwallet/issues/51 by @camfairchild in https://github.com/opentensor/btwallet/pull/56 * password fixes by @roman-opentensor + +**Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.2...v2.1.0 + +## 2.0.2 /2024-10-10 + +## What's Changed + +* Add the ability to use environment variables to store hot/coldkey passwords by @roman-opentensor in https://github.com/opentensor/btwallet/pull/46 * fix/roman/fix-config-parsing by @roman-opentensor in https://github.com/opentensor/btwallet/pull/47 **Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.1...v2.0.2 From 1e1ee28eef3cfb3a00a78001443d2c17eb3c4297 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:43:04 -0500 Subject: [PATCH 11/13] bump ver --- bittensor_wallet/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bittensor_wallet/__init__.py b/bittensor_wallet/__init__.py index b58bbfee..e8a47c3d 100644 --- a/bittensor_wallet/__init__.py +++ b/bittensor_wallet/__init__.py @@ -13,4 +13,4 @@ wallet as wallet, ) -__version__ = "2.0.0" +__version__ = "2.1.0" diff --git a/pyproject.toml b/pyproject.toml index ebc9d2da..2ba4f6da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bittensor-wallet" -version = "2.0.3" +version = "2.1.0" description = "" readme = "README.md" license = {file = "LICENSE"} From 252e7e35739cb1d5a6ba197fba63c783201a6667 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:44:29 -0500 Subject: [PATCH 12/13] bump cargo toml ver --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ab102c7..9ec49dca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,7 +352,7 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bittensor_wallet" -version = "2.0.3" +version = "2.1.0" dependencies = [ "ansible-vault", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index e75f16c5..3ee74de9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bittensor_wallet" -version = "2.0.3" +version = "2.1.0" edition = "2021" [lib] From 4cc06af72c9ee5f3b0a59d0edc41f0868857c612 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 12 Nov 2024 17:47:01 -0500 Subject: [PATCH 13/13] Update CHANGELOG.MD --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 4758db43..07ffeff3 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,7 +7,7 @@ * Fix hot/coldkey passwords in env by @roman-opentensor in https://github.com/opentensor/btwallet/pull/55 * Fix wallet paths outside userhome by @camfairchild in https://github.com/opentensor/btwallet/pull/59 * fix https://github.com/opentensor/btwallet/issues/51 by @camfairchild in https://github.com/opentensor/btwallet/pull/56 -* password fixes by @roman-opentensor +* password fixes and new PasswordError by @roman-opentensor **Full Changelog**: https://github.com/opentensor/btwallet/compare/v2.0.2...v2.1.0