From f7487929e5454eb0d7a408850c0a477c4b791cad Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:33:53 +1100 Subject: [PATCH] Update drep's url/json/hash column references to meta_url, meta_json and meta_hash respectively --- files/grest/rpc/governance/drep_info.sql | 8 ++++---- files/grest/rpc/governance/drep_metadata.sql | 12 ++++++------ specs/results/koiosapi-guild.yaml | 14 +++++++------- specs/results/koiosapi-mainnet.yaml | 14 +++++++------- specs/results/koiosapi-preprod.yaml | 14 +++++++------- specs/results/koiosapi-preview.yaml | 14 +++++++------- specs/templates/4-api-schemas.yaml | 14 +++++++------- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/files/grest/rpc/governance/drep_info.sql b/files/grest/rpc/governance/drep_info.sql index 9124981a..1865643c 100644 --- a/files/grest/rpc/governance/drep_info.sql +++ b/files/grest/rpc/governance/drep_info.sql @@ -8,8 +8,8 @@ RETURNS TABLE ( active boolean, expires_epoch_no numeric, amount text, - url varchar, - hash text + meta_url varchar, + meta_hash text ) LANGUAGE plpgsql AS $$ @@ -130,8 +130,8 @@ BEGIN (CASE WHEN starts_with(dh.view,'drep_always') THEN TRUE ELSE COALESCE(dr.deposit, 0) >= 0 AND ds.active END) AS active, (CASE WHEN COALESCE(dr.deposit, 0) >= 0 THEN ds.expires_epoch_no ELSE NULL END) AS expires_epoch_no, COALESCE(dd.amount, 0)::text AS amount, - va.url, - ENCODE(va.data_hash, 'hex') AS hash + va.url AS meta_url, + ENCODE(va.data_hash, 'hex') AS meta_hash FROM public.drep_hash AS dh LEFT JOIN public.drep_registration AS dr ON dh.id = dr.drep_hash_id LEFT JOIN public.voting_anchor AS va ON dr.voting_anchor_id = va.id diff --git a/files/grest/rpc/governance/drep_metadata.sql b/files/grest/rpc/governance/drep_metadata.sql index f8bd9358..7049b85e 100644 --- a/files/grest/rpc/governance/drep_metadata.sql +++ b/files/grest/rpc/governance/drep_metadata.sql @@ -3,9 +3,9 @@ RETURNS TABLE ( drep_id text, hex text, has_script boolean, - url varchar, - hash text, - json jsonb, + meta_url varchar, + meta_hash text, + meta_json jsonb, bytes text, warning varchar, language varchar, @@ -21,9 +21,9 @@ BEGIN grest.cip129_hex_to_drep_id(dh.raw, dh.has_script) AS drep_id, ENCODE(dh.raw, 'hex')::text AS hex, dh.has_script AS has_script, - va.url, - ENCODE(va.data_hash, 'hex') AS hash, - ocvd.json, + va.url AS meta_url, + ENCODE(va.data_hash, 'hex') AS meta_hash, + ocvd.json AS meta_json, ENCODE(ocvd.bytes,'hex')::text AS bytes, ocvd.warning AS warning, ocvd.language AS language, diff --git a/specs/results/koiosapi-guild.yaml b/specs/results/koiosapi-guild.yaml index c790af65..7cbda1c5 100644 --- a/specs/results/koiosapi-guild.yaml +++ b/specs/results/koiosapi-guild.yaml @@ -5189,13 +5189,13 @@ components: type: string description: The total amount of voting power this DRep is delegated. example: 599496769641 - url: + meta_url: type: - 'null' - string description: A URL to a JSON payload of metadata example: "https://hornan7.github.io/Vote_Context.jsonld" - hash: + meta_hash: type: - 'null' - string @@ -5257,11 +5257,11 @@ components: $ref: "#/components/schemas/drep_info/items/properties/hex" has_script: $ref: "#/components/schemas/drep_info/items/properties/has_script" - url: - $ref: "#/components/schemas/drep_info/items/properties/url" - hash: - $ref: "#/components/schemas/drep_info/items/properties/hash" - json: + meta_url: + $ref: "#/components/schemas/drep_info/items/properties/meta_url" + meta_hash: + $ref: "#/components/schemas/drep_info/items/properties/meta_hash" + meta_json: type: - 'null' - object diff --git a/specs/results/koiosapi-mainnet.yaml b/specs/results/koiosapi-mainnet.yaml index 48081aae..d3563a92 100644 --- a/specs/results/koiosapi-mainnet.yaml +++ b/specs/results/koiosapi-mainnet.yaml @@ -5189,13 +5189,13 @@ components: type: string description: The total amount of voting power this DRep is delegated. example: 599496769641 - url: + meta_url: type: - 'null' - string description: A URL to a JSON payload of metadata example: "https://hornan7.github.io/Vote_Context.jsonld" - hash: + meta_hash: type: - 'null' - string @@ -5257,11 +5257,11 @@ components: $ref: "#/components/schemas/drep_info/items/properties/hex" has_script: $ref: "#/components/schemas/drep_info/items/properties/has_script" - url: - $ref: "#/components/schemas/drep_info/items/properties/url" - hash: - $ref: "#/components/schemas/drep_info/items/properties/hash" - json: + meta_url: + $ref: "#/components/schemas/drep_info/items/properties/meta_url" + meta_hash: + $ref: "#/components/schemas/drep_info/items/properties/meta_hash" + meta_json: type: - 'null' - object diff --git a/specs/results/koiosapi-preprod.yaml b/specs/results/koiosapi-preprod.yaml index d1a95430..8f0179e2 100644 --- a/specs/results/koiosapi-preprod.yaml +++ b/specs/results/koiosapi-preprod.yaml @@ -5189,13 +5189,13 @@ components: type: string description: The total amount of voting power this DRep is delegated. example: 599496769641 - url: + meta_url: type: - 'null' - string description: A URL to a JSON payload of metadata example: "https://hornan7.github.io/Vote_Context.jsonld" - hash: + meta_hash: type: - 'null' - string @@ -5257,11 +5257,11 @@ components: $ref: "#/components/schemas/drep_info/items/properties/hex" has_script: $ref: "#/components/schemas/drep_info/items/properties/has_script" - url: - $ref: "#/components/schemas/drep_info/items/properties/url" - hash: - $ref: "#/components/schemas/drep_info/items/properties/hash" - json: + meta_url: + $ref: "#/components/schemas/drep_info/items/properties/meta_url" + meta_hash: + $ref: "#/components/schemas/drep_info/items/properties/meta_hash" + meta_json: type: - 'null' - object diff --git a/specs/results/koiosapi-preview.yaml b/specs/results/koiosapi-preview.yaml index b4680797..c443228e 100644 --- a/specs/results/koiosapi-preview.yaml +++ b/specs/results/koiosapi-preview.yaml @@ -5189,13 +5189,13 @@ components: type: string description: The total amount of voting power this DRep is delegated. example: 599496769641 - url: + meta_url: type: - 'null' - string description: A URL to a JSON payload of metadata example: "https://hornan7.github.io/Vote_Context.jsonld" - hash: + meta_hash: type: - 'null' - string @@ -5257,11 +5257,11 @@ components: $ref: "#/components/schemas/drep_info/items/properties/hex" has_script: $ref: "#/components/schemas/drep_info/items/properties/has_script" - url: - $ref: "#/components/schemas/drep_info/items/properties/url" - hash: - $ref: "#/components/schemas/drep_info/items/properties/hash" - json: + meta_url: + $ref: "#/components/schemas/drep_info/items/properties/meta_url" + meta_hash: + $ref: "#/components/schemas/drep_info/items/properties/meta_hash" + meta_json: type: - 'null' - object diff --git a/specs/templates/4-api-schemas.yaml b/specs/templates/4-api-schemas.yaml index f09faa8d..d30da201 100644 --- a/specs/templates/4-api-schemas.yaml +++ b/specs/templates/4-api-schemas.yaml @@ -2354,13 +2354,13 @@ schemas: type: string description: The total amount of voting power this DRep is delegated. example: 599496769641 - url: + meta_url: type: - 'null' - string description: A URL to a JSON payload of metadata example: "https://hornan7.github.io/Vote_Context.jsonld" - hash: + meta_hash: type: - 'null' - string @@ -2422,11 +2422,11 @@ schemas: $ref: "#/components/schemas/drep_info/items/properties/hex" has_script: $ref: "#/components/schemas/drep_info/items/properties/has_script" - url: - $ref: "#/components/schemas/drep_info/items/properties/url" - hash: - $ref: "#/components/schemas/drep_info/items/properties/hash" - json: + meta_url: + $ref: "#/components/schemas/drep_info/items/properties/meta_url" + meta_hash: + $ref: "#/components/schemas/drep_info/items/properties/meta_hash" + meta_json: type: - 'null' - object