Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message when deserializing an invalid chain config
Error messages when deserializing an invalid chain config have gotten a lot worse since #3787. For example, when mistyping the `gas_multiplier` field as `gas_multiplie` in the per-chain config: ``` data did not match any variant of untagged enum ChainConfig for key `chains` at line 424 column 1 ``` After this commit (same message as before #3787): ``` invalid CosmosSdk config: unknown field `gas_multiplie`, expected one of `id`, `rpc_addr`, `grpc_addr`, `event_source`, `rpc_timeout`, `trusted_node`, `account_prefix`, `key_name`, `key_store_type`, `key_store_folder`, `store_prefix`, `default_gas`, `max_gas`, `genesis_restart`, `gas_adjustment`, `gas_multiplier`, `fee_granter`, `max_msg_num`, `max_tx_size`, `max_grpc_decoding_size`, `query_packets_chunk_size`, `clock_drift`, `max_block_time`, `trusting_period`, `client_refresh_rate`, `ccv_consumer_chain`, `memo_prefix`, `sequential_batch_tx`, `proof_specs`, `trust_threshold`, `gas_price`, `packet_filter`, `address_type`, `extension_options`, `compat_mode`, `clear_interval` for key `chains` at line 424 column 1 ``` For this, we now use a custom deserializer for ChainConfig instead of relying on an untagged enum.
- Loading branch information