Skip to content

Commit

Permalink
Public PrefixedDenom inner type and add as_str func for BaseDenom (#161)
Browse files Browse the repository at this point in the history
* add some function

* add getter function for BaseDenom

* remove ics20transfer from ics04Error and pub ics20 Amount inner typo

* revert pub Amount inner type

* Create 161-add-getter-function-of-prefixeddenom.md

* Public PrefixedDenom Inner type
  • Loading branch information
DaviRain-Su authored Oct 14, 2022
1 parent 19570aa commit 1a3fb55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit 1a3fb55

Please sign in to comment.