Skip to content

Commit

Permalink
Merge pull request #590 from Chia-Network/quex.from_seed
Browse files Browse the repository at this point in the history
Expose `from_seed` in `SecretKey` to python as well
  • Loading branch information
Rigidity authored Jul 8, 2024
2 parents 877a0dd + 7cf3138 commit 4e6bfd8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/chia-bls/src/secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ impl SecretKey {
pub fn py_derive_unhardened(&self, idx: u32) -> Self {
self.derive_unhardened(idx)
}

#[pyo3(name = "from_seed")]
#[staticmethod]
pub fn py_from_seed(seed: &[u8]) -> Self {
Self::from_seed(seed)
}
}

#[cfg(feature = "py-bindings")]
Expand Down
2 changes: 2 additions & 0 deletions wheel/generate_type_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ def __init__(
"def public_key(self) -> G1Element: ...",
"def derive_hardened(self, int) -> PrivateKey: ...",
"def derive_unhardened(self, int) -> PrivateKey: ...",
"@staticmethod",
"def from_seed(bytes) -> PrivateKey: ...",
],
)

Expand Down
2 changes: 2 additions & 0 deletions wheel/python/chia_rs/chia_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ class PrivateKey:
def public_key(self) -> G1Element: ...
def derive_hardened(self, int) -> PrivateKey: ...
def derive_unhardened(self, int) -> PrivateKey: ...
@staticmethod
def from_seed(bytes) -> PrivateKey: ...
def __init__(
self
) -> None: ...
Expand Down

0 comments on commit 4e6bfd8

Please sign in to comment.