Skip to content

Commit

Permalink
Merge pull request #40 from hyphacoop/v15-update
Browse files Browse the repository at this point in the history
V15 update
  • Loading branch information
dasanchez authored Apr 9, 2024
2 parents 0cbc640 + 2b7c45d commit 962a288
Show file tree
Hide file tree
Showing 6 changed files with 592 additions and 566 deletions.
29 changes: 23 additions & 6 deletions cosmos_genesis_tinker.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ def set_max_deposit_period(self, max_deposit_period: str = "1209600s"):
self.log_step(
"Swapping governance max deposit period to " + max_deposit_period)

deposit_params = self.gov["deposit_params"]
deposit_params["max_deposit_period"] = max_deposit_period
params = self.gov["params"]
params["max_deposit_period"] = max_deposit_period

return self

Expand All @@ -576,8 +576,8 @@ def set_min_deposit(self, min_amount: str = "64000000", denom: str = "uatom"):
self.log_step(
"Swapping min governance deposit amount to " + min_amount + denom)

deposit_params = self.gov['deposit_params']
min_deposit = deposit_params['min_deposit']
params = self.gov["params"]
min_deposit = params["min_deposit"]

has_found_deposit_denom = False

Expand All @@ -602,7 +602,7 @@ def set_tally_param(self, parameter_name: str, value: str):
self.log_step("Swapping tally parameter " +
parameter_name + " to " + value)

self.gov["tally_params"][parameter_name] = value
self.gov["params"][parameter_name] = value

return self

Expand All @@ -613,7 +613,7 @@ def set_voting_period(self, voting_period: str = "1209600s"):

self.log_step("Swapping governance voting period to " + voting_period)

self.gov["voting_params"]["voting_period"] = voting_period
self.gov["params"]["voting_period"] = voting_period

return self

Expand All @@ -638,6 +638,23 @@ def create_coin(self, denom: str, amount: str = '0'):
key=lambda x: x['denom'])
return self

def add_allowed_ibc_client(self, allowed_ibc_client: str):
"""
Add allowed IBC client
"""

self.log_step("Adding new allowed IBC client " + allowed_ibc_client)

clients = self.app_state["ibc"]["client_genesis"]["params"]["allowed_clients"]

for client in clients:
if client == allowed_ibc_client:
# Already exists, so we don't need to add it
return self

bisect.insort_right(clients, allowed_ibc_client, key=lambda x: x)
return self

def increase_supply(self, increase: int, denom="uatom"):
"""
Increase the total supply of coins of a given denomination
Expand Down
3 changes: 3 additions & 0 deletions example_mainnet_genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@
# gentink.add_task(gentink.set_unbonding_time,
# unbonding_time='1s')

gentink.add_task(gentink.add_allowed_ibc_client,
allowed_ibc_client='09-localhost')

gentink.run_tasks()
3 changes: 2 additions & 1 deletion example_release_testnet_genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
value='0.000000000000000001')
gentink.add_task(gentink.set_voting_period,
voting_period='60s')

gentink.add_task(gentink.add_allowed_ibc_client,
allowed_ibc_client='09-localhost')
gentink.run_tasks()
3 changes: 2 additions & 1 deletion example_rs_testnet_genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
value='0.000000000000000001')
gentink.add_task(gentink.set_voting_period,
voting_period='60s')

gentink.add_task(gentink.add_allowed_ibc_client,
allowed_ibc_client='09-localhost')
gentink.run_tasks()
Loading

0 comments on commit 962a288

Please sign in to comment.