Skip to content

Commit

Permalink
Fix specs for voter_proposal_list
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlrt committed Aug 23, 2024
1 parent 369161a commit 9768a67
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 4 deletions.
8 changes: 4 additions & 4 deletions files/grest/rpc/governance/voter_proposal_list.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION grest.voter_proposal_list(credential text)
CREATE OR REPLACE FUNCTION grest.voter_proposal_list(_credential text)
RETURNS TABLE (
block_time integer,
proposal_tx_hash text,
Expand Down Expand Up @@ -31,11 +31,11 @@ DECLARE
_gap_id_list bigint[];
BEGIN

SELECT INTO _drep_id id FROM public.drep_hash WHERE raw = DECODE(credential, 'hex');
SELECT INTO _drep_id id FROM public.drep_hash WHERE raw = DECODE(_credential, 'hex');
IF _drep_id IS NULL THEN
SELECT INTO _spo_id id FROM public.pool_hash WHERE hash_raw = DECODE(credential, 'hex');
SELECT INTO _spo_id id FROM public.pool_hash WHERE hash_raw = DECODE(_credential, 'hex');
ELSIF _spo_id IS NULL THEN
SELECT INTO _committee_member_id id FROM public.committee_hash WHERE raw = DECODE(credential, 'hex');
SELECT INTO _committee_member_id id FROM public.committee_hash WHERE raw = DECODE(_credential, 'hex');
END IF;

SELECT INTO _gap_id_list ARRAY_AGG(gov_action_proposal_id)
Expand Down
33 changes: 33 additions & 0 deletions specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,29 @@ paths:
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/voter_proposal_list: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_credential"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Voter's Proposal List
description: List of all governance proposals for specified DRep, SPO or Committee credential
operationId: proposal_votes

/proposal_votes: #RPC
get:
tags:
Expand Down Expand Up @@ -2066,6 +2089,16 @@ components:
in: query
required: false
allowEmptyValue: true
_credential:
deprecated: false
name: _credential
description: Voter (Drep, SPO, Committee Member) in Hex format
schema:
type: string
example: "drep1s9qaseg7qyum807fcv0hdky9gv0c89tn98t4urjn5ewz57dml0r"
in: query
required: true
allowEmptyValue: false
_drep_id:
deprecated: false
name: _drep_id
Expand Down
33 changes: 33 additions & 0 deletions specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,29 @@ paths:
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/voter_proposal_list: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_credential"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Voter's Proposal List
description: List of all governance proposals for specified DRep, SPO or Committee credential
operationId: proposal_votes

/proposal_votes: #RPC
get:
tags:
Expand Down Expand Up @@ -2066,6 +2089,16 @@ components:
in: query
required: false
allowEmptyValue: true
_credential:
deprecated: false
name: _credential
description: Voter (Drep, SPO, Committee Member) in Hex format
schema:
type: string
example: "drep17l6sywnwqu9aedd6aumev42w39ln5zfl9nw7j4ak6u8swyrwvz3"
in: query
required: true
allowEmptyValue: false
_drep_id:
deprecated: false
name: _drep_id
Expand Down
33 changes: 33 additions & 0 deletions specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,29 @@ paths:
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/voter_proposal_list: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_credential"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Voter's Proposal List
description: List of all governance proposals for specified DRep, SPO or Committee credential
operationId: proposal_votes

/proposal_votes: #RPC
get:
tags:
Expand Down Expand Up @@ -2066,6 +2089,16 @@ components:
in: query
required: false
allowEmptyValue: true
_credential:
deprecated: false
name: _credential
description: Voter (Drep, SPO, Committee Member) in Hex format
schema:
type: string
example: "drep1kxtwaqtayj6vklc57u93xayjvkwgvefh8drscqp5a5y6jz7m6rd"
in: query
required: true
allowEmptyValue: false
_drep_id:
deprecated: false
name: _drep_id
Expand Down
33 changes: 33 additions & 0 deletions specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,29 @@ paths:
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/voter_proposal_list: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_credential"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Voter's Proposal List
description: List of all governance proposals for specified DRep, SPO or Committee credential
operationId: proposal_votes

/proposal_votes: #RPC
get:
tags:
Expand Down Expand Up @@ -2066,6 +2089,16 @@ components:
in: query
required: false
allowEmptyValue: true
_credential:
deprecated: false
name: _credential
description: Voter (Drep, SPO, Committee Member) in Hex format
schema:
type: string
example: "drep13a87lnegq9a90dq4z7n864h0fsxuqsvp5ywn29ud65l5cwxlhts"
in: query
required: true
allowEmptyValue: false
_drep_id:
deprecated: false
name: _drep_id
Expand Down
10 changes: 10 additions & 0 deletions specs/templates/2-api-params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ parameters:
in: query
required: false
allowEmptyValue: true
_credential:
deprecated: false
name: _credential
description: Voter (Drep, SPO, Committee Member) in Hex format
schema:
type: string
example: "##_drep_id_param##"
in: query
required: true
allowEmptyValue: false
_drep_id:
deprecated: false
name: _drep_id
Expand Down
23 changes: 23 additions & 0 deletions specs/templates/api-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,29 @@ paths:
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/voter_proposal_list: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_credential"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Voter's Proposal List
description: List of all governance proposals for specified DRep, SPO or Committee credential
operationId: proposal_votes

/proposal_votes: #RPC
get:
tags:
Expand Down

0 comments on commit 9768a67

Please sign in to comment.