mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 02:24:23 -05:00
chore: fix some comments (#19493)
Signed-off-by: timesince <seekseat@icloud.com>
This commit is contained in:
@@ -394,7 +394,7 @@ bother_waterfowl(fowl=Goose(), aggressiveness=3)
|
||||
|
||||
When hinting based on a Protocol there can often be unexpected complexities.
|
||||
Consider passing in an instance of a class with an attribute hinted `str` while the protocol hints it as `Union[str, int]`.
|
||||
It is common to expect that `str` satisfies `Union[str, int]` and to be throughly confused by mypy's complaint that it does not.
|
||||
It is common to expect that `str` satisfies `Union[str, int]` and to be thoroughly confused by mypy's complaint that it does not.
|
||||
The hazard here is that since the function receiving the object thinks the attribute can be either a `str` or an `int` it may decide to assign an `int` to it.
|
||||
The protocol says this is ok.
|
||||
A good solution for many cases is to hint that attribute as being read only on the protocol.
|
||||
|
||||
@@ -362,7 +362,7 @@ class Blockchain:
|
||||
fork_info.reset(block.height - 1, block.prev_header_hash)
|
||||
|
||||
# we dont consider block_record passed in here since it might be from
|
||||
# a current sync process and not yet fully validated and commited to the DB
|
||||
# a current sync process and not yet fully validated and committed to the DB
|
||||
block_rec_from_db = await self.get_block_record_from_db(header_hash)
|
||||
if block_rec_from_db is not None:
|
||||
# We have already validated the block, but if it's not part of the
|
||||
|
||||
@@ -38,7 +38,7 @@ DEFAULT_CONSTANTS = ConsensusConstants(
|
||||
# Default used for tests is std_hash(b'')
|
||||
GENESIS_CHALLENGE=bytes32.fromhex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"),
|
||||
# Forks of chia should change the AGG_SIG_*_ADDITIONAL_DATA values to provide
|
||||
# replay attack protection. This is set to mainnet genesis challange
|
||||
# replay attack protection. This is set to mainnet genesis challenge
|
||||
AGG_SIG_ME_ADDITIONAL_DATA=AGG_SIG_DATA,
|
||||
AGG_SIG_PARENT_ADDITIONAL_DATA=std_hash(AGG_SIG_DATA + bytes([43])),
|
||||
AGG_SIG_PUZZLE_ADDITIONAL_DATA=std_hash(AGG_SIG_DATA + bytes([44])),
|
||||
|
||||
@@ -155,7 +155,7 @@ class Program(SExp):
|
||||
# (2 (1 . self) rest)
|
||||
#
|
||||
# Resulting in a function which places its own arguments after those
|
||||
# curried in in the form of a proper list.
|
||||
# curried in the form of a proper list.
|
||||
def curry(self, *args) -> Program:
|
||||
fixed_args: Any = 1
|
||||
for arg in reversed(args):
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class Formatter:
|
||||
def __init__(self) -> None:
|
||||
self.start_paren_level: int = 0
|
||||
self.paren_level: int = 0
|
||||
self.out_col: int = 0 # The colum we are at while outputting a line
|
||||
self.out_col: int = 0 # The column we are at while outputting a line
|
||||
self.cur_line: int = 0
|
||||
self.line: list[bytes] = []
|
||||
self.comment: Optional[list[bytes]] = None
|
||||
|
||||
Reference in New Issue
Block a user