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

codegen AssertionError: ts type for sol type undefined for defaultOperators not found (ERC777) #302

Closed
zramsay opened this issue Jan 24, 2023 · 2 comments

Comments

@zramsay
Copy link
Contributor

zramsay commented Jan 24, 2023

similar to #301 (and same 'solution', to use mode: storage)

config:

# Contracts to watch (required).
contracts:
    # Contract name.
  - name: ERC777
    # Contract file path or an url.
    path: ../../openzeppelin-contracts/contracts/token/ERC777/ERC777.sol
    # Contract kind
    kind: ERC777

# Output folder path (logs output using `stdout` if not provided).
outputFolder: ../test-erc777-watcher

# Code generation mode [eth_call | storage | all | none] (default: none).
mode: all

# Kind of watcher [lazy | active] (default: active).
kind: active

# Watcher server port (default: 3008).
host: 0.0.0.0
port: 3009

# Flatten the input contract file(s) [true | false] (default: true).
flatten: true

error:

# yarn codegen --config-file config777.yaml 
yarn run v1.22.19
$ ts-node src/generate-code.ts --config-file config777.yaml
AssertionError [ERR_ASSERTION]: ts type for sol type undefined for defaultOperators not found
    at Schema.addQuery (/root/watcher-ts/packages/codegen/src/schema.ts:40:11)
    at Visitor.functionDefinitionVisitor (/root/watcher-ts/packages/codegen/src/visitor.ts:70:20)
    at visit (/root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:118:25)
    at /root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:109:29
    at Array.forEach (<anonymous>)
    at visit (/root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:109:10)
    at visit (/root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:126:7)
    at /root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:109:29
    at Array.forEach (<anonymous>)
    at visit (/root/watcher-ts/node_modules/@solidity-parser/parser/src/parser.ts:109:10) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

as with #301, mode: eth_call does not work but mode: storage does

@zramsay zramsay changed the title codegen AssertionError: ts type for sol type undefined for defaultOperators not found codegen AssertionError: ts type for sol type undefined for defaultOperators not found (ERC777) Jan 24, 2023
@nikugogoi
Copy link
Collaborator

The error is for parsing defaultOperators method in ERC777 contract.
It is returning an array type which is not handled in codegen yet.

@zramsay
Copy link
Contributor Author

zramsay commented Jan 27, 2023

tracked as a task in #39

@zramsay zramsay closed this as completed Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants