fix tests
This commit is contained in:
parent
dcc028fa2e
commit
2aa6c45daf
@ -411,7 +411,7 @@ def test_h_qrscan(en_okeys, set_hobble, scan_a_qr, need_keypress, press_cancel,
|
||||
for ss in keys:
|
||||
need_keypress(KEY_QR)
|
||||
scan_a_qr(ss)
|
||||
time.sleep(0.5)
|
||||
time.sleep(1)
|
||||
|
||||
title, story = cap_story()
|
||||
if en_okeys:
|
||||
@ -428,7 +428,7 @@ def test_h_qrscan(en_okeys, set_hobble, scan_a_qr, need_keypress, press_cancel,
|
||||
need_keypress(KEY_QR)
|
||||
tt = f'B$H{dt}0100'+('A'*80)
|
||||
scan_a_qr(tt)
|
||||
time.sleep(0.5)
|
||||
time.sleep(1)
|
||||
|
||||
if dt == 'E':
|
||||
title, story = cap_story()
|
||||
|
||||
@ -606,7 +606,7 @@ def test_20_more_build_after_match(sim_exec, import_ms_wallet, clear_ms, wipe_ca
|
||||
|
||||
|
||||
def test_named_wallet_search_fail(load_shared_mod, goto_home, pick_menu_item, nfc_write,
|
||||
cap_story):
|
||||
cap_story, sim_root_dir):
|
||||
addr = fake_address(AF_P2WSH, True)
|
||||
addr = f"{addr}?wallet=unknown"
|
||||
cc_ndef = load_shared_mod('cc_ndef', '../shared/ndef.py')
|
||||
@ -619,7 +619,8 @@ def test_named_wallet_search_fail(load_shared_mod, goto_home, pick_menu_item, nf
|
||||
pick_menu_item('Advanced/Tools')
|
||||
pick_menu_item('NFC Tools')
|
||||
pick_menu_item('Verify Address')
|
||||
open('debug/nfc-addr.ndef', 'wb').write(ccfile)
|
||||
with open(f'{sim_root_dir}/debug/nfc-addr.ndef', 'wb') as f:
|
||||
f.write(ccfile)
|
||||
nfc_write(ccfile)
|
||||
|
||||
time.sleep(1)
|
||||
@ -634,7 +635,7 @@ def test_named_wallet_search_fail(load_shared_mod, goto_home, pick_menu_item, nf
|
||||
def test_named_wallet_search(wname, valid, method, clear_ms, import_ms_wallet, is_q1,
|
||||
load_shared_mod, goto_home, pick_menu_item, scan_a_qr,
|
||||
cap_story, need_keypress, nfc_write, use_testnet,
|
||||
wipe_cache, settings_set):
|
||||
wipe_cache, settings_set, sim_root_dir):
|
||||
|
||||
from test_multisig import make_ms_address, HARD
|
||||
|
||||
@ -695,7 +696,8 @@ def test_named_wallet_search(wname, valid, method, clear_ms, import_ms_wallet, i
|
||||
pick_menu_item('Advanced/Tools')
|
||||
pick_menu_item('NFC Tools')
|
||||
pick_menu_item('Verify Address')
|
||||
open('debug/nfc-addr.ndef', 'wb').write(ccfile)
|
||||
with open(f'{sim_root_dir}/debug/nfc-addr.ndef', 'wb') as f:
|
||||
f.write(ccfile)
|
||||
nfc_write(ccfile)
|
||||
# press_select()
|
||||
|
||||
|
||||
@ -1876,12 +1876,15 @@ def test_op_return_signing(op_return_data, dev, fake_txn, bitcoind_d_sim_watch,
|
||||
assert "Multiple OP_RETURN outputs:" not in story # always just one - core restriction
|
||||
|
||||
try:
|
||||
assert len(op_return_data) <= 200
|
||||
expect = op_return_data.decode("ascii")
|
||||
assert len(op_return_data) <= 160
|
||||
try:
|
||||
expect = op_return_data.decode("ascii")
|
||||
except:
|
||||
# not ascii
|
||||
expect = op_return_data.hex()
|
||||
except:
|
||||
expect = binascii.hexlify(op_return_data).decode()
|
||||
if len(op_return_data) > 200:
|
||||
expect = expect[:200] + "\n ⋯\n" + expect[-200:]
|
||||
expect = expect[:160] + "\n ⋯\n" + expect[-160:]
|
||||
|
||||
assert expect in story
|
||||
tx = end_sign(accept=True, finalize=True).hex()
|
||||
|
||||
@ -610,7 +610,11 @@ def test_deltamode_signature(active_policy, setup_sssp, bitcoind, settings_set,
|
||||
# check wrong signature happened
|
||||
assert signed != signed2
|
||||
probs = wo.testmempoolaccept([signed2.hex()])[0]
|
||||
assert 'Signature must be zero' in probs['reject-reason'], probs
|
||||
try:
|
||||
# old bitcoind
|
||||
assert 'Signature must be zero' in probs['reject-reason'], probs
|
||||
except AssertionError:
|
||||
assert 'mandatory-script-verify-flag-failed' in probs['reject-reason'], probs
|
||||
assert not probs['allowed']
|
||||
|
||||
# check right signature
|
||||
|
||||
Loading…
Reference in New Issue
Block a user