Пример #1
0
def initialize_signer(app_config):
    path_to_secret = os.path.join(app_config.usb_name, app_config.key_file)

    if app_config.chain.blockchain_type == BlockchainType.ethereum:
        signer = EthereumSigner(ethereum_chain=app_config.chain)
    elif app_config.chain == Chain.mockchain:
        signer = None
    else:
        raise UnknownChainError(app_config.chain)
    secret_manager = FileSecretManager(signer=signer, path_to_secret=path_to_secret,
                                       safe_mode=app_config.safe_mode, issuing_address=app_config.issuing_address)
    return secret_manager
Пример #2
0
def initialize_signer(app_config):
    path_to_secret = os.path.join(app_config.usb_name,
                                  app_config.private_key_file)

    if app_config.chain.blockchain_type == BlockchainType.bitcoin:
        signer = BitcoinSigner(bitcoin_chain=app_config.chain)
    elif app_config.chain == Chain.mockchain:
        signer = None
    else:
        raise UnknownChainError(app_config.chain)
    secret_manager = FileSecretManager(signer=signer,
                                       path_to_secret=path_to_secret,
                                       safe_mode=app_config.safe_mode,
                                       issuing_address=app_config.public_key)
    return secret_manager