Skip to content

Commit

Permalink
Update drep's url/json/hash column references to meta_url, meta_json …
Browse files Browse the repository at this point in the history
…and meta_hash respectively
  • Loading branch information
rdlrt committed Oct 7, 2024
1 parent d724468 commit f748792
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions files/grest/rpc/governance/drep_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 $$
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions files/grest/rpc/governance/drep_metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions specs/templates/4-api-schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f748792

Please sign in to comment.