bugs
This commit is contained in:
parent
182fc7c150
commit
5ea2599264
|
@ -65,8 +65,11 @@ def aggsig_in_conditions_dict(conditions_dict):
|
||||||
return agg_sig_conditions
|
return agg_sig_conditions
|
||||||
|
|
||||||
|
|
||||||
def hash_key_pairs_for_conditions_dict(conditions_dict: Dict[ConditionOpcode, ConditionVarPair]) -> List[bytes]:
|
|
||||||
pairs: bytes = []
|
|
||||||
|
def hash_key_pairs_for_conditions_dict(conditions_dict: Dict[ConditionOpcode, List[ConditionVarPair]]) \
|
||||||
|
-> List[BLSSignature.AGGSIGPair]:
|
||||||
|
pairs: [BLSSignature.AGGSIGPair] = []
|
||||||
for cvp in conditions_dict.get(ConditionOpcode.AGG_SIG, []):
|
for cvp in conditions_dict.get(ConditionOpcode.AGG_SIG, []):
|
||||||
# TODO: check types
|
# TODO: check types
|
||||||
# assert len(_) == 3
|
# assert len(_) == 3
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
from src.util.Conditions import ConditionOpcode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def make_create_coin_condition(puzzle_hash, amount):
|
||||||
|
return [ConditionOpcode.CREATE_COIN, puzzle_hash, amount]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_coin_consumed_condition(coin_name):
|
||||||
|
return [ConditionOpcode.ASSERT_COIN_CONSUMED, coin_name]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_my_coin_id_condition(coin_name):
|
||||||
|
return [ConditionOpcode.ASSERT_MY_COIN_ID, coin_name]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_min_time_condition(time):
|
||||||
|
return [ConditionOpcode.ASSERT_MIN_TIME, time]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_block_index_exceeds_condition(block_index):
|
||||||
|
return [ConditionOpcode.ASSERT_BLOCK_INDEX_EXCEEDS, block_index]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_block_age_exceeds_condition(block_index):
|
||||||
|
return [ConditionOpcode.ASSERT_BLOCK_AGE_EXCEEDS, block_index]
|
||||||
|
|
||||||
|
|
||||||
|
def make_assert_time_exceeds_condition(time):
|
||||||
|
return [ConditionOpcode.ASSERT_TIME_EXCEEDS, time]
|
|
@ -26,11 +26,6 @@ def puzzle_program_for_index(index):
|
||||||
def puzzle_hash_for_index(index):
|
def puzzle_hash_for_index(index):
|
||||||
return ProgramHash(puzzle_program_for_index(index))
|
return ProgramHash(puzzle_program_for_index(index))
|
||||||
|
|
||||||
|
|
||||||
def make_create_coin_condition(puzzle_hash, amount):
|
|
||||||
return [ConditionOpcode.CREATE_COIN, puzzle_hash, amount]
|
|
||||||
|
|
||||||
|
|
||||||
def conditions_for_payment(puzzle_hash_amount_pairs):
|
def conditions_for_payment(puzzle_hash_amount_pairs):
|
||||||
conditions = [
|
conditions = [
|
||||||
make_create_coin_condition(ph, amount)
|
make_create_coin_condition(ph, amount)
|
||||||
|
|
Loading…
Reference in New Issue