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

type AbiInput fails on TS compliation #3307

Closed
vetri02 opened this issue Jan 11, 2020 · 3 comments
Closed

type AbiInput fails on TS compliation #3307

vetri02 opened this issue Jan 11, 2020 · 3 comments

Comments

@vetri02
Copy link

vetri02 commented Jan 11, 2020

Expected behavior

AbiItem should compile when using Typescript

Actual behavior

When compiling a typescript using ABI with web3-utils it fails.

Steps to reproduce the behavior

  1. Add web3-utils to ur typescript project
  2. When you define a ABI with type AbiItem and try to compile
  3. it throws the above error

Logs

error: [app] Application is crashed: TSError: ⨯ Unable to compile TypeScript:
src/config/constants/MakerConstants.ts:868:13 - error TS2322: Type '{ internalType: string; name: string; type: string; }' is not assignable to type 'AbiInput'.
Object literal may only specify known properties, and 'internalType' does not exist in type 'AbiInput'.

868 internalType: 'uint256',

####Possbile Solution
In web3-utils/types/index.d.ts

export interface AbiInput {
    name: string;
    type: string;
    indexed?: boolean;
    components?: AbiInput[];
}

add internalType?: string;

export interface AbiInput {
    name: string;
    type: string;
    indexed?: boolean;
    components?: AbiInput[];
    internalType?: string;
}

Versions

Node: v12.6.0
"web3-utils": "^1.2.4"

@nivida
Copy link
Contributor

nivida commented Jan 13, 2020

@vetri02 Thanks for opening this issue! We have already updated the related type definition and will release it asap. (PR: #3279)

@nivida nivida closed this as completed Jan 13, 2020
@vetri02
Copy link
Author

vetri02 commented Jan 13, 2020

@nivida Any ETA on the release.

@nivida
Copy link
Contributor

nivida commented Jan 14, 2020

@vetri02 We have planned an RC release of 1.2.5 on Thursday with a testing phase of a week before we publish 1.2.5 on the latest track.

Release Guidelines

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