ledger/btc.py
def _packetize_input(tx_in: tx.TxIn, prevout_info: PrevoutInfo) -> List[bytes]:
    '''Turn an input into a set of packets for tx prep'''
    if tx_in.script_sig != b'':
        raise NotImplementedError('Only native SegWit')
    le_value = rutils.i2le_padded(prevout_info['value'], 8)

    chunks = []

    # 02 for segwit, then the outpoint,
    # then the I64 value, then 0 for len(script)
    chunks.append(b'\x02' + tx_in.outpoint.to_bytes() + le_value + b'\x00')
    chunks.append(tx_in.sequence)

    return [_transaction_continue_packet(chunk) for chunk in chunks]
Turn an input into a set of packets for tx prep
Turn an input into a set of packets for tx prep
Turn an input into a set of packets for tx prep
def _packetize_input(tx_in: tx.TxIn, prevout_info: PrevoutInfo) -> List[bytes]:
    if tx_in.script_sig != b'':
        raise NotImplementedError('Only native SegWit')
    le_value = rutils.i2le_padded(prevout_info['value'], 8)
    chunks = []
    chunks.append(b'\x02' + tx_in.outpoint.to_bytes() + le_value + b'\x00')
    chunks.append(tx_in.sequence)
    return [_transaction_continue_packet(chunk) for chunk in chunks]
def _packetize_input ( tx_in : tx . TxIn , prevout_info : PrevoutInfo ) -> List [ bytes ] : if tx_in . script_sig != b'' : raise NotImplementedError ( 'Only native SegWit' ) le_value = rutils . i2le_padded ( prevout_info [ 'value' ] , 8 ) chunks = [ ] chunks . append ( b'\x02' + tx_in . outpoint . to_bytes ( ) + le_value + b'\x00' ) chunks . append ( tx_in . sequence ) return [ _transaction_continue_packet ( chunk ) for chunk in chunks ]
Turn an input into a set of packets for tx prep
Turn an input into a set of packets for tx prep
'''Turn an input into a set of packets for tx prep''' # 02 for segwit, then the outpoint, # then the I64 value, then 0 for len(script)
tx_in
tx.TxIn
prevout_info
PrevoutInfo