-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow deserializing a trust threshold as a string or a struct
All these formats are allowed and equivalent: - trust_threshold = '2/3' - trust_threshold = { numerator = 2, denominator = 3 } - trust_threshold = { numerator = '2', denominator = '3' } (for backward compat)
- Loading branch information
Showing
13 changed files
with
160 additions
and
79 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
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
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
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 |
---|---|---|
@@ -1,34 +1,32 @@ | ||
use flex_error::define_error; | ||
use ibc_relayer_types::core::ics02_client::trust_threshold::TrustThreshold; | ||
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 | ||
) | ||
}, | ||
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
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
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