Skip to content

Commit

Permalink
IntoPyObject for bytes32... hmm
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Jan 27, 2025
1 parent 1ace2b6 commit 339474f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/chia-protocol/src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,13 @@ impl From<TreeHash> for Bytes32 {
}

#[cfg(feature = "py-bindings")]
impl<const N: usize> ToPyObject for BytesImpl<N> {
fn to_object(&self, py: Python<'_>) -> PyObject {
ChiaToPython::to_python(self, py).unwrap().into()
impl<'py, const N: usize> IntoPyObject<'py> for BytesImpl<N> {
type Target = PyAny;
type Output = Bound<'py, Self::Target>;
type Error = PyErr;

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
ChiaToPython::to_python(&self, py)
}
}

Expand Down

0 comments on commit 339474f

Please sign in to comment.