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

Outdated README.md & build fails #6

Open
smartcontracts opened this issue Feb 4, 2018 · 1 comment
Open

Outdated README.md & build fails #6

smartcontracts opened this issue Feb 4, 2018 · 1 comment

Comments

@smartcontracts
Copy link
Contributor

The current README.md directs users to build via npm build instead of npm run build. npm run build fails because of a few errors caught by the typescript compiler.

Expected Behavior

qtumjs should build correctly.

Current Behavior

qtumjs throws the following typescript compilation errors:

src/Contract.ts(230,11): error TS2564: Property '_logDecoder' has no initializer and is not definitely assigned in the constructor.
src/Contract.ts(250,31): error TS2565: Property '_useBigNumber' is used before being assigned.
src/QtumRPCRaw.ts(25,11): error TS2564: Property 'idNonce' has no initializer and is not definitely assigned in the constructor.

Possible Solution

_logDecoder

Instead of assigning contract._logDecoder as in the current codebase:

qtumjs/src/Contract.ts

Lines 246 to 248 in d36ade4

if (opts.logDecoder) {
this._logDecoder = opts.logDecoder
}

_logDecoder should probably be assigned as follows:

this._logDecoder = opts.logDecoder || new ContractLogDecoder(this.info.abi)

This also removes some unnecessary logic in get logDecoder().

_useBigNumber

_useBigNumber is set via

this._useBigNumber = this._useBigNumber || false

but this._useBigNumber will always be undefined so we might as well define it to

this._useBigNumber = false

idNonce

idNonce is never set in QtumRPCRaw

private idNonce: number

We should probably just initialize it to 0

this.idNonce = 0

Steps to Reproduce

  1. npm run build
@smartcontracts
Copy link
Contributor Author

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

Successfully merging a pull request may close this issue.

1 participant