remove msas (always allowed) remove unsort_ms (always allowed) rework fake_txn # Conflicts: # cli/signit.py # releases/ChangeLog.md # releases/History-Mk4.md # releases/Next-ChangeLog.md # releases/signatures.txt # shared/actions.py # shared/address_explorer.py # shared/auth.py # shared/backups.py # shared/chains.py # shared/decoders.py # shared/descriptor.py # shared/display.py # shared/export.py # shared/flow.py # shared/lcd_display.py # shared/multisig.py # shared/nfc.py # shared/notes.py # shared/nvstore.py # shared/ownership.py # shared/paper.py # shared/psbt.py # shared/qrs.py # shared/seed.py # shared/serializations.py # shared/utils.py # shared/ux.py # shared/ux_mk4.py # shared/ux_q1.py # shared/version.py # shared/wallet.py # shared/xor_seed.py # stm32/COLDCARD_MK4/file_time.c # stm32/COLDCARD_Q1/file_time.c # stm32/MK4-Makefile # stm32/Q1-Makefile # testing/conftest.py # testing/helpers.py # testing/test_address_explorer.py # testing/test_backup.py # testing/test_bbqr.py # testing/test_export.py # testing/test_msg.py # testing/test_multisig.py # testing/test_notes.py # testing/test_ownership.py # testing/test_sign.py # testing/test_unit.py # testing/txn.py
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
# (c) Copyright 2020 by Coinkite Inc. This file is covered by license found in COPYING-CC.
|
|
#
|
|
# load up the simulator w/ indicated test master key in TPRV format.
|
|
#
|
|
import main, ngu
|
|
from sim_settings import sim_defaults
|
|
import stash, chains
|
|
from h import b2a_hex
|
|
from pincodes import pa
|
|
from glob import settings
|
|
from nvstore import SettingsObject
|
|
from stash import SecretStash, SensitiveValues
|
|
from utils import xfp2str, swab32
|
|
|
|
tn = chains.BitcoinTestnet
|
|
|
|
b32_version_pub = 0x043587cf
|
|
b32_version_priv = 0x04358394
|
|
|
|
node = ngu.hdnode.HDNode()
|
|
v = node.deserialize(main.TPRV)
|
|
assert v == b32_version_priv
|
|
assert node
|
|
|
|
settings.current = sim_defaults
|
|
settings.set('chain', 'XTN')
|
|
settings.set('words', False)
|
|
|
|
pa.tmp_value = None
|
|
SettingsObject.master_sv_data = {}
|
|
SettingsObject.master_nvram_key = None
|
|
|
|
raw = SecretStash.encode(xprv=node)
|
|
pa.change(new_secret=raw)
|
|
pa.new_main_secret(raw)
|
|
settings.set('words', False)
|
|
|
|
assert settings.get('xfp', 0) == swab32(node.my_fp())
|
|
|
|
print("TESTING: New tprv in effect [%s]: %s" % (
|
|
settings.get('xpub', 'MISSING'),
|
|
xfp2str(settings.get('xfp', 0))))
|
|
|