MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wscript_to_local

Function wscript_to_local

tests/test_opening.py:124–134  ·  view source on GitHub ↗

BOLT #3 to_local witness script (no lease).

(to_self_delay, revocationpubkey, local_delayedpubkey)

Source from the content-addressed store, hash-verified

122
123
124def wscript_to_local(to_self_delay, revocationpubkey, local_delayedpubkey):
125 """BOLT #3 to_local witness script (no lease)."""
126 OP_IF, OP_ELSE, OP_ENDIF = 0x63, 0x67, 0x68
127 OP_DROP, OP_CHECKSEQUENCEVERIFY, OP_CHECKSIG = 0x75, 0xb2, 0xac
128 return (bytes([OP_IF])
129 + _push_bytes(revocationpubkey)
130 + bytes([OP_ELSE])
131 + _add_number(to_self_delay)
132 + bytes([OP_CHECKSEQUENCEVERIFY, OP_DROP])
133 + _push_bytes(local_delayedpubkey)
134 + bytes([OP_ENDIF, OP_CHECKSIG]))
135
136
137def p2wsh(wscript):

Calls 2

_push_bytesFunction · 0.85
_add_numberFunction · 0.85

Tested by

no test coverage detected