Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ContractFunctionParameters#addAddress(param) should accept param type of EvmAddress #1816

Closed
bguiz opened this issue Aug 23, 2023 · 1 comment · Fixed by #1819
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bguiz
Copy link
Member

bguiz commented Aug 23, 2023

Problem

ContractFunctionParameters#addAddress(param):

  • currently errors when you pass in param value of TransactionRecord#children[0]?.evmAddress (type @hashgraph/sdk/lib/EvmAddress.d.ts)
    • Error: address type requires parameter to be 40 or 42 characters
  • but it is OK with TransactionRecord#children[0]?.evmAddress.toString() (type string)

Solution

  • This method should accept both string and EvmAddress types as parameters
  • This is not a bug per se, rather I'd consider it a potential developer friction point

Alternatives

  • Nil
@petreze
Copy link
Contributor

petreze commented Aug 24, 2023

@bguiz
Thank you for your suggestion. I've added this possibility and also enhanced the ContractFunctionParameters.addAddressArray() method to also be able to handle EvmAddress as an input parameters!

@petreze petreze added this to the 2.33.0 milestone Aug 25, 2023
@petreze petreze self-assigned this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants