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

Tuple input value is not parsed in "Write Contract" #1432

Closed
vbaranov opened this issue Dec 18, 2023 · 6 comments
Closed

Tuple input value is not parsed in "Write Contract" #1432

vbaranov opened this issue Dec 18, 2023 · 6 comments
Labels
bug Something isn't working triage Issues and PRs that are needed triage

Comments

@vbaranov
Copy link
Member

Description

image (13)
image (12)

Link to the page

https://eth-sepolia.blockscout.com/address/0x0174b6E70b51C739ADb0D6d6c50eA49789FB5028?tab=write_contract

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

App version

v1.20.0

Browser

No response

Operating system

None

Additional information

No response

@vbaranov vbaranov added bug Something isn't working triage Issues and PRs that are needed triage labels Dec 18, 2023
@tom2drum
Copy link
Collaborator

will be fixed as part of #1035

@tom2drum tom2drum closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@jaymod
Copy link

jaymod commented Jan 17, 2024

This issue is still present for nested tuples in builds after PR 1413.

Repro:

  1. Navigate to https://eth-sepolia.blockscout.com/address/0xc7F957c37193648D087E691016De9542273Be164?tab=contact_code but using a build containing the PR 1413 fix such as https://github.com/blockscout/frontend/pkgs/container/frontend/164130158.
  2. Note that the contract contains nested structs (tuples) in the input parameter to the updateFields function.
  3. With the changes from PR 1413, the top-level tuple fields are split into their own form fields which works great. Unfortunately, the nested tuple fields are not expanded and still suffer from the same input validation issue as is captured in this ticket.
Screenshot 2024-01-16 at 4 11 37 PM

Taking a look at the original input validation ticket (#1035), arrays are noted as being nestable but the requirement is missing for tuples.

@tom2drum
Copy link
Collaborator

Hi @jaymod. You're right, we don't support nested fields since it wasn't part of the initial task. However, we've implemented client-side validation for simple values, which should cover most use cases. For the nested structure, you can pass it as a string representation and the underlying library (viem) will handle the parsing.

@jaymod
Copy link

jaymod commented Jan 17, 2024

Thanks for the quick reply! Entering a string representation for nested structs works for our use case, but what is the expected format? I tried several variations and always received a Error: Cannot convert undefined to a Bigint error. I also could not find any details about the expected format in the documentation. Are you able to successfully write the nested field in the above contract?

@tom2drum
Copy link
Collaborator

Oh, yeah, there is a bug actually, causing it to malfunction currently. I have opened a new issue for it at #1512.

@jaymod
Copy link

jaymod commented Jan 17, 2024

Awesome thanks! That's what we're seeing as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issues and PRs that are needed triage
Projects
None yet
Development

No branches or pull requests

3 participants