Skip to content

Commit

Permalink
Revert "rename get_name_puzzle_conditions to get_conditions_from_spen…
Browse files Browse the repository at this point in the history
…dbundle"

This reverts commit 7565924.
  • Loading branch information
matt-o-how committed Jul 30, 2024
1 parent 47c23d7 commit 019b2f1
Show file tree
Hide file tree
Showing 5 changed files with 403 additions and 8 deletions.
395 changes: 395 additions & 0 deletions crates/chia-consensus/src/multiprocess_validation.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/chia-consensus/src/spendbundle_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use clvmr::run_program::run_program;
use clvmr::serde::node_from_bytes;
use std::collections::{HashMap, HashSet};

pub fn get_conditions_from_spendbundle(
pub fn get_name_puzzle_conditions(
spend_bundle: &SpendBundle,
max_cost: u64,
height: u32,
Expand Down
2 changes: 1 addition & 1 deletion wheel/generate_type_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def validate_clvm_and_signature(
cache: Optional[BLSCache],
) -> Tuple[SpendBundleConditions, float]: ...
def get_conditions_from_spendbundle(
def get_name_puzzle_conditions(
spend_bundle: SpendBundle,
max_cost: int,
constants: ConsensusConstants,
Expand Down
2 changes: 1 addition & 1 deletion wheel/python/chia_rs/chia_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def validate_clvm_and_signature(
cache: Optional[BLSCache],
) -> Tuple[SpendBundleConditions, float]: ...

def get_conditions_from_spendbundle(
def get_name_puzzle_conditions(
spend_bundle: SpendBundle,
max_cost: int,
constants: ConsensusConstants,
Expand Down
10 changes: 5 additions & 5 deletions wheel/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use chia_consensus::spendbundle_validation::{
get_flags_for_height_and_constants, validate_clvm_and_signature,
};

use chia_consensus::spendbundle_conditions::get_conditions_from_spendbundle;
use chia_consensus::spendbundle_conditions::get_name_puzzle_conditions;
use chia_protocol::{
BlockRecord, Bytes32, ChallengeBlockInfo, ChallengeChainSubSlot, ClassgroupElement, Coin,
CoinSpend, CoinState, CoinStateFilters, CoinStateUpdate, EndOfSubSlotBundle, Foliage,
Expand Down Expand Up @@ -400,14 +400,14 @@ pub fn py_validate_clvm_and_signature(
}

#[pyfunction]
#[pyo3(name = "get_conditions_from_spendbundle")]
pub fn py_get_conditions_from_spendbundle(
#[pyo3(name = "get_name_puzzle_conditions")]
pub fn py_get_name_puzzle_conditions(
spend_bundle: &SpendBundle,
max_cost: u64,
constants: &ConsensusConstants,
height: u32,
) -> PyResult<OwnedSpendBundleConditions> {
let osbc = get_conditions_from_spendbundle(spend_bundle, max_cost, height, constants).map_err(
let osbc = get_name_puzzle_conditions(spend_bundle, max_cost, height, constants).map_err(
|e| {
let error_code: u32 = e.1.into();
PyErr::new::<PyTypeError, _>(error_code)
Expand Down Expand Up @@ -457,7 +457,7 @@ pub fn chia_rs(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {

// multithread validattion
m.add_function(wrap_pyfunction!(py_validate_clvm_and_signature, m)?)?;
m.add_function(wrap_pyfunction!(py_get_conditions_from_spendbundle, m)?)?;
m.add_function(wrap_pyfunction!(pyget_name_puzzle_conditions, m)?)?;
m.add_function(wrap_pyfunction!(py_get_flags_for_height_and_constants, m)?)?;

// clvm functions
Expand Down

0 comments on commit 019b2f1

Please sign in to comment.