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

The return parameter of callContractMethod() is missing its name #862

Open
Jonas1024 opened this issue Aug 1, 2024 · 0 comments
Open

The return parameter of callContractMethod() is missing its name #862

Jonas1024 opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Jonas1024
Copy link

Jonas1024 commented Aug 1, 2024

What happened?

let abi = """
{
        "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }],
        "name": "getGISTProof",
        "outputs": [
          {
            "components": [
              { "internalType": "uint256", "name": "root", "type": "uint256" },
              { "internalType": "bool", "name": "existence", "type": "bool" },
              {
                "internalType": "uint256[64]",
                "name": "siblings",
                "type": "uint256[64]"
              },
              { "internalType": "uint256", "name": "index", "type": "uint256" },
              { "internalType": "uint256", "name": "value", "type": "uint256" },
              { "internalType": "bool", "name": "auxExistence", "type": "bool" },
              { "internalType": "uint256", "name": "auxIndex", "type": "uint256" },
              { "internalType": "uint256", "name": "auxValue", "type": "uint256" }
            ],
            "internalType": "structIState.GistProof",
            "name": "",
            "type": "tuple"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      }
"""

let contract = web3.contract(abi, at: receipt.contractAddress, abiVersion: 2)!
let tx = contract.createReadOperation("testStaticArray")
let result = try await tx!.callContractMethod()

result:

"[\"0\": [0, false, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],11111, 0, false, 0, 0]]"

What are the steps to reproduce?

.

What is the expected behavior?

The outputs should have its name.

What is the error thrown?

.

What's the stack trace said?

.

OS version

.

Library version

3.2.1

@Jonas1024 Jonas1024 added the bug Something isn't working label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant