From e7e7ebfae1af5ba79d4c0197c96c8b2e750a9c12 Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Mon, 25 Nov 2024 10:48:20 +0800 Subject: [PATCH] fix(internal): make ARC4Struct.name produce a name based only on alphanumeric characters only e.g. `A-Za-z0-9_` --- src/puya/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/puya/models.py b/src/puya/models.py index 0555f1e195..40faa8069c 100644 --- a/src/puya/models.py +++ b/src/puya/models.py @@ -1,5 +1,6 @@ import abc import enum +import re import typing from collections.abc import Mapping, Sequence @@ -62,7 +63,7 @@ class ARC4Struct: @property def name(self) -> str: - return self.fullname.rsplit(".", maxsplit=1)[-1] + return re.split(r"\W", self.fullname)[-1] @attrs.frozen(kw_only=True)