Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public PrefixedDenom inner type and add as_str func for BaseDenom #161

Merged
merged 7 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Public PrefixedDenom inner type and add as_str func for BaseDenom ([#161](https://github.com/cosmos/ibc-
rs/issues/161))
10 changes: 8 additions & 2 deletions crates/ibc/src/applications/transfer/denom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ use crate::serializers::serde_string;
#[serde(transparent)]
pub struct BaseDenom(String);

impl BaseDenom {
pub fn as_str(&self) -> &str {
&self.0
}
}

impl FromStr for BaseDenom {
type Err = Error;

Expand Down Expand Up @@ -138,9 +144,9 @@ impl Display for TracePath {
pub struct PrefixedDenom {
/// A series of `{port-id}/{channel-id}`s for tracing the source of the token.
#[serde(with = "serde_string")]
trace_path: TracePath,
pub trace_path: TracePath,
/// Base denomination of the relayed fungible token.
base_denom: BaseDenom,
pub base_denom: BaseDenom,
}

impl PrefixedDenom {
Expand Down