示例#1
0
 def _channel_update(short_channel_id: str, side: Side, disable: bool,
                     cltv_expiry_delta: int, htlc_minimum_msat: int,
                     fee_base_msat: int, fee_proportional_millionths: int,
                     timestamp: Optional[int],
                     htlc_maximum_msat: Optional[int], runner: Runner,
                     event: Event, field: str) -> Message:
     """Get the channel_update"""
     if timestamp is None:
         timestamp = int(time.time())
         return runner.get_stash(event, 'Commit').channel_update(
             short_channel_id, side, disable, cltv_expiry_delta,
             htlc_maximum_msat, fee_base_msat, fee_proportional_millionths,
             timestamp, htlc_maximum_msat)
示例#2
0
 def _channel_id(runner: Runner, event: Event, field: str) -> str:
     return runner.get_stash(event, 'Commit').channel_id_v2()
示例#3
0
 def _channel_announcement(short_channel_id: str, features: bytes,
                           runner: Runner, event: Event,
                           field: str) -> Message:
     return runner.get_stash(event, 'Commit').channel_announcement(
         short_channel_id, features)
示例#4
0
 def _funding_close_tx(runner: Runner, event: Event, field: str) -> str:
     return runner.get_stash(event, 'Funding').close_tx()
示例#5
0
def _htlc_sigs(signer: Side, runner: Runner, event: Event, field: str) -> str:
    sigs = runner.get_stash(event, 'Commit').htlc_sigs(signer, not signer)
    return '[' + ','.join([sig.to_str() for sig in sigs]) + ']'
示例#6
0
 def _witnesses(runner: Runner, event: Event, field: str) -> str:
     funding = runner.get_stash(event, 'Funding')
     return funding.our_witnesses()
示例#7
0
 def _locking_script(runner: Runner, event: Event, field: str) -> str:
     return runner.get_stash(event, 'Funding').locking_script().hex()
示例#8
0
 def _funding(runner: Runner, event: Event, field: str) -> Funding:
     return runner.get_stash(event, 'Funding')
示例#9
0
 def _funding_txid(runner: Runner, event: Event, field: str) -> str:
     return runner.get_stash(event, 'Funding').txid
示例#10
0
 def _commitsig_to_recv(runner: Runner, event: Event, field: str) -> str:
     tx = runner.get_stash(event, 'Commit').local_unsigned_tx()
     return runner.get_stash(event, 'Commit').remote_sig(tx)
示例#11
0
 def _funding_pubkey(side: Side, runner: Runner, event: Event,
                     field: str) -> str:
     return coincurve.PublicKey.from_secret(
         runner.get_stash(event, 'Funding').funding_privkeys[side].secret)
示例#12
0
 def _funding_amount(runner: Runner, event: Event, field: str) -> int:
     return runner.get_stash(event, 'Funding').amount