Skip to content

Commit

Permalink
Revert drep_info to use null value for expires_epoch_no and deposit i…
Browse files Browse the repository at this point in the history
…f unregistered.
  • Loading branch information
Scitz0 committed Jul 30, 2024
1 parent f33b5e9 commit 5309c1a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
4 changes: 2 additions & 2 deletions files/grest/rpc/governance/drep_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ BEGIN
ENCODE(dh.raw, 'hex')::text AS hex,
dh.has_script AS has_script,
(CASE WHEN starts_with(dh.view,'drep_') OR (COALESCE(dr.deposit, 0) >= 0 AND dr.drep_hash_id IS NOT NULL) THEN TRUE ELSE FALSE END) AS registered,
(CASE WHEN (dr.deposit < 0) OR starts_with(dh.view,'drep_') THEN 0 ELSE COALESCE(ds.deposit, 0) END)::text AS deposit,
(CASE WHEN (dr.deposit < 0) OR starts_with(dh.view,'drep_') THEN NULL ELSE ds.deposit END)::text AS deposit,
(CASE WHEN starts_with(dh.view,'drep_') THEN TRUE ELSE COALESCE(dr.deposit, 0) >= 0 AND ds.active END) AS active,
(CASE WHEN COALESCE(dr.deposit, 0) >= 0 THEN COALESCE(ds.expires_epoch_no, 0) ELSE 0 END) AS expires_epoch_no,
(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
FROM public.drep_hash AS dh
LEFT JOIN public.drep_registration AS dr ON dh.id = dr.drep_hash_id
Expand Down
8 changes: 6 additions & 2 deletions specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4974,15 +4974,19 @@ components:
description: Flag to show if the DRep is currently registered
example: false
deposit:
type: string
type:
- string
- null
description: DRep's registration deposit in lovelace
example: 500000000
active:
type: boolean
description: Flag to show if the DRep is (i.e. not expired)
example: true
expires_epoch_no:
type: number
type:
- number
- null
description: After which epoch DRep is considered inactive.
example: 410
amount:
Expand Down
8 changes: 6 additions & 2 deletions specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4974,15 +4974,19 @@ components:
description: Flag to show if the DRep is currently registered
example: false
deposit:
type: string
type:
- string
- null
description: DRep's registration deposit in lovelace
example: 500000000
active:
type: boolean
description: Flag to show if the DRep is (i.e. not expired)
example: true
expires_epoch_no:
type: number
type:
- number
- null
description: After which epoch DRep is considered inactive.
example: 410
amount:
Expand Down
8 changes: 6 additions & 2 deletions specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4974,15 +4974,19 @@ components:
description: Flag to show if the DRep is currently registered
example: false
deposit:
type: string
type:
- string
- null
description: DRep's registration deposit in lovelace
example: 500000000
active:
type: boolean
description: Flag to show if the DRep is (i.e. not expired)
example: true
expires_epoch_no:
type: number
type:
- number
- null
description: After which epoch DRep is considered inactive.
example: 410
amount:
Expand Down
8 changes: 6 additions & 2 deletions specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4974,15 +4974,19 @@ components:
description: Flag to show if the DRep is currently registered
example: false
deposit:
type: string
type:
- string
- null
description: DRep's registration deposit in lovelace
example: 500000000
active:
type: boolean
description: Flag to show if the DRep is (i.e. not expired)
example: true
expires_epoch_no:
type: number
type:
- number
- null
description: After which epoch DRep is considered inactive.
example: 410
amount:
Expand Down
8 changes: 6 additions & 2 deletions specs/templates/4-api-schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2273,15 +2273,19 @@ schemas:
description: Flag to show if the DRep is currently registered
example: false
deposit:
type: string
type:
- string
- null
description: DRep's registration deposit in lovelace
example: 500000000
active:
type: boolean
description: Flag to show if the DRep is (i.e. not expired)
example: true
expires_epoch_no:
type: number
type:
- number
- null
description: After which epoch DRep is considered inactive.
example: 410
amount:
Expand Down

0 comments on commit 5309c1a

Please sign in to comment.