@@ -200,8 +200,9 @@ def __init__(
200
200
taproot_key_spend_signature : Octets = b"" ,
201
201
taproot_script_spend_signatures : Mapping [Octets , Octets ] | None = None ,
202
202
taproot_leaf_scripts : Mapping [Octets , tuple [Octets , int ]] | None = None ,
203
- taproot_hd_key_paths : Mapping [Octets , tuple [list [Octets ], BIP32KeyOrigin ]]
204
- | None = None ,
203
+ taproot_hd_key_paths : (
204
+ Mapping [Octets , tuple [list [Octets ], BIP32KeyOrigin ]] | None
205
+ ) = None ,
205
206
taproot_internal_key : Octets = b"" ,
206
207
taproot_merkle_root : Octets = b"" ,
207
208
unknown : Mapping [Octets , Octets ] | None = None ,
@@ -283,12 +284,12 @@ def to_dict(self, check_validity: bool = True) -> dict[str, Any]:
283
284
self .assert_valid ()
284
285
285
286
return {
286
- "non_witness_utxo" : self . non_witness_utxo . to_dict ( False )
287
- if self .non_witness_utxo
288
- else None ,
289
- "witness_utxo" : self . witness_utxo . to_dict ( False )
290
- if self .witness_utxo
291
- else None ,
287
+ "non_witness_utxo" : (
288
+ self . non_witness_utxo . to_dict ( False ) if self .non_witness_utxo else None
289
+ ) ,
290
+ "witness_utxo" : (
291
+ self . witness_utxo . to_dict ( False ) if self .witness_utxo else None
292
+ ) ,
292
293
"partial_signatures" : encode_dict_bytes_bytes (self .partial_sigs ),
293
294
"sig_hash" : self .sig_hash_type ,
294
295
# TODO make it { "asm": "", "hex": "" }
@@ -327,12 +328,16 @@ def from_dict(
327
328
decode_from_bip32_derivs (dict_ ["taproot_hd_key_paths" ]),
328
329
)
329
330
return cls (
330
- Tx .from_dict (dict_ ["non_witness_utxo" ], False )
331
- if dict_ ["non_witness_utxo" ]
332
- else None ,
333
- TxOut .from_dict (dict_ ["witness_utxo" ], False )
334
- if dict_ ["witness_utxo" ]
335
- else None ,
331
+ (
332
+ Tx .from_dict (dict_ ["non_witness_utxo" ], False )
333
+ if dict_ ["non_witness_utxo" ]
334
+ else None
335
+ ),
336
+ (
337
+ TxOut .from_dict (dict_ ["witness_utxo" ], False )
338
+ if dict_ ["witness_utxo" ]
339
+ else None
340
+ ),
336
341
dict_ ["partial_signatures" ],
337
342
dict_ ["sig_hash" ],
338
343
dict_ ["redeem_script" ],
0 commit comments