Make SpendBundle.debug() use the default genesis challenge by default (#8431)

This commit is contained in:
Matt Hauff 2021-09-14 10:39:40 -07:00 committed by GitHub
parent 9d59079bfa
commit e18a71376d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from typing import List
from blspy import AugSchemeMPL, G2Element
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.streamable import Streamable, dataclass_from_dict, recurse_jsonify, streamable
@ -61,7 +62,7 @@ class SpendBundle(Streamable):
def name(self) -> bytes32:
return self.get_hash()
def debug(self, agg_sig_additional_data=bytes([3] * 32)):
def debug(self, agg_sig_additional_data=DEFAULT_CONSTANTS.AGG_SIG_ME_ADDITIONAL_DATA):
debug_spend_bundle(self, agg_sig_additional_data)
def not_ephemeral_additions(self):

View File

@ -7,6 +7,7 @@ from clvm_tools.binutils import disassemble as bu_disassemble
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program, INFINITE_COST
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict
from chia.util.hash import std_hash
@ -40,7 +41,7 @@ def dump_coin(coin: Coin) -> str:
return disassemble(coin_as_program(coin))
def debug_spend_bundle(spend_bundle, agg_sig_additional_data=bytes([3] * 32)) -> None:
def debug_spend_bundle(spend_bundle, agg_sig_additional_data=DEFAULT_CONSTANTS.AGG_SIG_ME_ADDITIONAL_DATA) -> None:
"""
Print a lot of useful information about a `SpendBundle` that might help with debugging
its clvm.