segwit and wrapped are SS cmds only
This commit is contained in:
parent
3256ab4690
commit
36eebbcd3d
@ -36,8 +36,8 @@ Options:
|
||||
num-outs
|
||||
-f, --fee INTEGER Miner's fee in Satoshis
|
||||
-2, --psbt2 Make PSBTv2
|
||||
-s, --segwit Make inputs be segwit style
|
||||
-w, --wrapped Make inputs be wrapped segwit style
|
||||
-s, --segwit [SS] Make inputs be segwit style
|
||||
-w, --wrapped [SS] Make inputs be wrapped segwit style
|
||||
(requires --segwit flag)
|
||||
-a, --styles [p2wsh|p2sh|p2sh-p2wsh|p2wsh-p2sh|p2wpkh|p2pkh|p2wpkh-p2sh|p2sh-p2wpkh|p2tr]
|
||||
Output address style (multiple ok). If
|
||||
|
||||
@ -28,8 +28,8 @@ SIM_XPUB = 'tpubD6NzVbkrYhZ4XzL5Dhayo67Gorv1YMS7j8pRUvVMd5odC2LBPLAygka9p7748JtS
|
||||
@click.option('--num-change', '-c', help="Number of change outputs (default 1) from num-outs", default=1)
|
||||
@click.option('--fee', '-f', help="Miner's fee in Satoshis", default=1000)
|
||||
@click.option('--psbt2', '-2', help="Make PSBTv2", is_flag=True, default=False)
|
||||
@click.option('--segwit', '-s', help="Make inputs be segwit style", is_flag=True, default=False)
|
||||
@click.option('--wrapped', '-w', help="Make inputs be wrapped segwit style (requires --segwit flag)", is_flag=True, default=False)
|
||||
@click.option('--segwit', '-s', help="[SS] Make inputs be segwit style", is_flag=True, default=False)
|
||||
@click.option('--wrapped', '-w', help="[SS] Make inputs be wrapped segwit style (requires --segwit flag)", is_flag=True, default=False)
|
||||
@click.option('--styles', '-a', help="Output address style (multiple ok). If multisig only applies to non-change addresses.", multiple=True, default=None, type=click.Choice(ADDR_STYLES))
|
||||
@click.option('--base64', '-6', help="Output base64 (default binary)", is_flag=True, default=False)
|
||||
@click.option('--testnet', '-t', help="Assume testnet4 addresses (default mainnet)", is_flag=True, default=False)
|
||||
@ -58,9 +58,8 @@ def main(num_ins, num_change, num_outs, out_psbt, testnet, xpub, segwit, fee, st
|
||||
name, af, keys, M, N = from_simple_text(ms_config.split("\n"))
|
||||
psbt, outs = fake_ms_txn(num_ins, num_outs, M, keys, fee=fee, locktime=locktime,
|
||||
change_outputs=list(range(num_change)), outstyles=styles,
|
||||
segwit_in=segwit, input_amount=input_amount, psbt_v2=psbt2,
|
||||
incl_xpubs=incl_xpubs, wrapped=wrapped, is_testnet=testnet,
|
||||
change_af=af)
|
||||
input_amount=input_amount, psbt_v2=psbt2, change_af=af,
|
||||
incl_xpubs=incl_xpubs, is_testnet=testnet)
|
||||
else:
|
||||
if zero_xfp:
|
||||
xpub = None
|
||||
|
||||
@ -354,9 +354,9 @@ def make_ms_address(M, keys, idx, is_change, addr_fmt="p2wsh", testnet=1, bip67=
|
||||
return addr, scriptPubKey, script, bip32paths
|
||||
|
||||
|
||||
def fake_ms_txn(num_ins, num_outs, M, keys, fee=10000, outvals=None, segwit_in=True,
|
||||
outstyles=['p2wsh'], change_outputs=[], incl_xpubs=False, psbt_v2=False,
|
||||
input_amount=1E8, bip67=True, locktime=0, wrapped=False,
|
||||
def fake_ms_txn(num_ins, num_outs, M, keys, fee=10000, outvals=None,
|
||||
outstyles=['p2wsh'], change_outputs=[], incl_xpubs=False,
|
||||
input_amount=1E8, bip67=True, locktime=0, psbt_v2=False,
|
||||
sequences=None, is_testnet=False, change_af=None):
|
||||
# make various size MULTISIG txn's ... completely fake and pointless values
|
||||
# - but has UTXO's to match needs
|
||||
@ -392,10 +392,10 @@ def fake_ms_txn(num_ins, num_outs, M, keys, fee=10000, outvals=None, segwit_in=T
|
||||
addr, scriptPubKey, script, details = make_ms_address(M, keys, i, True,
|
||||
addr_fmt=change_af,
|
||||
bip67=bip67)
|
||||
# lots of supporting details needed for p2sh inputs
|
||||
if segwit_in:
|
||||
if "p2wsh" in change_af:
|
||||
psbt.inputs[i].witness_script = script
|
||||
else:
|
||||
|
||||
if "p2sh" in change_af:
|
||||
psbt.inputs[i].redeem_script = script
|
||||
|
||||
for pubkey, xfp_path in details:
|
||||
@ -412,7 +412,7 @@ def fake_ms_txn(num_ins, num_outs, M, keys, fee=10000, outvals=None, segwit_in=T
|
||||
|
||||
supply.vout.append(CTxOut(int(input_amount), scriptPubKey))
|
||||
|
||||
if not segwit_in:
|
||||
if "wsh" in change_af:
|
||||
psbt.inputs[i].utxo = supply.serialize_with_witness()
|
||||
else:
|
||||
psbt.inputs[i].witness_utxo = supply.vout[-1].serialize()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user