Skip to content

Commit 92d64e7

Browse files
committed
psbt: Remove extra newlines
1 parent 76ad4dd commit 92d64e7

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

hwilib/psbt.py

-12
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def deserialize(self, f: Readable) -> None:
134134
utxo_bytes = BufferedReader(BytesIO(deser_string(f))) # type: ignore
135135
self.non_witness_utxo.deserialize(utxo_bytes)
136136
self.non_witness_utxo.rehash()
137-
138137
elif key_type == 1:
139138
if key in key_lookup:
140139
raise PSBTSerializationError("Duplicate Key, input witness utxo already provided")
@@ -143,7 +142,6 @@ def deserialize(self, f: Readable) -> None:
143142
self.witness_utxo = CTxOut()
144143
tx_out_bytes = BufferedReader(BytesIO(deser_string(f))) # type: ignore
145144
self.witness_utxo.deserialize(tx_out_bytes)
146-
147145
elif key_type == 2:
148146
if len(key) != 34 and len(key) != 66:
149147
raise PSBTSerializationError("Size of key was not the expected size for the type partial signature pubkey")
@@ -153,47 +151,40 @@ def deserialize(self, f: Readable) -> None:
153151

154152
sig = deser_string(f)
155153
self.partial_sigs[pubkey] = sig
156-
157154
elif key_type == 3:
158155
if key in key_lookup:
159156
raise PSBTSerializationError("Duplicate key, input sighash type already provided")
160157
elif len(key) != 1:
161158
raise PSBTSerializationError("sighash key is more than one byte type")
162159
sighash_bytes = deser_string(f)
163160
self.sighash = struct.unpack("<I", sighash_bytes)[0]
164-
165161
elif key_type == 4:
166162
if key in key_lookup:
167163
raise PSBTSerializationError("Duplicate key, input redeemScript already provided")
168164
elif len(key) != 1:
169165
raise PSBTSerializationError("redeemScript key is more than one byte type")
170166
self.redeem_script = deser_string(f)
171-
172167
elif key_type == 5:
173168
if key in key_lookup:
174169
raise PSBTSerializationError("Duplicate key, input witnessScript already provided")
175170
elif len(key) != 1:
176171
raise PSBTSerializationError("witnessScript key is more than one byte type")
177172
self.witness_script = deser_string(f)
178-
179173
elif key_type == 6:
180174
DeserializeHDKeypath(f, key, self.hd_keypaths, [34, 66])
181-
182175
elif key_type == 7:
183176
if key in key_lookup:
184177
raise PSBTSerializationError("Duplicate key, input final scriptSig already provided")
185178
elif len(key) != 1:
186179
raise PSBTSerializationError("final scriptSig key is more than one byte type")
187180
self.final_script_sig = deser_string(f)
188-
189181
elif key_type == 8:
190182
if key in key_lookup:
191183
raise PSBTSerializationError("Duplicate key, input final scriptWitness already provided")
192184
elif len(key) != 1:
193185
raise PSBTSerializationError("final scriptWitness key is more than one byte type")
194186
witness_bytes = BufferedReader(BytesIO(deser_string(f))) # type: ignore
195187
self.final_script_witness.deserialize(witness_bytes)
196-
197188
else:
198189
if key in self.unknown:
199190
raise PSBTSerializationError("Duplicate key, key for unknown value already provided")
@@ -303,17 +294,14 @@ def deserialize(self, f: Readable) -> None:
303294
elif len(key) != 1:
304295
raise PSBTSerializationError("Output redeemScript key is more than one byte type")
305296
self.redeem_script = deser_string(f)
306-
307297
elif key_type == 1:
308298
if key in key_lookup:
309299
raise PSBTSerializationError("Duplicate key, output witnessScript already provided")
310300
elif len(key) != 1:
311301
raise PSBTSerializationError("Output witnessScript key is more than one byte type")
312302
self.witness_script = deser_string(f)
313-
314303
elif key_type == 2:
315304
DeserializeHDKeypath(f, key, self.hd_keypaths, [34, 66])
316-
317305
else:
318306
if key in self.unknown:
319307
raise PSBTSerializationError("Duplicate key, key for unknown value already provided")

0 commit comments

Comments
 (0)