forked from informalsystems/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
relayer(cosmos): refactor cosmos-specific config validation
- Loading branch information
Showing
4 changed files
with
145 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use flex_error::define_error; | ||
use ibc_relayer_types::core::ics24_host::identifier::ChainId; | ||
use tendermint_light_client_verifier::types::TrustThreshold; | ||
|
||
define_error! { | ||
|
||
Error { | ||
InvalidTrustThreshold | ||
{ | ||
threshold: TrustThreshold, | ||
chain_id: ChainId, | ||
reason: String | ||
} | ||
|e| { | ||
format!("config file specifies an invalid `trust_threshold` ({0}) for the chain '{1}', caused by: {2}", | ||
e.threshold, e.chain_id, e.reason) | ||
}, | ||
|
||
DeprecatedGasAdjustment | ||
{ | ||
gas_adjustment: f64, | ||
gas_multiplier: f64, | ||
chain_id: ChainId, | ||
} | ||
|e| { | ||
format!( | ||
"config file specifies deprecated setting `gas_adjustment = {1}` for the chain '{0}'; \ | ||
to get the same behavior, use `gas_multiplier = {2}", | ||
e.chain_id, e.gas_adjustment, e.gas_multiplier | ||
) | ||
}, | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters