From 8248fbb231a0c0acd59fd1f265114dd6dc78a253 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 7 Nov 2018 15:29:34 -0800 Subject: Update relayer code to use new relayer-registry format --- packages/pipeline/src/parsers/relayer_registry/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'packages/pipeline/src/parsers/relayer_registry/index.ts') diff --git a/packages/pipeline/src/parsers/relayer_registry/index.ts b/packages/pipeline/src/parsers/relayer_registry/index.ts index 6eca10167..50fd12443 100644 --- a/packages/pipeline/src/parsers/relayer_registry/index.ts +++ b/packages/pipeline/src/parsers/relayer_registry/index.ts @@ -3,10 +3,14 @@ import * as R from 'ramda'; import { RelayerResponse, RelayerResponseNetwork } from '../../data_sources/relayer-registry'; import { Relayer } from '../../entities/Relayer'; -export const parseRelayers = R.map(parseRelayer); +export function parseRelayers(rawResp: Map): Relayer[] { + const parsedAsObject = R.mapObjIndexed(parseRelayer, rawResp); + return R.values(parsedAsObject); +} -function parseRelayer(relayerResp: RelayerResponse): Relayer { +function parseRelayer(relayerResp: RelayerResponse, uuid: string): Relayer { const relayer = new Relayer(); + relayer.uuid = uuid; relayer.name = relayerResp.name; relayer.url = relayerResp.homepage_url; relayer.appUrl = relayerResp.app_url; -- cgit v1.2.3