@ -302,8 +302,10 @@ def test_signing_imported(setup_wallet, wif, keytype, type_check):
MIXDEPTH = 0
MIXDEPTH = 0
path = wallet . import_private_key ( MIXDEPTH , wif , keytype )
path = wallet . import_private_key ( MIXDEPTH , wif , keytype )
utxo = fund_wallet_addr ( wallet , wallet . get_address_from_path ( path ) )
utxo = fund_wallet_addr ( wallet , wallet . get_address_from_path ( path ) )
tx = btc . deserialize ( btc . mktx ( [ ' {} : {} ' . format ( hexlify ( utxo [ 0 ] ) . decode ( ' ascii ' ) , utxo [ 1 ] ) ] ,
# The dummy output is constructed as an unspendable p2sh:
[ ' 00 ' * 17 + ' : ' + str ( 10 * * 8 - 9000 ) ] ) )
tx = btc . deserialize ( btc . mktx ( [ ' {} : {} ' . format (
hexlify ( utxo [ 0 ] ) . decode ( ' ascii ' ) , utxo [ 1 ] ) ] ,
[ btc . p2sh_scriptaddr ( b " \x00 " , magicbyte = 196 ) + ' : ' + str ( 10 * * 8 - 9000 ) ] ) )
script = wallet . get_script_from_path ( path )
script = wallet . get_script_from_path ( path )
tx = wallet . sign_tx ( tx , { 0 : ( script , 10 * * 8 ) } )
tx = wallet . sign_tx ( tx , { 0 : ( script , 10 * * 8 ) } )
type_check ( tx )
type_check ( tx )
@ -322,11 +324,10 @@ def test_signing_simple(setup_wallet, wallet_cls, type_check):
wallet_cls . initialize ( storage , get_network ( ) )
wallet_cls . initialize ( storage , get_network ( ) )
wallet = wallet_cls ( storage )
wallet = wallet_cls ( storage )
utxo = fund_wallet_addr ( wallet , wallet . get_internal_addr ( 0 ) )
utxo = fund_wallet_addr ( wallet , wallet . get_internal_addr ( 0 ) )
# The dummy output is of length 25 bytes, because, for SegwitWallet, we else
# The dummy output is constructed as an unspendable p2sh:
# trigger the tx-size-small DOS limit in Bitcoin Core (82 bytes is the
tx = btc . deserialize ( btc . mktx ( [ ' {} : {} ' . format (
# smallest "normal" transaction size (non-segwit size, ie no witness)
hexlify ( utxo [ 0 ] ) . decode ( ' ascii ' ) , utxo [ 1 ] ) ] ,
tx = btc . deserialize ( btc . mktx ( [ ' {} : {} ' . format ( hexlify ( utxo [ 0 ] ) . decode ( ' ascii ' ) ,
[ btc . p2sh_scriptaddr ( b " \x00 " , magicbyte = 196 ) + ' : ' + str ( 10 * * 8 - 9000 ) ] ) )
utxo [ 1 ] ) ] , [ ' 00 ' * 25 + ' : ' + str ( 10 * * 8 - 9000 ) ] ) )
script = wallet . get_script ( 0 , 1 , 0 )
script = wallet . get_script ( 0 , 1 , 0 )
tx = wallet . sign_tx ( tx , { 0 : ( script , 10 * * 8 ) } )
tx = wallet . sign_tx ( tx , { 0 : ( script , 10 * * 8 ) } )
type_check ( tx )
type_check ( tx )