From d30ff9724e31fc60ce6e3840f795db6cb1515cb2 Mon Sep 17 00:00:00 2001 From: ASoTNetworks Date: Fri, 1 Mar 2024 20:08:56 -0500 Subject: [PATCH] add allowed ibc client --- cosmos_genesis_tinker.py | 17 +++++++++++++++++ example_rs_testnet_genesis.py | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cosmos_genesis_tinker.py b/cosmos_genesis_tinker.py index e1e4311..22cb759 100755 --- a/cosmos_genesis_tinker.py +++ b/cosmos_genesis_tinker.py @@ -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 diff --git a/example_rs_testnet_genesis.py b/example_rs_testnet_genesis.py index 88b167d..5cbfe9a 100755 --- a/example_rs_testnet_genesis.py +++ b/example_rs_testnet_genesis.py @@ -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()