Skip to content

Commit

Permalink
Fix IBC asset regex in denom metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
zbuc committed Sep 30, 2024
1 parent c0e4403 commit 143d97e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/core/asset/src/asset/denom_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ impl Metadata {
/// if this is an IBC transferred asset, `None` otherwise.
pub fn ibc_transfer_path(&self) -> anyhow::Result<Option<(String, String)>> {
let base_denom = self.base_denom().denom;
let re = Regex::new(r"^(?<path>transfer/channel-[0-9]+)/(?<denom>\w+)$")
// The base denom portion of an IBC asset path may contain slashes: https://github.com/cosmos/ibc/issues/737
let re = Regex::new(r"^(?<path>transfer/channel-[0-9]+)/(?<denom>[\w\/]+)$")
.context("error instantiating denom matching regex")?;

let Some(caps) = re.captures(&base_denom) else {
Expand Down

0 comments on commit 143d97e

Please sign in to comment.