Skip to content

Commit

Permalink
Add coldkey_file, coldkeypub_file and hotkey_file getters
Browse files Browse the repository at this point in the history
  • Loading branch information
keithtensor committed Dec 9, 2024
1 parent f18b80b commit e4a8ba0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/python_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,30 @@ impl Wallet {
Ok(PyKeypair { inner: keypair })
}

#[getter]
fn coldkey_file(&self) -> PyResult<PyKeyfile> {
self.inner
.coldkey_file()
.map(|inner| PyKeyfile { inner })
.map_err(|e| PyErr::new::<PyKeyFileError, _>(e))
}

#[getter]
fn coldkeypub_file(&self) -> PyResult<PyKeyfile> {
self.inner
.coldkeypub_file()
.map(|inner| PyKeyfile { inner })
.map_err(|e| PyErr::new::<PyKeyFileError, _>(e))
}

#[getter]
fn hotkey_file(&self) -> PyResult<PyKeyfile> {
self.inner
.hotkey_file()
.map(|inner| PyKeyfile { inner })
.map_err(|e| PyErr::new::<PyKeyFileError, _>(e))
}

#[getter]
fn name(&self) -> String {
self.inner.get_name()
Expand Down

0 comments on commit e4a8ba0

Please sign in to comment.