Skip to content

Commit

Permalink
Merge pull request #813 from Chia-Network/enable-keccak-flag
Browse files Browse the repository at this point in the history
expose ENABLE_KECCAK flag in python binding
  • Loading branch information
arvidn authored Dec 5, 2024
2 parents d0540f1 + cf2e48f commit 89296f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wheel/generate_type_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ def get_flags_for_height_and_constants(
NO_UNKNOWN_CONDS: int = ...
STRICT_ARGS_COUNT: int = ...
LIMIT_HEAP: int = ...
ENABLE_KECCAK: int = ...
ENABLE_KECCAK_OPS_OUTSIDE_GUARD: int = ...
MEMPOOL_MODE: int = ...
ALLOW_BACKREFS: int = ...
DONT_VALIDATE_SIGNATURE: int = ...
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 @@ -69,6 +69,8 @@ def get_flags_for_height_and_constants(
NO_UNKNOWN_CONDS: int = ...
STRICT_ARGS_COUNT: int = ...
LIMIT_HEAP: int = ...
ENABLE_KECCAK: int = ...
ENABLE_KECCAK_OPS_OUTSIDE_GUARD: int = ...
MEMPOOL_MODE: int = ...
ALLOW_BACKREFS: int = ...
DONT_VALIDATE_SIGNATURE: int = ...
Expand Down
6 changes: 6 additions & 0 deletions wheel/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use chia_protocol::{
};
use chia_traits::ChiaToPython;
use clvm_utils::tree_hash_from_bytes;
use clvmr::chia_dialect::{ENABLE_KECCAK, ENABLE_KECCAK_OPS_OUTSIDE_GUARD};
use clvmr::{LIMIT_HEAP, NO_UNKNOWN_OPS};
use pyo3::buffer::PyBuffer;
use pyo3::exceptions::{PyRuntimeError, PyTypeError, PyValueError};
Expand Down Expand Up @@ -621,6 +622,11 @@ pub fn chia_rs(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(run_chia_program, m)?)?;
m.add("NO_UNKNOWN_OPS", NO_UNKNOWN_OPS)?;
m.add("LIMIT_HEAP", LIMIT_HEAP)?;
m.add("ENABLE_KECCAK", ENABLE_KECCAK)?;
m.add(
"ENABLE_KECCAK_OPS_OUTSIDE_GUARD",
ENABLE_KECCAK_OPS_OUTSIDE_GUARD,
)?;

m.add_function(wrap_pyfunction!(serialized_length, m)?)?;
m.add_function(wrap_pyfunction!(compute_merkle_set_root, m)?)?;
Expand Down

0 comments on commit 89296f7

Please sign in to comment.