-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
tendermint::chain::Id
constants
In PeggyJV/ocular#18 we are trying to create a registry of "well-known" chain IDs. I proposed using `tendermint::chain::Id` for this, but to do so we'd need to have a const initializer support. This commit changes the internal representation of `chain::Id` to `Cow<'static, str>`. This permits a `const fn` initializer, but avoids adding a lifetime to `chain::Id` itself. It also adds `chain::Id::new` which is defined as a `const fn`, which can be used to define chain ID constants.
- Loading branch information
1 parent
e9e12ce
commit 50ec5ce
Showing
2 changed files
with
90 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- `[tendermint]` Add `tendermint::chain::Id::new` with support for chain ID constants | ||
([#1105](https://github.com/informalsystems/tendermint-rs/issues/1105)). |
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