mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-03 15:54:20 +01:00
sign outputs as bytes (#399)
This commit is contained in:
@@ -154,7 +154,7 @@ class LedgerSpendingConditions:
|
||||
assert signature, TransactionError("no HTLC refund signature provided")
|
||||
for pubkey in refund_pubkeys:
|
||||
if verify_p2pk_signature(
|
||||
message=htlc_secret.serialize().encode("utf-8"),
|
||||
message=proof.secret.encode("utf-8"),
|
||||
pubkey=PublicKey(bytes.fromhex(pubkey), raw=True),
|
||||
signature=bytes.fromhex(signature),
|
||||
):
|
||||
@@ -181,7 +181,7 @@ class LedgerSpendingConditions:
|
||||
assert signature, TransactionError("HTLC no hash lock signatures provided.")
|
||||
for pubkey in hashlock_pubkeys:
|
||||
if verify_p2pk_signature(
|
||||
message=htlc_secret.serialize().encode("utf-8"),
|
||||
message=proof.secret.encode("utf-8"),
|
||||
pubkey=PublicKey(bytes.fromhex(pubkey), raw=True),
|
||||
signature=bytes.fromhex(signature),
|
||||
):
|
||||
@@ -305,7 +305,7 @@ class LedgerSpendingConditions:
|
||||
for sig in p2pksigs:
|
||||
for pubkey in pubkeys:
|
||||
if verify_p2pk_signature(
|
||||
message=output.B_.encode("utf-8"),
|
||||
message=bytes.fromhex(output.B_),
|
||||
pubkey=PublicKey(bytes.fromhex(pubkey), raw=True),
|
||||
signature=bytes.fromhex(sig),
|
||||
):
|
||||
|
||||
@@ -93,7 +93,7 @@ class WalletP2PK(SupportsPrivateKey, SupportsDb):
|
||||
assert private_key.pubkey
|
||||
return [
|
||||
sign_p2pk_sign(
|
||||
message=output.B_.encode("utf-8"),
|
||||
message=bytes.fromhex(output.B_),
|
||||
private_key=private_key,
|
||||
).hex()
|
||||
for output in outputs
|
||||
|
||||
Reference in New Issue
Block a user