Skip to content

Commit

Permalink
Merge pull request #365 from mkoura/deposit_fix
Browse files Browse the repository at this point in the history
Make protocol params work with the new deposit keys
  • Loading branch information
mkoura committed Jan 27, 2021
2 parents 6319092 + 612c53f commit c53a6fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cardano_node_tests/utils/clusterlib.py
Expand Up @@ -934,11 +934,13 @@ def get_stake_addr_info(self, stake_addr: str) -> StakeAddrInfo:

def get_key_deposit(self) -> int:
"""Return key deposit amount."""
return int(self.get_protocol_params()["keyDeposit"])
pparams = self.get_protocol_params()
return int(pparams.get("keyDeposit") or pparams.get("stakeAddressDeposit") or 0)

def get_pool_deposit(self) -> int:
"""Return pool deposit amount."""
return int(self.get_protocol_params()["poolDeposit"])
pparams = self.get_protocol_params()
return int(pparams.get("poolDeposit") or pparams.get("stakePoolDeposit") or 0)

def get_stake_distribution(self) -> dict:
"""Return current aggregated stake distribution per stake pool."""
Expand Down Expand Up @@ -996,8 +998,8 @@ def get_tx_deposit(self, tx_files: TxFiles) -> int:
return 0

pparams = self.get_protocol_params()
key_deposit = pparams["keyDeposit"]
pool_deposit = pparams["poolDeposit"]
key_deposit = pparams.get("keyDeposit") or pparams.get("stakeAddressDeposit") or 0
pool_deposit = pparams.get("poolDeposit") or pparams.get("stakePoolDeposit") or 0

deposit = 0
for cert in tx_files.certificate_files:
Expand Down

0 comments on commit c53a6fd

Please sign in to comment.