diff --git a/cosmos_genesis_tinker.py b/cosmos_genesis_tinker.py index f952fda..22cb759 100755 --- a/cosmos_genesis_tinker.py +++ b/cosmos_genesis_tinker.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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_mainnet_genesis.py b/example_mainnet_genesis.py index a7bcff3..e875440 100755 --- a/example_mainnet_genesis.py +++ b/example_mainnet_genesis.py @@ -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() diff --git a/example_release_testnet_genesis.py b/example_release_testnet_genesis.py index bf4725f..fab0531 100755 --- a/example_release_testnet_genesis.py +++ b/example_release_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() 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() diff --git a/tests/fresh_genesis.json b/tests/fresh_genesis.json index 22cc16c..1b953cb 100644 --- a/tests/fresh_genesis.json +++ b/tests/fresh_genesis.json @@ -1,556 +1,560 @@ { -"app_hash": "", -"app_state": { -"auth": { -"accounts": [ -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "5", -"address": "cosmos1yl6hdjhmkf37639730gffanpzndzdpmhwlkfhr", -"pub_key": null, -"sequence": "0" -}, -"name": "transfer", -"permissions": [ -"minter", -"burner" -] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "1", -"address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", -"pub_key": null, -"sequence": "0" -}, -"name": "bonded_tokens_pool", -"permissions": [ -"burner", -"staking" -] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "2", -"address": "cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r", -"pub_key": null, -"sequence": "0" -}, -"name": "not_bonded_tokens_pool", -"permissions": [ -"burner", -"staking" -] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "3", -"address": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", -"pub_key": null, -"sequence": "0" -}, -"name": "gov", -"permissions": [ -"burner" -] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "0", -"address": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", -"pub_key": null, -"sequence": "0" -}, -"name": "distribution", -"permissions": [] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "4", -"address": "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q", -"pub_key": null, -"sequence": "0" -}, -"name": "mint", -"permissions": [ -"minter" -] -}, -{ -"@type": "/cosmos.auth.v1beta1.ModuleAccount", -"base_account": { -"account_number": "7", -"address": "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta", -"pub_key": null, -"sequence": "0" -}, -"name": "fee_collector", -"permissions": [] -}, -{ -"@type": "/cosmos.auth.v1beta1.BaseAccount", -"account_number": "6", -"address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", -"pub_key": { -"@type": "/cosmos.crypto.secp256k1.PubKey", -"key": "Aiu5OMUoNnBnWiWOC/Z/Luyq2XFROqubW5oP4Y8y/Lzz" -}, -"sequence": "1" -} -], -"params": { -"max_memo_characters": "256", -"sig_verify_cost_ed25519": "590", -"sig_verify_cost_secp256k1": "1000", -"tx_sig_limit": "7", -"tx_size_cost_per_byte": "10" -} -}, -"authz": { -"authorization": [] -}, -"bank": { -"balances": [ -{ -"address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", -"coins": [ -{ -"amount": "8000000000", -"denom": "stake" -} -] -}, -{ -"address": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", -"coins": [ -{ -"amount": "3895", -"denom": "stake" -} -] -}, -{ -"address": "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta", -"coins": [ -{ -"amount": "205", -"denom": "stake" -} -] -}, -{ -"address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", -"coins": [ -{ -"amount": "2000000000", -"denom": "stake" -}, -{ -"amount": "1000000000000", -"denom": "uatom" -} -] -} -], -"denom_metadata": [], -"params": { -"default_send_enabled": true, -"send_enabled": [] -}, -"supply": [ -{ -"amount": "10000004100", -"denom": "stake" -}, -{ -"amount": "1000000000000", -"denom": "uatom" -} -] -}, -"capability": { -"index": "3", -"owners": [ -{ -"index": "1", -"index_owners": { -"owners": [ -{ -"module": "ibc", -"name": "ports/transfer" -}, -{ -"module": "transfer", -"name": "ports/transfer" -} -] -} -}, -{ -"index": "2", -"index_owners": { -"owners": [ -{ -"module": "ibc", -"name": "ports/icahost" -}, -{ -"module": "icahost", -"name": "ports/icahost" -} -] -} -} -] -}, -"crisis": { -"constant_fee": { -"amount": "1000", -"denom": "stake" -} -}, -"distribution": { -"delegator_starting_infos": [ -{ -"delegator_address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", -"starting_info": { -"height": "0", -"previous_period": "1", -"stake": "8000000000.000000000000000000" -}, -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"delegator_withdraw_infos": [], -"fee_pool": { -"community_pool": [ -{ -"amount": "77.900000000000000000", -"denom": "stake" -} -] -}, -"outstanding_rewards": [ -{ -"outstanding_rewards": [ -{ -"amount": "3817.100000000000000000", -"denom": "stake" -} -], -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"params": { -"base_proposer_reward": "0.010000000000000000", -"bonus_proposer_reward": "0.040000000000000000", -"community_tax": "0.020000000000000000", -"withdraw_addr_enabled": true -}, -"previous_proposer": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", -"validator_accumulated_commissions": [ -{ -"accumulated": { -"commission": [ -{ -"amount": "381.710000000000000000", -"denom": "stake" -} -] -}, -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"validator_current_rewards": [ -{ -"rewards": { -"period": "2", -"rewards": [ -{ -"amount": "3435.390000000000000000", -"denom": "stake" -} -] -}, -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"validator_historical_rewards": [ -{ -"period": "1", -"rewards": { -"cumulative_reward_ratio": [], -"reference_count": 2 -}, -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"validator_slash_events": [] -}, -"evidence": { -"evidence": [] -}, -"feegrant": { -"allowances": [] -}, -"genutil": { -"gen_txs": [] -}, -"gov": { -"deposit_params": { -"max_deposit_period": "172800s", -"min_deposit": [ -{ -"amount": "10000000", -"denom": "stake" -} -] -}, -"deposits": [], -"proposals": [], -"starting_proposal_id": "1", -"tally_params": { -"quorum": "0.334000000000000000", -"threshold": "0.500000000000000000", -"veto_threshold": "0.334000000000000000" -}, -"votes": [], -"voting_params": { -"voting_period": "172800s" -} -}, -"ibc": { -"channel_genesis": { -"ack_sequences": [], -"acknowledgements": [], -"channels": [], -"commitments": [], -"next_channel_sequence": "0", -"receipts": [], -"recv_sequences": [], -"send_sequences": [] -}, -"client_genesis": { -"clients": [], -"clients_consensus": [], -"clients_metadata": [], -"create_localhost": false, -"next_client_sequence": "0", -"params": { -"allowed_clients": [ -"06-solomachine", -"07-tendermint" -] -} -}, -"connection_genesis": { -"client_connection_paths": [], -"connections": [], -"next_connection_sequence": "0", -"params": { -"max_expected_time_per_block": "30000000000" -} -} -}, -"interchainaccounts": { -"controller_genesis_state": { -"active_channels": [], -"interchain_accounts": [], -"params": { -"controller_enabled": true -}, -"ports": [] -}, -"host_genesis_state": { -"active_channels": [], -"interchain_accounts": [], -"params": { -"allow_messages": [], -"host_enabled": true -}, -"port": "icahost" -} -}, -"liquidity": { -"params": { -"circuit_breaker_enabled": false, -"init_pool_coin_mint_amount": "1000000", -"max_order_amount_ratio": "0.100000000000000000", -"max_reserve_coin_amount": "0", -"min_init_deposit_amount": "1000000", -"pool_creation_fee": [ -{ -"amount": "40000000", -"denom": "stake" -} -], -"pool_types": [ -{ -"description": "Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins", -"id": 1, -"max_reserve_coin_num": 2, -"min_reserve_coin_num": 2, -"name": "StandardLiquidityPool" -} -], -"swap_fee_rate": "0.003000000000000000", -"unit_batch_height": 1, -"withdraw_fee_rate": "0.000000000000000000" -}, -"pool_records": [] -}, -"mint": { -"minter": { -"annual_provisions": "1299999707.054103224369467225", -"inflation": "0.129999920070441455" -}, -"params": { -"blocks_per_year": "6311520", -"goal_bonded": "0.670000000000000000", -"inflation_max": "0.200000000000000000", -"inflation_min": "0.070000000000000000", -"inflation_rate_change": "0.130000000000000000", -"mint_denom": "stake" -} -}, -"packetfowardmiddleware": { -"params": { -"fee_percentage": "0.000000000000000000" -} -}, -"params": null, -"slashing": { -"missed_blocks": [ -{ -"address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", -"missed_blocks": [] -} -], -"params": { -"downtime_jail_duration": "600s", -"min_signed_per_window": "0.500000000000000000", -"signed_blocks_window": "100", -"slash_fraction_double_sign": "0.050000000000000000", -"slash_fraction_downtime": "0.010000000000000000" -}, -"signing_infos": [ -{ -"address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", -"validator_signing_info": { -"address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", -"index_offset": "19", -"jailed_until": "1970-01-01T00:00:00Z", -"missed_blocks_counter": "0", -"start_height": "0", -"tombstoned": false -} -} -] -}, -"staking": { -"delegations": [ -{ -"delegator_address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", -"shares": "8000000000.000000000000000000", -"validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" -} -], -"exported": true, -"last_total_power": "8000", -"last_validator_powers": [ -{ -"address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k", -"power": "8000" -} -], -"params": { -"bond_denom": "stake", -"historical_entries": 10000, -"max_entries": 7, -"max_validators": 100, -"unbonding_time": "1814400s" -}, -"redelegations": [], -"unbonding_delegations": [], -"validators": [ -{ -"commission": { -"commission_rates": { -"max_change_rate": "0.010000000000000000", -"max_rate": "0.200000000000000000", -"rate": "0.100000000000000000" -}, -"update_time": "2022-04-05T15:43:14.110731608Z" -}, -"consensus_pubkey": { -"@type": "/cosmos.crypto.ed25519.PubKey", -"key": "T6bqYkfRS1toJAFN8R34MByeuj1siCx0/0GdIgX8SmI=" -}, -"delegator_shares": "8000000000.000000000000000000", -"description": { -"details": "", -"identity": "", -"moniker": "root@138.197.144.103", -"security_contact": "", -"website": "" -}, -"jailed": false, -"min_self_delegation": "1", -"operator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k", -"status": "BOND_STATUS_BONDED", -"tokens": "8000000000", -"unbonding_height": "0", -"unbonding_time": "1970-01-01T00:00:00Z" -} -] -}, -"transfer": { -"denom_traces": [], -"params": { -"receive_enabled": true, -"send_enabled": true -}, -"port_id": "transfer" -}, -"upgrade": {}, -"vesting": {} -}, -"chain_id": "local-chain", -"consensus_params": { -"block": { -"max_bytes": "22020096", -"max_gas": "-1", -"time_iota_ms": "1000" -}, -"evidence": { -"max_age_duration": "172800000000000", -"max_age_num_blocks": "100000", -"max_bytes": "1048576" -}, -"validator": { -"pub_key_types": [ -"ed25519" -] -}, -"version": {} -}, -"genesis_time": "2022-04-05T15:43:14.110731608Z", -"initial_height": "21", -"validators": [ -{ -"address": "19CEF0E87C6FBDED2A2A486069C8F4DD51BD3981", -"name": "root@138.197.144.103", -"power": "8000", -"pub_key": { -"type": "tendermint/PubKeyEd25519", -"value": "T6bqYkfRS1toJAFN8R34MByeuj1siCx0/0GdIgX8SmI=" -} + "app_hash": "", + "app_state": { + "auth": { + "accounts": [ + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "5", + "address": "cosmos1yl6hdjhmkf37639730gffanpzndzdpmhwlkfhr", + "pub_key": null, + "sequence": "0" + }, + "name": "transfer", + "permissions": [ + "minter", + "burner" + ] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "1", + "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "pub_key": null, + "sequence": "0" + }, + "name": "bonded_tokens_pool", + "permissions": [ + "burner", + "staking" + ] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "2", + "address": "cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r", + "pub_key": null, + "sequence": "0" + }, + "name": "not_bonded_tokens_pool", + "permissions": [ + "burner", + "staking" + ] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "3", + "address": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + "pub_key": null, + "sequence": "0" + }, + "name": "gov", + "permissions": [ + "burner" + ] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "0", + "address": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", + "pub_key": null, + "sequence": "0" + }, + "name": "distribution", + "permissions": [] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "4", + "address": "cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q", + "pub_key": null, + "sequence": "0" + }, + "name": "mint", + "permissions": [ + "minter" + ] + }, + { + "@type": "/cosmos.auth.v1beta1.ModuleAccount", + "base_account": { + "account_number": "7", + "address": "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta", + "pub_key": null, + "sequence": "0" + }, + "name": "fee_collector", + "permissions": [] + }, + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "account_number": "6", + "address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", + "pub_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "Aiu5OMUoNnBnWiWOC/Z/Luyq2XFROqubW5oP4Y8y/Lzz" + }, + "sequence": "1" + } + ], + "params": { + "max_memo_characters": "256", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10" + } + }, + "authz": { + "authorization": [] + }, + "bank": { + "balances": [ + { + "address": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "coins": [ + { + "amount": "8000000000", + "denom": "stake" + } + ] + }, + { + "address": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", + "coins": [ + { + "amount": "3895", + "denom": "stake" + } + ] + }, + { + "address": "cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta", + "coins": [ + { + "amount": "205", + "denom": "stake" + } + ] + }, + { + "address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", + "coins": [ + { + "amount": "2000000000", + "denom": "stake" + }, + { + "amount": "1000000000000", + "denom": "uatom" + } + ] + } + ], + "denom_metadata": [], + "params": { + "default_send_enabled": true, + "send_enabled": [] + }, + "supply": [ + { + "amount": "10000004100", + "denom": "stake" + }, + { + "amount": "1000000000000", + "denom": "uatom" + } + ] + }, + "capability": { + "index": "3", + "owners": [ + { + "index": "1", + "index_owners": { + "owners": [ + { + "module": "ibc", + "name": "ports/transfer" + }, + { + "module": "transfer", + "name": "ports/transfer" + } + ] + } + }, + { + "index": "2", + "index_owners": { + "owners": [ + { + "module": "ibc", + "name": "ports/icahost" + }, + { + "module": "icahost", + "name": "ports/icahost" + } + ] + } + } + ] + }, + "crisis": { + "constant_fee": { + "amount": "1000", + "denom": "stake" + } + }, + "distribution": { + "delegator_starting_infos": [ + { + "delegator_address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", + "starting_info": { + "height": "0", + "previous_period": "1", + "stake": "8000000000.000000000000000000" + }, + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "delegator_withdraw_infos": [], + "fee_pool": { + "community_pool": [ + { + "amount": "77.900000000000000000", + "denom": "stake" + } + ] + }, + "outstanding_rewards": [ + { + "outstanding_rewards": [ + { + "amount": "3817.100000000000000000", + "denom": "stake" + } + ], + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "params": { + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "community_tax": "0.020000000000000000", + "withdraw_addr_enabled": true + }, + "previous_proposer": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", + "validator_accumulated_commissions": [ + { + "accumulated": { + "commission": [ + { + "amount": "381.710000000000000000", + "denom": "stake" + } + ] + }, + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "validator_current_rewards": [ + { + "rewards": { + "period": "2", + "rewards": [ + { + "amount": "3435.390000000000000000", + "denom": "stake" + } + ] + }, + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "validator_historical_rewards": [ + { + "period": "1", + "rewards": { + "cumulative_reward_ratio": [], + "reference_count": 2 + }, + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "feegrant": { + "allowances": [] + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": null, + "voting_params": null, + "tally_params": null, + "params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s", + "voting_period": "172800s", + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000", + "min_initial_deposit_ratio": "0.000000000000000000", + "burn_vote_quorum": false, + "burn_proposal_deposit_prevote": false, + "burn_vote_veto": true, + "min_deposit_ratio": "0.010000000000000000" + } + }, + "ibc": { + "channel_genesis": { + "ack_sequences": [], + "acknowledgements": [], + "channels": [], + "commitments": [], + "next_channel_sequence": "0", + "receipts": [], + "recv_sequences": [], + "send_sequences": [] + }, + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "create_localhost": false, + "next_client_sequence": "0", + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + } + }, + "connection_genesis": { + "client_connection_paths": [], + "connections": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "controller_enabled": true + }, + "ports": [] + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "params": { + "allow_messages": [], + "host_enabled": true + }, + "port": "icahost" + } + }, + "liquidity": { + "params": { + "circuit_breaker_enabled": false, + "init_pool_coin_mint_amount": "1000000", + "max_order_amount_ratio": "0.100000000000000000", + "max_reserve_coin_amount": "0", + "min_init_deposit_amount": "1000000", + "pool_creation_fee": [ + { + "amount": "40000000", + "denom": "stake" + } + ], + "pool_types": [ + { + "description": "Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins", + "id": 1, + "max_reserve_coin_num": 2, + "min_reserve_coin_num": 2, + "name": "StandardLiquidityPool" + } + ], + "swap_fee_rate": "0.003000000000000000", + "unit_batch_height": 1, + "withdraw_fee_rate": "0.000000000000000000" + }, + "pool_records": [] + }, + "mint": { + "minter": { + "annual_provisions": "1299999707.054103224369467225", + "inflation": "0.129999920070441455" + }, + "params": { + "blocks_per_year": "6311520", + "goal_bonded": "0.670000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "inflation_rate_change": "0.130000000000000000", + "mint_denom": "stake" + } + }, + "packetfowardmiddleware": { + "params": { + "fee_percentage": "0.000000000000000000" + } + }, + "params": null, + "slashing": { + "missed_blocks": [ + { + "address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", + "missed_blocks": [] + } + ], + "params": { + "downtime_jail_duration": "600s", + "min_signed_per_window": "0.500000000000000000", + "signed_blocks_window": "100", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": [ + { + "address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", + "validator_signing_info": { + "address": "cosmosvalcons1r880p6rud7776232fpsxnj85m4gm6wvpe2pkp2", + "index_offset": "19", + "jailed_until": "1970-01-01T00:00:00Z", + "missed_blocks_counter": "0", + "start_height": "0", + "tombstoned": false + } + } + ] + }, + "staking": { + "delegations": [ + { + "delegator_address": "cosmos1lj54q70v2mt9e7c5mtp5xgg5n9c0hkas60kec9", + "shares": "8000000000.000000000000000000", + "validator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k" + } + ], + "exported": true, + "last_total_power": "8000", + "last_validator_powers": [ + { + "address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k", + "power": "8000" + } + ], + "params": { + "bond_denom": "stake", + "historical_entries": 10000, + "max_entries": 7, + "max_validators": 100, + "unbonding_time": "1814400s" + }, + "redelegations": [], + "unbonding_delegations": [], + "validators": [ + { + "commission": { + "commission_rates": { + "max_change_rate": "0.010000000000000000", + "max_rate": "0.200000000000000000", + "rate": "0.100000000000000000" + }, + "update_time": "2022-04-05T15:43:14.110731608Z" + }, + "consensus_pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "T6bqYkfRS1toJAFN8R34MByeuj1siCx0/0GdIgX8SmI=" + }, + "delegator_shares": "8000000000.000000000000000000", + "description": { + "details": "", + "identity": "", + "moniker": "root@138.197.144.103", + "security_contact": "", + "website": "" + }, + "jailed": false, + "min_self_delegation": "1", + "operator_address": "cosmosvaloper1lj54q70v2mt9e7c5mtp5xgg5n9c0hkaslmzv5k", + "status": "BOND_STATUS_BONDED", + "tokens": "8000000000", + "unbonding_height": "0", + "unbonding_time": "1970-01-01T00:00:00Z" + } + ] + }, + "transfer": { + "denom_traces": [], + "params": { + "receive_enabled": true, + "send_enabled": true + }, + "port_id": "transfer" + }, + "upgrade": {}, + "vesting": {} + }, + "chain_id": "local-chain", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "-1", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_duration": "172800000000000", + "max_age_num_blocks": "100000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "genesis_time": "2022-04-05T15:43:14.110731608Z", + "initial_height": "21", + "validators": [ + { + "address": "19CEF0E87C6FBDED2A2A486069C8F4DD51BD3981", + "name": "root@138.197.144.103", + "power": "8000", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "T6bqYkfRS1toJAFN8R34MByeuj1siCx0/0GdIgX8SmI=" + } + } + ] } -] -} \ No newline at end of file diff --git a/tests/test_tinker.py b/tests/test_tinker.py index db78100..52a86fb 100644 --- a/tests/test_tinker.py +++ b/tests/test_tinker.py @@ -212,19 +212,19 @@ def test_governance_functions(input_data): # max_deposit_period with open(out_filename, 'r') as new_file: new_genesis = json.load(new_file) - assert new_genesis['app_state']['gov']['deposit_params']['max_deposit_period'] == new_time + assert new_genesis['app_state']['gov']['params']['max_deposit_period'] == new_time # min_deposit - min_deps = new_genesis['app_state']['gov']['deposit_params']['min_deposit'] + min_deps = new_genesis['app_state']['gov']['params']['min_deposit'] for deposit in min_deps: if deposit['denom'] == new_denom: assert deposit['amount'] == new_amount break # tally_param - tally_params = new_genesis['app_state']['gov']['tally_params'] + gov_params = new_genesis['app_state']['gov']['params'] for parameter in new_params: - assert tally_params[parameter['name']] == parameter['value'] + assert gov_params[parameter['name']] == parameter['value'] def test_create_coin(input_data):