From 1086dc68401f7a966ae8758835e4c7e46457292a Mon Sep 17 00:00:00 2001 From: Khaled Grira <43654020+kakagri@users.noreply.github.com> Date: Sat, 24 Aug 2024 00:49:18 +0200 Subject: [PATCH] Fix: add prefix when generating abi name properties (#91) --- core/src/abi.rs | 6 +++++- documentation/docs/pages/docs/changelog.mdx | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/abi.rs b/core/src/abi.rs index 97c5edc4..d26ec7c5 100644 --- a/core/src/abi.rs +++ b/core/src/abi.rs @@ -87,10 +87,14 @@ impl ABIInput { .iter() .flat_map(|input| { if let Some(components) = &input.components { + let new_prefix = match prefix { + Some(p) => format!("{}_{}", p, camel_to_snake(&input.name)), + None => camel_to_snake(&input.name), + }; ABIInput::generate_abi_name_properties( components, properties_type, - Some(&camel_to_snake(&input.name)), + Some(&new_prefix), ) } else { match properties_type { diff --git a/documentation/docs/pages/docs/changelog.mdx b/documentation/docs/pages/docs/changelog.mdx index a18eafcf..c444a9de 100644 --- a/documentation/docs/pages/docs/changelog.mdx +++ b/documentation/docs/pages/docs/changelog.mdx @@ -8,6 +8,7 @@ ### Bug fixes ------------------------------------------------- +fix: Use the prefix when generating abi name properties. ### Breaking changes -------------------------------------------------