예제 #1
0
def create_ethereum_interchain_v1(user_data: Dict[str, Any], conflict_check: bool = True) -> Dict[str, Any]:
    client = eth.new_from_user_input(user_data)
    if conflict_check and interchain_dao.does_interchain_exist("ethereum", client.name):
        _log.error("Ethereum network is already registered")
        raise exceptions.InterchainConflict(f"An ethereum interchain network with the name {client.name} is already registered")
    interchain_dao.save_interchain_client(client)
    return _get_output_dto_v1(client)
예제 #2
0
def create_bitcoin_interchain_v1(user_data: Dict[str, Any]) -> Dict[str, Any]:
    client = btc.new_from_user_input(user_data)
    if interchain_dao.does_interchain_exist("bitcoin", client.name):
        _log.error("Bitcoin network is already registered")
        raise exceptions.InterchainConflict(
            f"A bitcoin interchain network with the name {client.name} is already registered"
        )
    interchain_dao.save_interchain_client(client)
    return _get_output_dto_v1(client)