question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Abi fails generation

See original GitHub issue

I have multiple abi files that successfully run through and get converted. However one file fails with a weird error:

example.json

[
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "unit",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "NewComet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "capacity",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "rate",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "NewStakingComet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "RemoveComet",
    "type": "event"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newStore",
        "type": "address"
      }
    ],
    "name": "updateSolarSystemStore",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "internalType": "int256",
        "name": "x",
        "type": "int256"
      },
      {
        "internalType": "int256",
        "name": "y",
        "type": "int256"
      },
      {
        "internalType": "uint32",
        "name": "distance",
        "type": "uint32"
      },
      {
        "internalType": "uint16",
        "name": "rotationSpeed",
        "type": "uint16"
      },
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "addComet",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "removeComet",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "time",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "cometPosition",
    "outputs": [
      {
        "components": [
          {
            "internalType": "int256",
            "name": "x",
            "type": "int256"
          },
          {
            "internalType": "int256",
            "name": "y",
            "type": "int256"
          }
        ],
        "internalType": "struct PositionsV2.Cartesian",
        "name": "",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "getComet",
    "outputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "id",
            "type": "address"
          },
          {
            "components": [
              {
                "components": [
                  {
                    "internalType": "int256",
                    "name": "x",
                    "type": "int256"
                  },
                  {
                    "internalType": "int256",
                    "name": "y",
                    "type": "int256"
                  }
                ],
                "internalType": "struct PositionsV2.Cartesian",
                "name": "center",
                "type": "tuple"
              },
              {
                "components": [
                  {
                    "internalType": "uint32",
                    "name": "distance",
                    "type": "uint32"
                  },
                  {
                    "internalType": "int128",
                    "name": "angle",
                    "type": "int128"
                  }
                ],
                "internalType": "struct PositionsV2.Polar",
                "name": "last",
                "type": "tuple"
              },
              {
                "internalType": "int32",
                "name": "rotationSpeed",
                "type": "int32"
              },
              {
                "internalType": "uint256",
                "name": "lastUpdate",
                "type": "uint256"
              }
            ],
            "internalType": "struct PositionsV2.Orbit",
            "name": "orbit",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "token",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "unit",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "balance",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "solarSystemID",
            "type": "uint256"
          }
        ],
        "internalType": "struct ICometManagerV4.Comet",
        "name": "",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "cometId",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "getStakingComet",
    "outputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "id",
            "type": "address"
          },
          {
            "components": [
              {
                "components": [
                  {
                    "internalType": "int256",
                    "name": "x",
                    "type": "int256"
                  },
                  {
                    "internalType": "int256",
                    "name": "y",
                    "type": "int256"
                  }
                ],
                "internalType": "struct PositionsV2.Cartesian",
                "name": "center",
                "type": "tuple"
              },
              {
                "components": [
                  {
                    "internalType": "uint32",
                    "name": "distance",
                    "type": "uint32"
                  },
                  {
                    "internalType": "int128",
                    "name": "angle",
                    "type": "int128"
                  }
                ],
                "internalType": "struct PositionsV2.Polar",
                "name": "last",
                "type": "tuple"
              },
              {
                "internalType": "int32",
                "name": "rotationSpeed",
                "type": "int32"
              },
              {
                "internalType": "uint256",
                "name": "lastUpdate",
                "type": "uint256"
              }
            ],
            "internalType": "struct PositionsV2.Orbit",
            "name": "orbit",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "token",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "balance",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "rate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "capacity",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "roverCount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "cumulatedRate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "collectable",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "lastUpdate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "solarSystemID",
            "type": "uint256"
          }
        ],
        "internalType": "struct ICometManagerV4.StakingComet",
        "name": "",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "cometsFrom",
    "outputs": [
      {
        "components": [
          {
            "internalType": "address",
            "name": "id",
            "type": "address"
          },
          {
            "components": [
              {
                "components": [
                  {
                    "internalType": "int256",
                    "name": "x",
                    "type": "int256"
                  },
                  {
                    "internalType": "int256",
                    "name": "y",
                    "type": "int256"
                  }
                ],
                "internalType": "struct PositionsV2.Cartesian",
                "name": "center",
                "type": "tuple"
              },
              {
                "components": [
                  {
                    "internalType": "uint32",
                    "name": "distance",
                    "type": "uint32"
                  },
                  {
                    "internalType": "int128",
                    "name": "angle",
                    "type": "int128"
                  }
                ],
                "internalType": "struct PositionsV2.Polar",
                "name": "last",
                "type": "tuple"
              },
              {
                "internalType": "int32",
                "name": "rotationSpeed",
                "type": "int32"
              },
              {
                "internalType": "uint256",
                "name": "lastUpdate",
                "type": "uint256"
              }
            ],
            "internalType": "struct PositionsV2.Orbit",
            "name": "orbit",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "token",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "unit",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "balance",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "solarSystemID",
            "type": "uint256"
          }
        ],
        "internalType": "struct ICometManagerV4.Comet[]",
        "name": "",
        "type": "tuple[]"
      },
      {
        "components": [
          {
            "internalType": "address",
            "name": "id",
            "type": "address"
          },
          {
            "components": [
              {
                "components": [
                  {
                    "internalType": "int256",
                    "name": "x",
                    "type": "int256"
                  },
                  {
                    "internalType": "int256",
                    "name": "y",
                    "type": "int256"
                  }
                ],
                "internalType": "struct PositionsV2.Cartesian",
                "name": "center",
                "type": "tuple"
              },
              {
                "components": [
                  {
                    "internalType": "uint32",
                    "name": "distance",
                    "type": "uint32"
                  },
                  {
                    "internalType": "int128",
                    "name": "angle",
                    "type": "int128"
                  }
                ],
                "internalType": "struct PositionsV2.Polar",
                "name": "last",
                "type": "tuple"
              },
              {
                "internalType": "int32",
                "name": "rotationSpeed",
                "type": "int32"
              },
              {
                "internalType": "uint256",
                "name": "lastUpdate",
                "type": "uint256"
              }
            ],
            "internalType": "struct PositionsV2.Orbit",
            "name": "orbit",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "token",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "balance",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "rate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "capacity",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "roverCount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "cumulatedRate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "collectable",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "lastUpdate",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "solarSystemID",
            "type": "uint256"
          }
        ],
        "internalType": "struct ICometManagerV4.StakingComet[]",
        "name": "",
        "type": "tuple[]"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "solarSystemID",
        "type": "uint256"
      }
    ],
    "name": "countCometIn",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

