Skip to content

Commit 463f12f

Browse files
committed
rename NULL_TREEHASH -> NIL_TREEHASH
1 parent 28115ba commit 463f12f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

chia/rpc/wallet_rpc_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
from chia.wallet.util.address_type import AddressType, is_valid_address
111111
from chia.wallet.util.compute_hints import compute_spend_hints_and_additions
112112
from chia.wallet.util.compute_memos import compute_memos
113-
from chia.wallet.util.curry_and_treehash import NULL_TREEHASH
113+
from chia.wallet.util.curry_and_treehash import NIL_TREEHASH
114114
from chia.wallet.util.query_filter import HashFilter, TransactionTypeFilter
115115
from chia.wallet.util.transaction_type import CLAWBACK_INCOMING_TRANSACTION_TYPES, TransactionType
116116
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG, CoinSelectionConfig, CoinSelectionConfigLoader, TXConfig
@@ -2333,7 +2333,7 @@ async def did_find_lost_did(self, request: Dict[str, Any]) -> EndpointResult:
23332333
)
23342334
full_puzzle = create_singleton_puzzle(did_puzzle, launcher_id)
23352335
did_puzzle_empty_recovery = DID_INNERPUZ_MOD.curry(
2336-
our_inner_puzzle, NULL_TREEHASH, uint64(0), singleton_struct, metadata
2336+
our_inner_puzzle, NIL_TREEHASH, uint64(0), singleton_struct, metadata
23372337
)
23382338
# Check if we have the DID wallet
23392339
did_wallet: Optional[DIDWallet] = None
@@ -2423,7 +2423,7 @@ async def did_find_lost_did(self, request: Dict[str, Any]) -> EndpointResult:
24232423
inner_solution: Program = full_solution.rest().rest().first()
24242424
recovery_list: List[bytes32] = []
24252425
backup_required: int = num_verification.as_int()
2426-
if recovery_list_hash != NULL_TREEHASH:
2426+
if recovery_list_hash != NIL_TREEHASH:
24272427
try:
24282428
for did in inner_solution.rest().rest().rest().rest().rest().as_python():
24292429
recovery_list.append(did[0])

chia/wallet/did_wallet/did_wallet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from chia.wallet.transaction_record import TransactionRecord
4747
from chia.wallet.uncurried_puzzle import uncurry_puzzle
4848
from chia.wallet.util.compute_memos import compute_memos
49-
from chia.wallet.util.curry_and_treehash import NULL_TREEHASH, shatree_int, shatree_pair
49+
from chia.wallet.util.curry_and_treehash import NIL_TREEHASH, shatree_int, shatree_pair
5050
from chia.wallet.util.transaction_type import TransactionType
5151
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG, CoinSelectionConfig, TXConfig
5252
from chia.wallet.util.wallet_sync_utils import fetch_coin_spend, fetch_coin_spend_for_coin_state
@@ -228,7 +228,7 @@ async def create_new_did_wallet_from_coin_spend(
228228
inner_solution: Program = full_solution.rest().rest().first()
229229
recovery_list: List[bytes32] = []
230230
backup_required: int = num_verification.as_int()
231-
if recovery_list_hash != NULL_TREEHASH:
231+
if recovery_list_hash != NIL_TREEHASH:
232232
try:
233233
for did in inner_solution.rest().rest().rest().rest().rest().as_python():
234234
recovery_list.append(bytes32(did[0]))
@@ -531,7 +531,7 @@ def puzzle_hash_for_pk(self, pubkey: G1Element) -> bytes32:
531531
if self.did_info.origin_coin is None:
532532
# TODO: this seem dumb. Why bother with this case? Is it ever used?
533533
# inner puzzle: (8 . 0)
534-
innerpuz_hash = shatree_pair(shatree_int(8), NULL_TREEHASH)
534+
innerpuz_hash = shatree_pair(shatree_int(8), NIL_TREEHASH)
535535
return create_singleton_puzzle_hash(innerpuz_hash, bytes32([0] * 32))
536536
origin_coin_name = self.did_info.origin_coin.name()
537537
innerpuz_hash = did_wallet_puzzles.get_inner_puzhash_by_p2(

chia/wallet/util/curry_and_treehash.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def shatree_pair(left_hash: bytes32, right_hash: bytes32) -> bytes32:
3737
A_KW_TREEHASH = shatree_atom(A_KW)
3838
C_KW_TREEHASH = shatree_atom(C_KW)
3939
ONE_TREEHASH = shatree_atom(ONE)
40-
NULL_TREEHASH = shatree_atom(NULL)
40+
NIL_TREEHASH = shatree_atom(NULL)
4141

4242

4343
def shatree_atom_list(li: Sequence[bytes]) -> bytes32:
44-
ret = NULL_TREEHASH
44+
ret = NIL_TREEHASH
4545
for item in reversed(li):
4646
ret = shatree_pair(shatree_atom(item), ret)
4747
return ret
@@ -64,7 +64,7 @@ def curried_values_tree_hash(arguments: List[bytes32]) -> bytes32:
6464
C_KW_TREEHASH,
6565
shatree_pair(
6666
shatree_pair(Q_KW_TREEHASH, arguments[0]),
67-
shatree_pair(curried_values_tree_hash(arguments[1:]), NULL_TREEHASH),
67+
shatree_pair(curried_values_tree_hash(arguments[1:]), NIL_TREEHASH),
6868
),
6969
)
7070

@@ -82,7 +82,7 @@ def curry_and_treehash(hash_of_quoted_mod_hash: bytes32, *hashed_arguments: byte
8282
curried_values = curried_values_tree_hash(list(hashed_arguments))
8383
return shatree_pair(
8484
A_KW_TREEHASH,
85-
shatree_pair(hash_of_quoted_mod_hash, shatree_pair(curried_values, NULL_TREEHASH)),
85+
shatree_pair(hash_of_quoted_mod_hash, shatree_pair(curried_values, NIL_TREEHASH)),
8686
)
8787

8888

chia/wallet/wallet_state_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
from chia.wallet.util.address_type import AddressType
128128
from chia.wallet.util.compute_hints import compute_spend_hints_and_additions
129129
from chia.wallet.util.compute_memos import compute_memos
130-
from chia.wallet.util.curry_and_treehash import NULL_TREEHASH
130+
from chia.wallet.util.curry_and_treehash import NIL_TREEHASH
131131
from chia.wallet.util.puzzle_decorator import PuzzleDecoratorManager
132132
from chia.wallet.util.query_filter import HashFilter
133133
from chia.wallet.util.transaction_type import CLAWBACK_INCOMING_TRANSACTION_TYPES, TransactionType
@@ -1255,7 +1255,7 @@ async def handle_did(
12551255
full_puzzle = create_singleton_puzzle(did_puzzle, launch_id)
12561256
did_puzzle_empty_recovery = DID_INNERPUZ_MOD.curry(
12571257
our_inner_puzzle,
1258-
NULL_TREEHASH,
1258+
NIL_TREEHASH,
12591259
uint64(0),
12601260
parent_data.singleton_struct,
12611261
parent_data.metadata,

0 commit comments

Comments
 (0)