From 787545e1a7cab6658ee2d8aed6fa0caa6f10baf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Akkurt?= Date: Wed, 15 Jan 2025 16:48:13 +0600 Subject: [PATCH] feat(json-abi): add Param.name() accessor (#856) --- crates/json-abi/src/param.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/json-abi/src/param.rs b/crates/json-abi/src/param.rs index 7fb54858e..024ceed33 100644 --- a/crates/json-abi/src/param.rs +++ b/crates/json-abi/src/param.rs @@ -118,6 +118,13 @@ impl Param { Ok(Self { ty: ty.into(), name: name.into(), components, internal_type }) } + /// The name of the parameter. This function always returns either an empty + /// slice, or a valid Solidity identifier. + #[inline] + pub fn name(&self) -> &str { + &self.name + } + /// The internal type of the parameter. #[inline] pub const fn internal_type(&self) -> Option<&InternalType> {