Repository: Chia-Network/chia-blockchain
Pull request: EL.Show NFT contract address on plot check
Minor update to display the NFT contract address during `chia plots check` and some formatting changes to improve output
Resolves #8030

Problem statement:
[BUG] Need to check pool contract address on existing plot
**Describe the bug**
You can see the public farmer key of a plot but not the pool contract address when using chia plots check

**To Reproduce**
Chia plots check, pool address is blank, no area for contract address

**Expected behavior**
Show pool contract address

Hints from issue discussion:

Commit message: Show NFT contract address on plot check

Patch to review:
diff --git a/chia/plotting/check_plots.py b/chia/plotting/check_plots.py
index 3a3bf1add829..f2fe3c469742 100644
--- a/chia/plotting/check_plots.py
+++ b/chia/plotting/check_plots.py
@@ -16,6 +16,7 @@
     find_duplicate_plot_IDs,
     parse_plot_info,
 )
+from chia.util.bech32m import encode_puzzle_hash
 from chia.util.config import load_config
 from chia.util.hash import std_hash
 from chia.util.keychain import Keychain
@@ -30,6 +31,7 @@ def plot_refresh_callback(event: PlotRefreshEvents, refresh_result: PlotRefreshR
 
 def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, debug_show_memo):
     config = load_config(root_path, "config.yaml")
+    address_prefix = config["network_overrides"]["config"][config["selected_network"]]["address_prefix"]
     plot_refresh_parameter: PlotsRefreshParameter = PlotsRefreshParameter(batch_sleep_milliseconds=0)
     plot_manager: PlotManager = PlotManager(
         root_path,
@@ -102,7 +104,11 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d
         for plot_path, plot_info in plot_manager.plots.items():
             pr = plot_info.prover
             log.info(f"Testing plot {plot_path} k={pr.get_size()}")
-            log.info(f"\tPool public key: {plot_info.pool_public_key}")
+            if plot_info.pool_public_key is not None:
+                log.info(f"\t{'Pool public key:':<26} {plot_info.pool_public_key}")
+            if plot_info.pool_contract_puzzle_hash is not None:
+                pca: str = encode_puzzle_hash(plot_info.pool_contract_puzzle_hash, address_prefix)
+                log.info(f"\t{'Pool NFT contract address:':<26} {pca}")
 
             # Look up local_sk from plot to save locked memory
             (
@@ -111,8 +117,8 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d
                 local_master_sk,
             ) = parse_plot_info(pr.get_memo())
             local_sk = master_sk_to_local_sk(local_master_sk)
-            log.info(f"\tFarmer public key: {farmer_public_key}")
-            log.info(f"\tLocal sk: {local_sk}")
+            log.info(f"\t{'Farmer public key:' :<26} {farmer_public_key}")
+            log.info(f"\t{'Local sk:' :<26} {local_sk}")
             total_proofs = 0
             caught_exception: bool = False
             for i in range(num_start, num_end):


Code review comments:
diff_hunk: @@ -102,7 +104,11 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d
         for plot_path, plot_info in plot_manager.plots.items():
             pr = plot_info.prover
             log.info(f"Testing plot {plot_path} k={pr.get_size()}")
-            log.info(f"\tPool public key: {plot_info.pool_public_key}")
+            if plot_info.pool_public_key is not None:
+                log.info(f"\t{'Pool public key:':<26} {plot_info.pool_public_key}")
+            if plot_info.pool_contract_puzzle_hash is not None:
+                pca: str = encode_puzzle_hash(plot_info.pool_contract_puzzle_hash, address_prefix)
+                log.info(f"\t{'Pool NFT contract address:':<26} {pca}")
path: chia/plotting/check_plots.py
text: @user1:
```suggestion
                log.info(f"\t{'Pool contract address:':<26} {pca}")
```

@author:
Yes, `chia plotnft show` says `Pool contract address` - will update for consistency