What changed, and why it matters
This commit simply renames two internal data keys from singular to plural (e.g., 'claimed_fingerprint' becomes 'claimed_fingerprints') because they actually hold lists of values. It also removes a commented-out debug print line. There is no change to program logic, no bug fix, and no security relevance.
No security action needed. This is a non-functional code cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a pure refactor across psbt_parser.py, psbt_views.py, and test_psbt_parser.py. It changes dictionary keys ‘claimed_fingerprint’ and ‘claimed_derivation_path’ to ‘claimed_fingerprints’ and ‘claimed_derivation_paths’ to better reflect that the values are lists (one per cosigner). All call sites are updated consistently, and a commented-out print statement is removed. No functional behavior changes.
Changed components
src/seedsigner/models/psbt_parser.pysrc/seedsigner/views/psbt_views.pytests/test_psbt_parser.pyInspect captured patch +14 / −15
### src/seedsigner/models/psbt_parser.py
@@ -277,8 +277,8 @@ def _parse_outputs(self, child_key_derivation_cache: dict):
"output_index": i,
"address": addr,
"amount": vout[i].value,
- "claimed_fingerprint": claimed_fingerprints,
- "claimed_derivation_path": claimed_derivation_paths,
+ "claimed_fingerprints": claimed_fingerprints,
+ "claimed_derivation_paths": claimed_derivation_paths,
})
self.change_amount += vout[i].value
### src/seedsigner/views/psbt_views.py
@@ -116,16 +116,15 @@ def run(self):
{
'address': 'bc1q............',
'amount': 397621401,
- 'claimed_fingerprint': ['22bde1a9', '73c5da0a'],
- 'claimed_derivation_path': ['m/48h/1h/0h/2h/1/0', 'm/48h/1h/0h/2h/1/0']
+ 'claimed_fingerprints': ['22bde1a9', '73c5da0a'],
+ 'claimed_derivation_paths': ['m/48h/1h/0h/2h/1/0', 'm/48h/1h/0h/2h/1/0']
}, {},
]
"""
num_change_outputs = 0
num_self_transfer_outputs = 0
for change_output in change_data:
- # print(f"""{change_output["claimed_derivation_path"][0]}""")
- if change_output["claimed_derivation_path"][0].split("/")[-2] == "1":
+ if change_output["claimed_derivation_paths"][0].split("/")[-2] == "1":
num_change_outputs += 1
else:
num_self_transfer_outputs += 1
@@ -325,21 +324,21 @@ def run(self):
{
'address': 'bc1q............',
'amount': 397621401,
- 'claimed_fingerprint': ['22bde1a9', '73c5da0a'],
- 'claimed_derivation_path': ['m/48h/1h/0h/2h/1/0', 'm/48h/1h/0h/2h/1/0']
+ 'claimed_fingerprints': ['22bde1a9', '73c5da0a'],
+ 'claimed_derivation_paths': ['m/48h/1h/0h/2h/1/0', 'm/48h/1h/0h/2h/1/0']
}
"""
# Single-sig verification is easy. We expect to find a single fingerprint
# and derivation path.
seed_fingerprint = self.controller.psbt_seed.get_fingerprint(self.settings.get_value(SettingsConstants.SETTING__NETWORK))
- if seed_fingerprint not in change_data.get("claimed_fingerprint"):
+ if seed_fingerprint not in change_data.get("claimed_fingerprints"):
# TODO: Something is wrong with this psbt(?). Reroute to warning?
return Destination(NotYetImplementedView)
- i = change_data.get("claimed_fingerprint").index(seed_fingerprint)
- claimed_derivation_path = change_data.get("claimed_derivation_path")[i]
+ i = change_data.get("claimed_fingerprints").index(seed_fingerprint)
+ claimed_derivation_path = change_data.get("claimed_derivation_paths")[i]
# 'm/84h/1h/0h/1/0' would be a change addr while 'm/84h/1h/0h/0/0' is a self-receive
is_change_derivation_path = int(claimed_derivation_path.split("/")[-2]) == 1
### tests/test_psbt_parser.py
@@ -321,8 +321,8 @@ def test_p2tr_change_detection():
'output_index': 0,
'address': 'bcrt1prz4g6saush37epdwhvwpu78td3q7yfz3xxz37axlx7udck6wracq3rwq30',
'amount': 2871443918,
- 'claimed_fingerprint': ['394aed14'],
- 'claimed_derivation_path': ['m/86h/1h/0h/1/1']}
+ 'claimed_fingerprints': ['394aed14'],
+ 'claimed_derivation_paths': ['m/86h/1h/0h/1/1']}
]
assert pp.spend_amount == 319049328
assert pp.change_amount == 2871443918
@@ -481,8 +481,8 @@ def test_parse_op_return_content():
'output_index': 0,
'address': 'bcrt1qvwkhakqhz7m7kmz6332avatsmdy32m644g86vv',
'amount': 99992296,
- 'claimed_fingerprint': ['0fb882ff'],
- 'claimed_derivation_path': ["m/84h/1h/0h/0/2"]}
+ 'claimed_fingerprints': ['0fb882ff'],
+ 'claimed_derivation_paths': ["m/84h/1h/0h/0/2"]}
]
assert psbt_parser.spend_amount == 0 # This is a self-spend; no value being spent, other than the tx fee
assert psbt_parser.change_amount == 99992296Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.