def _mk_wallet(name: str, sk: ZethAddressPriv) -> Wallet: wallet_dir = join(mock.TEST_NOTE_DIR, name + "-eth") if exists(wallet_dir): # Note: symlink-attack resistance # https://docs.python.org/3/library/shutil.html#shutil.rmtree.avoids_symlink_attacks shutil.rmtree(wallet_dir) return Wallet(mixer_instance, name, wallet_dir, sk, tree_hash)
def open_wallet( mixer_instance: Any, js_secret: ZethAddressPriv, ctx: ClientConfig) -> Wallet: """ Load a wallet using a secret key. """ wallet_dir = ctx.wallet_dir return Wallet(mixer_instance, WALLET_USERNAME, wallet_dir, js_secret)
def open_wallet(mixer_instance: Any, js_secret: ZethAddressPriv, ctx: ClientConfig) -> Wallet: """ Load a wallet using a secret key. """ wallet_dir = ctx.wallet_dir prover_config = create_prover_client(ctx).get_configuration() tree_hash = get_tree_hash_for_pairing( prover_config.pairing_parameters.name) return Wallet(mixer_instance, WALLET_USERNAME, wallet_dir, js_secret, tree_hash)