Exemplo n.º 1
0
def test_bip32_burn_keys(setup_wallet, index, wif):
    jm_single().config.set('BLOCKCHAIN', 'network', 'testnet')

    entropy = unhexlify('2e0339ba89b4a1272cdf78b27ee62669ee01992a59e836e2807051be128ca817')
    storage = VolatileStorage()
    SegwitLegacyWalletFidelityBonds.initialize(
        storage, get_network(), entropy=entropy, max_mixdepth=1)
    wallet = SegwitLegacyWalletFidelityBonds(storage)
    mixdepth = FidelityBondMixin.FIDELITY_BOND_MIXDEPTH
    address_type = FidelityBondMixin.BIP32_BURN_ID

    #advance index_cache enough
    wallet.set_next_index(mixdepth, address_type, index, force=True)

    assert wif == wallet.get_wif_path(wallet.get_path(mixdepth, address_type, index))
Exemplo n.º 2
0
def test_bip32_timelocked_addresses(setup_wallet, index, timenumber, address, wif):
    jm_single().config.set('BLOCKCHAIN', 'network', 'testnet')

    entropy = unhexlify('2e0339ba89b4a1272cdf78b27ee62669ee01992a59e836e2807051be128ca817')
    storage = VolatileStorage()
    SegwitLegacyWalletFidelityBonds.initialize(
        storage, get_network(), entropy=entropy, max_mixdepth=1)
    wallet = SegwitLegacyWalletFidelityBonds(storage)
    mixdepth = FidelityBondMixin.FIDELITY_BOND_MIXDEPTH
    address_type = FidelityBondMixin.BIP32_TIMELOCK_ID

    #wallet needs to know about the script beforehand
    wallet.get_script_and_update_map(mixdepth, address_type, index, timenumber)

    assert address == wallet.get_addr(mixdepth, address_type, index, timenumber)
    assert wif == wallet.get_wif_path(wallet.get_path(mixdepth, address_type, index, timenumber))