Skip to content

Commit

Permalink
debug commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Yostra committed Feb 9, 2022
1 parent 359ac29 commit d4339a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions chia/wallet/nft_wallet/nft_puzzles.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def match_nft_puzzle(puzzle: Program) -> Tuple[bool, Iterator[Program]]:
if mod == NFT_MOD:
return True, curried_args.as_iter()
except Exception:
import traceback
print(f"exception: {traceback.format_exc()}")
breakpoint()
return False, iter(())
return False, iter(())

Expand All @@ -73,6 +76,7 @@ def get_transfer_program_from_solution(solution: Program) -> Program:
prog = solution.rest().rest().rest().rest().rest().rest().rest().rest().rest().first()
return prog
except Exception:
breakpoint()
return None
return None

Expand Down
3 changes: 2 additions & 1 deletion chia/wallet/nft_wallet/nft_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def coin_added(self, coin: Coin, height: uint32):
async def puzzle_solution_received(self, coin_spend: CoinSpend):
coin_name = coin_spend.coin.name()
puzzle: Program = Program.from_bytes(bytes(coin_spend.puzzle_reveal))
solution: Program = Program.from_bytes(bytes(coin_spend.solution))
solution: Program = Program.from_bytes(bytes(coin_spend.solution)).rest().rest().first()
matched, curried_args = nft_puzzles.match_nft_puzzle(puzzle)
nft_transfer_program = None
if matched:
Expand All @@ -155,6 +155,7 @@ async def puzzle_solution_received(self, coin_spend: CoinSpend):
if attempt is not None:
nft_transfer_program = attempt
await self.add_transfer_program(nft_transfer_program)

assert nft_transfer_program is not None
self.log.info(f"found the info for coin {coin_name}")
parent_coin = None
Expand Down
6 changes: 3 additions & 3 deletions chia/wallet/wallet_state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,9 @@ async def determine_coin_type(self, peer, coin_state) -> Tuple[Optional[uint32],
for wallet_info in await self.get_all_wallet_info_entries():
if wallet_info.type == WalletType.NFT:
nft_wallet_info = NFTWalletInfo.from_json_dict(json.loads(wallet_info.data))
if nft_wallet_info.my_did == current_owner_did:
wallet_id = wallet_info.id
wallet_type = WalletType.NFT
for hint in hint_list:
if nft_wallet_info.my_did == hint:
return wallet_info.id, WalletType.NFT

return wallet_id, wallet_type

Expand Down

0 comments on commit d4339a6

Please sign in to comment.