Error:

Property or signature expected. (77:696)
  75 |              topics?: string[]
  76 |          }
> 77 |          , callback?: (error: Error, event: EventData) => void): EventResponse; }export type CometManagerMethodNames = "updateSolarSystemStore" | "addComet" | "removeComet" | "cometPosition" | "getComet" | "getStakingComet" | "cometsFrom" | "countCometIn";export interface Response { x: string;y: string; }export interface Response { id: string;orbit: OrbitResponse;token: string;unit: string;balance: string;solarSystemID: string; }export interface Response { id: string;orbit: OrbitResponse;token: string;balance: string;rate: string;capacity: string;roverCount: string;cumulatedRate: string;collectable: string;lastUpdate: string;solarSystemID: string; }export interface CometsFromResponse { : Response[];: Response[]; }export interface CometManager {
     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
  78 |          /**
  79 |             * Payable: false
  80 |             * Constant: false

Your prettier options were not valid so falling back to default one.

Online parsers correctly identified the ABI. I think there is some kind of a parsing bug.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
joshstevens19commented, May 22, 2021

Ahhhh ok cool! Will look first thing Monday as away from computer until then. Thanks for raising this!!! Much appreciated. Will let you know once sorted! Won’t be long.

1reaction
joshstevens19commented, May 24, 2021

this was due to the new way of extracting the name out of internalType over name and in this case I only write it to handle stuff like struct PositionsV2.Orbit (aka with a full stop) which means this one struct Portal would end up being Struct Portal with a space meaning it broke the typescript compile.

This is now fixed in 1.1.6 and published do NPM.

Will close let me know if its working for you! Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fails generating types for ABI with a public mapping getter #29
Error When generating the TypeScript types for Decentraland's LAND Marketplace, the type generator fails to properly parse an empty input ...
Read more >
Java ABIs - Buck
Only single-type imports: On-demand imports (star imports) and static imports of types cannot be resolved at source-ABI generation time unless the rule ...
Read more >
xcode generator: Detecting C compiler ABI info fails on firmlink
The capability checks, which are run during the project() call, are failing: -- Detecting C compiler ABI info - failed -- Detecting CXX ......
Read more >
Understanding ABI Files | EOSIO Developer Docs
However, there are several situations that may cause ABI's generation to malfunction or fail altogether. Advanced C++ patterns can trip it up and...
Read more >
ABI Stability | Android Open Source Project
Application Binary Interface (ABI) stability is a prerequisite of framework-only updates because vendor modules may depend on the Vendor ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found