Skip to content

Commit

Permalink
feat(json-abi): add Param.name() accessor (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgrakkurt authored Jan 15, 2025
1 parent f2280a5 commit 787545e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/json-abi/src/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 787545e

Please sign in to comment.