aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-11-15 10:47:22 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:24:48 +0800
commitb771020f8804b3f9853d44ffa2b43195cc08162a (patch)
treeae497074b64d1e7328a320b4554bf65140e720dc /packages/pipeline
parentb42cf0c797661bfc94eb8162817eb8fa118a69a2 (diff)
downloaddexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar.gz
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar.bz2
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar.lz
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar.xz
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.tar.zst
dexon-sol-tools-b771020f8804b3f9853d44ffa2b43195cc08162a.zip
Add homepage_url to relayers
Diffstat (limited to 'packages/pipeline')
-rw-r--r--packages/pipeline/migrations/1542249766882-AddHomepageUrlToRelayers.ts14
-rw-r--r--packages/pipeline/src/entities/relayer.ts13
-rw-r--r--packages/pipeline/src/parsers/relayer_registry/index.ts2
3 files changed, 22 insertions, 7 deletions
diff --git a/packages/pipeline/migrations/1542249766882-AddHomepageUrlToRelayers.ts b/packages/pipeline/migrations/1542249766882-AddHomepageUrlToRelayers.ts
new file mode 100644
index 000000000..9a4811ad5
--- /dev/null
+++ b/packages/pipeline/migrations/1542249766882-AddHomepageUrlToRelayers.ts
@@ -0,0 +1,14 @@
+import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
+
+export class AddHomepageUrlToRelayers1542249766882 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<any> {
+ await queryRunner.addColumn(
+ 'raw.relayers',
+ new TableColumn({ name: 'homepage_url', type: 'varchar', default: `'unknown'` }),
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<any> {
+ await queryRunner.dropColumn('raw.relayers', 'homepage_url');
+ }
+}
diff --git a/packages/pipeline/src/entities/relayer.ts b/packages/pipeline/src/entities/relayer.ts
index ef1f9cf2a..b3a856fd8 100644
--- a/packages/pipeline/src/entities/relayer.ts
+++ b/packages/pipeline/src/entities/relayer.ts
@@ -5,19 +5,20 @@ export class Relayer {
@PrimaryColumn() public uuid!: string;
@Column() public name!: string;
- @Column() public url!: string;
- @Column({ nullable: true, type: String, name: 'sra_http_endpoint' })
+ @Column({ name: 'homepage_url', type: 'varchar' })
+ public homepageUrl!: string;
+ @Column({ name: 'sra_http_endpoint', type: 'varchar', nullable: true })
public sraHttpEndpoint!: string | null;
- @Column({ nullable: true, type: String, name: 'sra_ws_endpoint' })
+ @Column({ name: 'sra_ws_endpoint', type: 'varchar', nullable: true })
public sraWsEndpoint!: string | null;
- @Column({ nullable: true, type: String, name: 'app_url' })
+ @Column({ name: 'app_url', type: 'varchar', nullable: true })
public appUrl!: string | null;
// TODO(albrow): Add exchange contract or protocol version?
// TODO(albrow): Add network ids for addresses?
- @Column({ type: 'varchar', array: true, name: 'fee_recipient_addresses' })
+ @Column({ name: 'fee_recipient_addresses', type: 'varchar', array: true })
public feeRecipientAddresses!: string[];
- @Column({ type: 'varchar', array: true, name: 'taker_addresses' })
+ @Column({ name: 'taker_addresses', type: 'varchar', array: true })
public takerAddresses!: string[];
}
diff --git a/packages/pipeline/src/parsers/relayer_registry/index.ts b/packages/pipeline/src/parsers/relayer_registry/index.ts
index 346f570bd..7b1235005 100644
--- a/packages/pipeline/src/parsers/relayer_registry/index.ts
+++ b/packages/pipeline/src/parsers/relayer_registry/index.ts
@@ -16,7 +16,7 @@ function parseRelayer(relayerResp: RelayerResponse, uuid: string): Relayer {
const relayer = new Relayer();
relayer.uuid = uuid;
relayer.name = relayerResp.name;
- relayer.url = relayerResp.homepage_url;
+ relayer.homepageUrl = relayerResp.homepage_url;
relayer.appUrl = relayerResp.app_url;
const mainnet = getMainNetwork(relayerResp);
if (mainnet !== undefined) {