Skip to content

feat(transaction): add governance action deposit handling #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cardano_clusterlib/transaction_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def get_tx_deposit(self, tx_files: structs.TxFiles) -> int:
key_deposit = self._clusterlib_obj.g_query.get_address_deposit(pparams=pparams)
pool_deposit = self._clusterlib_obj.g_query.get_pool_deposit(pparams=pparams)
drep_deposit = self._clusterlib_obj.g_query.get_drep_deposit(pparams=pparams)
action_deposit = self._clusterlib_obj.g_query.get_gov_action_deposit(pparams=pparams)

deposit = 0

for cert in tx_files.certificate_files:
with open(cert, encoding="utf-8") as in_json:
content = json.load(in_json)
Expand All @@ -172,6 +174,13 @@ def get_tx_deposit(self, tx_files: structs.TxFiles) -> int:
elif "DRep Retirement" in description:
deposit -= drep_deposit

for prop in tx_files.proposal_files:
with open(prop, encoding="utf-8") as in_json:
content = json.load(in_json)
ptype = content.get("type", "")
if "Governance proposal" in ptype:
deposit += action_deposit

return deposit

def build_raw_tx_bare( # noqa: C901
Expand Down
Loading