pub trait TestOverrides {
    fn modify_test_config(&self, _config: &mut TestConfig) { ... }
    fn modify_node_config(&self, _config: &mut Value) -> Result<(), Error> { ... }
    fn modify_genesis_file(&self, _genesis: &mut Value) -> Result<(), Error> { ... }
    fn modify_relayer_config(&self, _config: &mut Config) { ... }
    fn client_options_a_to_b(&self) -> ClientOptions { ... }
    fn client_options_b_to_a(&self) -> ClientOptions { ... }
    fn should_spawn_supervisor(&self) -> bool { ... }
    fn connection_delay(&self) -> Duration { ... }
    fn channel_port_a(&self) -> PortId { ... }
    fn channel_port_b(&self) -> PortId { ... }
    fn channel_order(&self) -> Order { ... }
    fn channel_version(&self) -> Version { ... }
}
Expand description

This trait should be implemented for all test cases to allow overriding some parts of the behavior during the test setup.

Since all methods in this trait have default implementation, test cases that do not need any override can have an empty implementation body for this trait.

The trait provides generic implementation of the specialized traits such as RelayerConfigOverride. As a result, it is sufficient for test writers to only implement this trait instead of implementing the numerous override traits.

When a new override trait is defined, the same trait method should also be defined inside this trait with a default method body.

Provided Methods

Modify the full node config before the chain gets initialized.

The config is in the dynamic-typed toml::Value format, as we do not want to model the full format of the node config in Rust. Test authors can use the helper methods in chain::config to modify common config fields.

Implemented for NodeConfigOverride.

Modify the genesis file before the chain gets initialized.

The config is in the dynamic-typed serde_json::Value format, as we do not want to model the full format of the genesis file in Rust.

Implemented for NodeGenesisOverride.

Modify the relayer config before initializing the relayer. Does no modification by default.

Implemented for RelayerConfigOverride.

Returns the settings for the foreign client on the first chain for the second chain. The defaults are for a client connecting two Cosmos chains with no custom settings.

Returns the settings for the foreign client on the second chain for the first chain. The defaults are for a client connecting two Cosmos chains with no custom settings.

Return the connection delay used for creating connections as Duration. Defaults to zero.

Implemented for ConnectionDelayOverride.

Return the port ID used for creating the channel for the first chain. Returns the “transfer” port by default.

Implemented for PortsOverride.

Return the port ID used for creating the channel for the second chain. Returns the “transfer” port by default.

Implemented for PortsOverride.

Return the channel ordering used for creating channels as Order. Defaults to Order::Unordered.

Implemented for ChannelOrderOverride.

Return the channel version used for creating channels as Version. Defaults to Version::ics20().

Implemented for ChannelVersionOverride.

Implementors