Skip to content

Commit

Permalink
Subclass on most types
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Aug 7, 2024
1 parent e1cb0e8 commit d262408
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/chia-bls/src/secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::ops::{Add, AddAssign};

#[cfg_attr(
feature = "py-bindings",
pyo3::pyclass(frozen, name = "PrivateKey"),
pyo3::pyclass(frozen, subclass, name = "PrivateKey"),
derive(chia_py_streamable_macro::PyStreamable)
)]
#[derive(PartialEq, Eq, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions crates/chia-consensus/src/gen/owned_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use chia_py_streamable_macro::{PyJsonDict, PyStreamable};
#[derive(Streamable, Hash, Debug, Clone, Eq, PartialEq)]
#[cfg_attr(
feature = "py-bindings",
pyo3::pyclass(name = "Spend", get_all, frozen),
pyo3::pyclass(name = "Spend", get_all, frozen, subclass),
derive(PyJsonDict, PyStreamable)
)]
pub struct OwnedSpend {
Expand Down Expand Up @@ -39,7 +39,7 @@ pub struct OwnedSpend {
#[derive(Streamable, Hash, Debug, Clone, Eq, PartialEq)]
#[cfg_attr(
feature = "py-bindings",
pyo3::pyclass(name = "SpendBundleConditions", get_all, frozen),
pyo3::pyclass(name = "SpendBundleConditions", get_all, frozen, subclass),
derive(PyJsonDict, PyStreamable)
)]
pub struct OwnedSpendBundleConditions {
Expand Down
2 changes: 1 addition & 1 deletion crates/chia-consensus/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub enum ArrayTypes {

// represents a MerkleSet by putting all the nodes in a vec. Root is the last entry.
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(feature = "py-bindings", pyclass(frozen, name = "MerkleSet"))]
#[cfg_attr(feature = "py-bindings", pyclass(frozen, subclass, name = "MerkleSet"))]
pub struct MerkleSet {
nodes_vec: Vec<(ArrayTypes, [u8; 32])>,
// This is true if the tree was built from a proof. This means the tree may
Expand Down
2 changes: 1 addition & 1 deletion crates/chia_streamable_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn streamable(attr: TokenStream, item: TokenStream) -> TokenStream {
let attrs = if matches!(found_crate, FoundCrate::Itself) {
quote! {
#[cfg_attr(
feature = "py-bindings", pyo3::pyclass(frozen), derive(
feature = "py-bindings", pyo3::pyclass(frozen, subclass), derive(
chia_py_streamable_macro::PyJsonDict,
chia_py_streamable_macro::PyStreamable,
chia_py_streamable_macro::PyGetters
Expand Down

0 comments on commit d262408

Please sign in to comment.