Skip to content

Commit

Permalink
Add param_proposal data to proposal_list endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 committed Jul 31, 2024
1 parent 940cc77 commit e0a85a7
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 17 deletions.
32 changes: 20 additions & 12 deletions files/grest/rpc/governance/proposal_list.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ RETURNS TABLE (
meta_comment text,
meta_language text,
meta_is_valid boolean,
withdrawal jsonb
withdrawal jsonb,
param_proposal jsonb
)
LANGUAGE sql STABLE
AS $$
Expand All @@ -43,22 +44,29 @@ AS $$
ocvd.comment AS meta_comment,
ocvd.language AS meta_language,
ocvd.is_valid AS meta_is_valid,
CASE WHEN tw.id IS NULL THEN NULL
ELSE
JSONB_BUILD_OBJECT(
'stake_address', (
SELECT sa2.view
FROM stake_address AS sa2
WHERE sa2.id = tw.stake_address_id
),
'amount', tw.amount::text
)
END AS withdrawal
CASE
WHEN tw.id IS NULL THEN NULL
ELSE
JSONB_BUILD_OBJECT(
'stake_address', (
SELECT sa2.view
FROM stake_address AS sa2
WHERE sa2.id = tw.stake_address_id
),
'amount', tw.amount::text
)
END AS withdrawal,
CASE
WHEN pp.id IS NULL THEN NULL
ELSE ( SELECT ROW_TO_JSON(pp.*) )
END AS param_proposal
FROM public.gov_action_proposal AS gap
INNER JOIN public.tx ON gap.tx_id = tx.id
INNER JOIN public.block AS b ON tx.block_id = b.id
INNER JOIN public.stake_address AS sa ON gap.return_address = sa.id
LEFT JOIN public.treasury_withdrawal AS tw ON gap.id = tw.gov_action_proposal_id
LEFT JOIN public.param_proposal AS pp ON gap.param_proposal = pp.id
LEFT JOIN public.cost_model AS cm ON cm.id = pp.cost_model_id
LEFT JOIN public.voting_anchor AS va ON gap.voting_anchor_id = va.id
LEFT JOIN public.off_chain_vote_data AS ocvd ON va.id = ocvd.voting_anchor_id
ORDER BY
Expand Down
8 changes: 7 additions & 1 deletion specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5177,13 +5177,19 @@ components:
type:
- object
- 'null'
description: If not null, The amount withdrawn from treasury into stake address by this this proposal
description: If not null, the amount withdrawn from treasury into stake address by this this proposal
properties:
stake_address:
$ref: "#/components/schemas/account_history/items/properties/stake_address"
amount:
type: string
example: "31235800000"
param_proposal:
description: If not null, the proposed new parameter set
type:
- object
- 'null'
example: {"id": 15, "key": null, "entropy": null, "epoch_no": null, "influence": null, "max_epoch": null, "min_fee_a": null, "min_fee_b": null, "price_mem": null, "price_step": null, "key_deposit": 1000000, "max_bh_size": null, "max_tx_size": null, "drep_deposit": null, "max_val_size": null, "pool_deposit": null, "cost_model_id": null, "drep_activity": null, "max_tx_ex_mem": null, "min_pool_cost": null, "max_block_size": null, "min_utxo_value": null, "protocol_major": null, "protocol_minor": null, "max_tx_ex_steps": null, "decentralisation": null, "max_block_ex_mem": null, "registered_tx_id": 12270, "dvt_p_p_gov_group": null, "collateral_percent": null, "committee_min_size": null, "gov_action_deposit": null, "max_block_ex_steps": null, "optimal_pool_count": null, "coins_per_utxo_size": null, "gov_action_lifetime": null, "dvt_committee_normal": null, "monetary_expand_rate": null, "pvt_committee_normal": null, "pvtpp_security_group": null, "treasury_growth_rate": null, "dvt_p_p_network_group": null, "max_collateral_inputs": null, "dvt_p_p_economic_group": null, "dvt_p_p_technical_group": null, "dvt_treasury_withdrawal": null, "dvt_hard_fork_initiation": null, "dvt_motion_no_confidence": null, "pvt_hard_fork_initiation": null, "pvt_motion_no_confidence": null, "committee_max_term_length": null, "dvt_update_to_constitution": null, "dvt_committee_no_confidence": null, "pvt_committee_no_confidence": null, "min_fee_ref_script_cost_per_byte": null}
proposal_votes:
type: array
description: List of all votes cast on specified governance action
Expand Down
8 changes: 7 additions & 1 deletion specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5177,13 +5177,19 @@ components:
type:
- object
- 'null'
description: If not null, The amount withdrawn from treasury into stake address by this this proposal
description: If not null, the amount withdrawn from treasury into stake address by this this proposal
properties:
stake_address:
$ref: "#/components/schemas/account_history/items/properties/stake_address"
amount:
type: string
example: "31235800000"
param_proposal:
description: If not null, the proposed new parameter set
type:
- object
- 'null'
example: {"id": 15, "key": null, "entropy": null, "epoch_no": null, "influence": null, "max_epoch": null, "min_fee_a": null, "min_fee_b": null, "price_mem": null, "price_step": null, "key_deposit": 1000000, "max_bh_size": null, "max_tx_size": null, "drep_deposit": null, "max_val_size": null, "pool_deposit": null, "cost_model_id": null, "drep_activity": null, "max_tx_ex_mem": null, "min_pool_cost": null, "max_block_size": null, "min_utxo_value": null, "protocol_major": null, "protocol_minor": null, "max_tx_ex_steps": null, "decentralisation": null, "max_block_ex_mem": null, "registered_tx_id": 12270, "dvt_p_p_gov_group": null, "collateral_percent": null, "committee_min_size": null, "gov_action_deposit": null, "max_block_ex_steps": null, "optimal_pool_count": null, "coins_per_utxo_size": null, "gov_action_lifetime": null, "dvt_committee_normal": null, "monetary_expand_rate": null, "pvt_committee_normal": null, "pvtpp_security_group": null, "treasury_growth_rate": null, "dvt_p_p_network_group": null, "max_collateral_inputs": null, "dvt_p_p_economic_group": null, "dvt_p_p_technical_group": null, "dvt_treasury_withdrawal": null, "dvt_hard_fork_initiation": null, "dvt_motion_no_confidence": null, "pvt_hard_fork_initiation": null, "pvt_motion_no_confidence": null, "committee_max_term_length": null, "dvt_update_to_constitution": null, "dvt_committee_no_confidence": null, "pvt_committee_no_confidence": null, "min_fee_ref_script_cost_per_byte": null}
proposal_votes:
type: array
description: List of all votes cast on specified governance action
Expand Down
8 changes: 7 additions & 1 deletion specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5177,13 +5177,19 @@ components:
type:
- object
- 'null'
description: If not null, The amount withdrawn from treasury into stake address by this this proposal
description: If not null, the amount withdrawn from treasury into stake address by this this proposal
properties:
stake_address:
$ref: "#/components/schemas/account_history/items/properties/stake_address"
amount:
type: string
example: "31235800000"
param_proposal:
description: If not null, the proposed new parameter set
type:
- object
- 'null'
example: {"id": 15, "key": null, "entropy": null, "epoch_no": null, "influence": null, "max_epoch": null, "min_fee_a": null, "min_fee_b": null, "price_mem": null, "price_step": null, "key_deposit": 1000000, "max_bh_size": null, "max_tx_size": null, "drep_deposit": null, "max_val_size": null, "pool_deposit": null, "cost_model_id": null, "drep_activity": null, "max_tx_ex_mem": null, "min_pool_cost": null, "max_block_size": null, "min_utxo_value": null, "protocol_major": null, "protocol_minor": null, "max_tx_ex_steps": null, "decentralisation": null, "max_block_ex_mem": null, "registered_tx_id": 12270, "dvt_p_p_gov_group": null, "collateral_percent": null, "committee_min_size": null, "gov_action_deposit": null, "max_block_ex_steps": null, "optimal_pool_count": null, "coins_per_utxo_size": null, "gov_action_lifetime": null, "dvt_committee_normal": null, "monetary_expand_rate": null, "pvt_committee_normal": null, "pvtpp_security_group": null, "treasury_growth_rate": null, "dvt_p_p_network_group": null, "max_collateral_inputs": null, "dvt_p_p_economic_group": null, "dvt_p_p_technical_group": null, "dvt_treasury_withdrawal": null, "dvt_hard_fork_initiation": null, "dvt_motion_no_confidence": null, "pvt_hard_fork_initiation": null, "pvt_motion_no_confidence": null, "committee_max_term_length": null, "dvt_update_to_constitution": null, "dvt_committee_no_confidence": null, "pvt_committee_no_confidence": null, "min_fee_ref_script_cost_per_byte": null}
proposal_votes:
type: array
description: List of all votes cast on specified governance action
Expand Down
8 changes: 7 additions & 1 deletion specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5177,13 +5177,19 @@ components:
type:
- object
- 'null'
description: If not null, The amount withdrawn from treasury into stake address by this this proposal
description: If not null, the amount withdrawn from treasury into stake address by this this proposal
properties:
stake_address:
$ref: "#/components/schemas/account_history/items/properties/stake_address"
amount:
type: string
example: "31235800000"
param_proposal:
description: If not null, the proposed new parameter set
type:
- object
- 'null'
example: {"id": 15, "key": null, "entropy": null, "epoch_no": null, "influence": null, "max_epoch": null, "min_fee_a": null, "min_fee_b": null, "price_mem": null, "price_step": null, "key_deposit": 1000000, "max_bh_size": null, "max_tx_size": null, "drep_deposit": null, "max_val_size": null, "pool_deposit": null, "cost_model_id": null, "drep_activity": null, "max_tx_ex_mem": null, "min_pool_cost": null, "max_block_size": null, "min_utxo_value": null, "protocol_major": null, "protocol_minor": null, "max_tx_ex_steps": null, "decentralisation": null, "max_block_ex_mem": null, "registered_tx_id": 12270, "dvt_p_p_gov_group": null, "collateral_percent": null, "committee_min_size": null, "gov_action_deposit": null, "max_block_ex_steps": null, "optimal_pool_count": null, "coins_per_utxo_size": null, "gov_action_lifetime": null, "dvt_committee_normal": null, "monetary_expand_rate": null, "pvt_committee_normal": null, "pvtpp_security_group": null, "treasury_growth_rate": null, "dvt_p_p_network_group": null, "max_collateral_inputs": null, "dvt_p_p_economic_group": null, "dvt_p_p_technical_group": null, "dvt_treasury_withdrawal": null, "dvt_hard_fork_initiation": null, "dvt_motion_no_confidence": null, "pvt_hard_fork_initiation": null, "pvt_motion_no_confidence": null, "committee_max_term_length": null, "dvt_update_to_constitution": null, "dvt_committee_no_confidence": null, "pvt_committee_no_confidence": null, "min_fee_ref_script_cost_per_byte": null}
proposal_votes:
type: array
description: List of all votes cast on specified governance action
Expand Down
8 changes: 7 additions & 1 deletion specs/templates/4-api-schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2476,13 +2476,19 @@ schemas:
type:
- object
- 'null'
description: If not null, The amount withdrawn from treasury into stake address by this this proposal
description: If not null, the amount withdrawn from treasury into stake address by this this proposal
properties:
stake_address:
$ref: "#/components/schemas/account_history/items/properties/stake_address"
amount:
type: string
example: "31235800000"
param_proposal:
description: If not null, the proposed new parameter set
type:
- object
- 'null'
example: {"id": 15, "key": null, "entropy": null, "epoch_no": null, "influence": null, "max_epoch": null, "min_fee_a": null, "min_fee_b": null, "price_mem": null, "price_step": null, "key_deposit": 1000000, "max_bh_size": null, "max_tx_size": null, "drep_deposit": null, "max_val_size": null, "pool_deposit": null, "cost_model_id": null, "drep_activity": null, "max_tx_ex_mem": null, "min_pool_cost": null, "max_block_size": null, "min_utxo_value": null, "protocol_major": null, "protocol_minor": null, "max_tx_ex_steps": null, "decentralisation": null, "max_block_ex_mem": null, "registered_tx_id": 12270, "dvt_p_p_gov_group": null, "collateral_percent": null, "committee_min_size": null, "gov_action_deposit": null, "max_block_ex_steps": null, "optimal_pool_count": null, "coins_per_utxo_size": null, "gov_action_lifetime": null, "dvt_committee_normal": null, "monetary_expand_rate": null, "pvt_committee_normal": null, "pvtpp_security_group": null, "treasury_growth_rate": null, "dvt_p_p_network_group": null, "max_collateral_inputs": null, "dvt_p_p_economic_group": null, "dvt_p_p_technical_group": null, "dvt_treasury_withdrawal": null, "dvt_hard_fork_initiation": null, "dvt_motion_no_confidence": null, "pvt_hard_fork_initiation": null, "pvt_motion_no_confidence": null, "committee_max_term_length": null, "dvt_update_to_constitution": null, "dvt_committee_no_confidence": null, "pvt_committee_no_confidence": null, "min_fee_ref_script_cost_per_byte": null}
proposal_votes:
type: array
description: List of all votes cast on specified governance action
Expand Down

0 comments on commit e0a85a7

Please sign in to comment.