Skip to content

Commit

Permalink
Fix delegation token regex to check boundaries (#3831)
Browse files Browse the repository at this point in the history
Closes #3827
  • Loading branch information
zbuc authored Feb 16, 2024
1 parent d08d8f2 commit 1fae79d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/core/component/stake/src/delegation_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl TryFrom<asset::Metadata> for DelegationToken {
// Note: this regex must be in sync with both asset::REGISTRY
// and VALIDATOR_IDENTITY_BECH32_PREFIX
let validator_identity =
Regex::new("udelegation_(?P<data>penumbravalid1[a-zA-HJ-NP-Z0-9]+)")
Regex::new("^udelegation_(?P<data>penumbravalid1[a-zA-HJ-NP-Z0-9]+)$")
.expect("regex is valid")
.captures(&base_denom.to_string())
.ok_or_else(|| {
Expand Down

0 comments on commit 1fae79d

Please sign in to comment.