Skip to content

Instantly share code, notes, and snippets.

@feuGeneA
Last active July 2, 2019 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feuGeneA/27c7f125b7a2075b0ea3161874e8aa43 to your computer and use it in GitHub Desktop.
Save feuGeneA/27c7f125b7a2075b0ea3161874e8aa43 to your computer and use it in GitHub Desktop.
abi-gen diff test failing on my local development. was prettier manually applied to checked-in copies? freshly generated copies seem unprettified. why doesn't CI experience this? wtf could be wrong?
2Jul12:24:16 [1 job] ~/dev/0x-monorepo/packages[development $%=]$ git checkout development
Already on 'development'
Your branch is up-to-date with 'origin/development'.
2Jul12:24:18 [1 job] ~/dev/0x-monorepo/packages/abi-gen[development $%=]$ git diff
2Jul12:24:21 [1 job] ~/dev/0x-monorepo/packages[development $%=]$ PKG=@0x/abi-gen yarn build
yarn run v1.13.0
$ lerna link && wsrun build $PKG --fast-exit -r --stages --exclude @0x/pipeline --exclude-missing
lerna notice cli v3.4.3
lerna info versioning independent
lerna info Symlinking packages and binaries
Warning: packages/devnet is a directory, but has no package.json
Warning: packages/pipeline is a directory, but has no package.json
Warning: packages/python-contract-wrappers is a directory, but has no package.json
Warning: packages/sol-cov is a directory, but has no package.json
Warning: packages/verdaccio is a directory, but has no package.json
Warning: contracts/examples is a directory, but has no package.json
Warning: contracts/interfaces is a directory, but has no package.json
Warning: contracts/libs is a directory, but has no package.json
Warning: contracts/protocol is a directory, but has no package.json
Warning: contracts/tec is a directory, but has no package.json
Warning: contracts/tokens is a directory, but has no package.json
@0x/tslint-config
$ tsc -b
ethereum-types
$ tsc -b
@0x/typescript-typings
$ tsc -b
@0x/types
$ tsc -b
@0x/utils
$ tsc -b
@0x/sol-resolver
$ tsc -b
@0x/contracts-gen
$ tsc -b
@0x/json-schemas
$ tsc -b
@0x/assert
$ tsc -b
@0x/web3-wrapper
$ tsc -b
@0x/base-contract
$ tsc -b
@0x/subproviders
$ tsc -b
@0x/dev-utils
$ tsc -b
@0x/sol-compiler
$ yarn pre_build && tsc -b
$ run-s update_contract_fixtures
$ copyfiles 'test/fixtures/contracts/**/*' ./lib
@0x/abi-gen
$ tsc -b && yarn build:test
$ run-s compile:sol generate_contract_wrappers
$ sol-compiler
$ abi-gen --abis ${npm_package_config_abis} --template node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output ./test/generated-test/generated-wrappers --backend ethers
| Found 7 partial templates
| Found 3 ABI files
| Processing: AbiGenDummy...
| Already up to date: packages/abi-gen/test/generated-test/generated-wrappers/abi_gen_dummy.ts
| Processing: LibDummy...
| Already up to date: packages/abi-gen/test/generated-test/generated-wrappers/lib_dummy.ts
| Processing: TestLibDummy...
| Already up to date: packages/abi-gen/test/generated-test/generated-wrappers/test_lib_dummy.ts
$ tsc --project packages/abi-gen/test/generated-test/tsconfig.json
Done in 17.50s.
2Jul12:24:45 [1 job] ~/dev/0x-monorepo/packages[development $%=]$ cd abi-gen
2Jul12:30:49 [1 job] ~/dev/0x-monorepo/packages/abi-gen[development $%=]$ yarn test:circleci
yarn run v1.13.0
$ yarn test:coverage
$ nyc npm run test --all && yarn coverage:report:lcov
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1562085056945-0.07747581737246878/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @0x/abi-gen@2.0.10 test /home/gene/dev/0x-monorepo/packages/abi-gen
> run-s run_mocha tmp_generate_contract_wrappers diff_contract_wrappers tmp_remove_contract_wrappers
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1562085056945-0.07747581737246878/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @0x/abi-gen@2.0.10 run_mocha /home/gene/dev/0x-monorepo/packages/abi-gen
> mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js test/generated-test/lib/**/*_test.js --timeout 100000 --bail --exit
Warning: Could not find any test files matching pattern: test/generated-test/lib/**/*_test.js
makeOutputFileName()
✓ should handle Metacoin usage
✓ should handle special zrx_token case
✓ should handle special erc_token case
writeOutputFile()
✓ should write content to output file
isOutputFileUpToDate()
✓ should throw ENOENT when there is no abi file
when the abi input file exists
without an existing output file
✓ should return false
with an existing output file
✓ should return true when output file is newer than abi file
✓ should return false when output file exists but is older than abi file
✓ should return false when any source file is newer than output file
9 passing (15ms)
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1562085056945-0.07747581737246878/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @0x/abi-gen@2.0.10 tmp_generate_contract_wrappers /home/gene/dev/0x-monorepo/packages/abi-gen
> abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output ./tmp/generated-wrappers --backend ethers
Found 7 partial templates
Found 3 ABI files
Processing: AbiGenDummy...
Already up to date: tmp/generated-wrappers/abi_gen_dummy.ts
Processing: LibDummy...
Already up to date: tmp/generated-wrappers/lib_dummy.ts
Processing: TestLibDummy...
Already up to date: tmp/generated-wrappers/test_lib_dummy.ts
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1562085056945-0.07747581737246878/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> @0x/abi-gen@2.0.10 diff_contract_wrappers /home/gene/dev/0x-monorepo/packages/abi-gen
> ./diff.sh ./tmp/generated-wrappers ./test/generated-test/generated-wrappers
diff ./tmp/generated-wrappers/abi_gen_dummy.ts ./test/generated-test/generated-wrappers/abi_gen_dummy.ts
26d25
<
31,36c30,31
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<void
< > {
---
> public simpleRequire = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
45c40
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
59,60c54
< const result = abiEncoder.strictDecodeReturnValue<void
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
64,69d57
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('simpleRequire()', []);
< return abiEncodedTransactionData;
< },
71c59
< public = {
---
> public ecrecoverFn = {
74c62
< v: number|BigNumber,
---
> v: number | BigNumber,
79,80c67
< ): Promise<string
< > {
---
> ): Promise<string> {
93,98c80,86
< const self = this as any as AbiGenDummyContract;
< const encodedData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [hash,
< v,
< r,
< s
< ]);
---
> const self = (this as any) as AbiGenDummyContract;
> const encodedData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [
> hash,
> v,
> r,
> s,
> ]);
111,112c99
< const result = abiEncoder.strictDecodeReturnValue<string
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
116,133d102
< getABIEncodedTransactionData(
< hash: string,
< v: number|BigNumber,
< r: string,
< s: string,
< ): string {
< assert.isString('hash', hash);
< assert.isNumberOrBigNumber('v', v);
< assert.isString('r', r);
< assert.isString('s', s);
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('ecrecoverFn(bytes32,uint8,bytes32,bytes32)', [hash,
< v,
< r,
< s
< ]);
< return abiEncodedTransactionData;
< },
135,140c104,105
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<void
< > {
---
> public revertWithConstant = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
149c114
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
163,164c128
< const result = abiEncoder.strictDecodeReturnValue<void
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
168,173d131
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('revertWithConstant()', []);
< return abiEncodedTransactionData;
< },
175,180c133,134
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<void
< > {
---
> public simpleRevert = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
189c143
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
203,204c157
< const result = abiEncoder.strictDecodeReturnValue<void
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
208,213d160
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('simpleRevert()', []);
< return abiEncodedTransactionData;
< },
215,220c162,163
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<void
< > {
---
> public requireWithConstant = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
229c172
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
243,244c186
< const result = abiEncoder.strictDecodeReturnValue<void
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
248,253d189
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('requireWithConstant()', []);
< return abiEncodedTransactionData;
< },
255,261c191,192
< public = {
< async callAsync(
< x: BigNumber,
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<BigNumber
< > {
---
> public simplePureFunctionWithInput = {
> async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
271,273c202,203
< const self = this as any as AbiGenDummyContract;
< const encodedData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x
< ]);
---
> const self = (this as any) as AbiGenDummyContract;
> const encodedData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x]);
286,287c216
< const result = abiEncoder.strictDecodeReturnValue<BigNumber
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
291,299d219
< getABIEncodedTransactionData(
< x: BigNumber,
< ): string {
< assert.isBigNumber('x', x);
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunctionWithInput(uint256)', [x
< ]);
< return abiEncodedTransactionData;
< },
301,306c221,222
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<BigNumber
< > {
---
> public simplePureFunction = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
315c231
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
329,330c245
< const result = abiEncoder.strictDecodeReturnValue<BigNumber
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
334,339d248
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('simplePureFunction()', []);
< return abiEncodedTransactionData;
< },
341,346c250,251
< public = {
< async callAsync(
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<BigNumber
< > {
---
> public pureFunctionWithConstant = {
> async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
355c260
< const self = this as any as AbiGenDummyContract;
---
> const self = (this as any) as AbiGenDummyContract;
369,370c274
< const result = abiEncoder.strictDecodeReturnValue<BigNumber
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
374,379d277
< getABIEncodedTransactionData(
< ): string {
< const self = this as any as AbiGenDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('pureFunctionWithConstant()', []);
< return abiEncodedTransactionData;
< },
397c295
< return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
---
> return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
413,417c311
< [] = BaseContract._formatABIDataItemList(
< constructorAbi.inputs,
< [],
< BaseContract._bigNumberToString,
< );
---
> [] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
423c317
< {data: txData},
---
> { data: txData },
431c325,330
< const contractInstance = new AbiGenDummyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
---
> const contractInstance = new AbiGenDummyContract(
> abi,
> txReceipt.contractAddress as string,
> provider,
> txDefaults,
> );
diff ./tmp/generated-wrappers/lib_dummy.ts ./test/generated-test/generated-wrappers/lib_dummy.ts
26d25
<
47c46
< return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
---
> return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
63,67c62
< [] = BaseContract._formatABIDataItemList(
< constructorAbi.inputs,
< [],
< BaseContract._bigNumberToString,
< );
---
> [] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
73c68
< {data: txData},
---
> { data: txData },
Common subdirectories: ./tmp/generated-wrappers/Python and ./test/generated-test/generated-wrappers/Python
diff ./tmp/generated-wrappers/test_lib_dummy.ts ./test/generated-test/generated-wrappers/test_lib_dummy.ts
26d25
<
31,37c30,31
< public = {
< async callAsync(
< x: BigNumber,
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<BigNumber
< > {
---
> public publicAddConstant = {
> async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
47,49c41,42
< const self = this as any as TestLibDummyContract;
< const encodedData = self._strictEncodeArguments('publicAddConstant(uint256)', [x
< ]);
---
> const self = (this as any) as TestLibDummyContract;
> const encodedData = self._strictEncodeArguments('publicAddConstant(uint256)', [x]);
62,63c55
< const result = abiEncoder.strictDecodeReturnValue<BigNumber
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
67,75d58
< getABIEncodedTransactionData(
< x: BigNumber,
< ): string {
< assert.isBigNumber('x', x);
< const self = this as any as TestLibDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('publicAddConstant(uint256)', [x
< ]);
< return abiEncodedTransactionData;
< },
77,83c60,61
< public = {
< async callAsync(
< x: BigNumber,
< callData: Partial<CallData> = {},
< defaultBlock?: BlockParam,
< ): Promise<BigNumber
< > {
---
> public publicAddOne = {
> async callAsync(x: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
93,95c71,72
< const self = this as any as TestLibDummyContract;
< const encodedData = self._strictEncodeArguments('publicAddOne(uint256)', [x
< ]);
---
> const self = (this as any) as TestLibDummyContract;
> const encodedData = self._strictEncodeArguments('publicAddOne(uint256)', [x]);
108,109c85
< const result = abiEncoder.strictDecodeReturnValue<BigNumber
< >(rawCallResult);
---
> const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
113,121d88
< getABIEncodedTransactionData(
< x: BigNumber,
< ): string {
< assert.isBigNumber('x', x);
< const self = this as any as TestLibDummyContract;
< const abiEncodedTransactionData = self._strictEncodeArguments('publicAddOne(uint256)', [x
< ]);
< return abiEncodedTransactionData;
< },
139c106
< return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, );
---
> return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
155,159c122
< [] = BaseContract._formatABIDataItemList(
< constructorAbi.inputs,
< [],
< BaseContract._bigNumberToString,
< );
---
> [] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
165c128
< {data: txData},
---
> { data: txData },
173c136,141
< const contractInstance = new TestLibDummyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
---
> const contractInstance = new TestLibDummyContract(
> abi,
> txReceipt.contractAddress as string,
> provider,
> txDefaults,
> );
ERROR: Run 'yarn generate_contract_wrappers' to update ./test/generated_test/generated-wrappers
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @0x/abi-gen@2.0.10 diff_contract_wrappers: `./diff.sh ./tmp/generated-wrappers ./test/generated-test/generated-wrappers`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @0x/abi-gen@2.0.10 diff_contract_wrappers script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/gene/.npm/_logs/2019-07-02T16_31_02_705Z-debug.log
ERROR: "diff_contract_wrappers" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @0x/abi-gen@2.0.10 test: `run-s run_mocha tmp_generate_contract_wrappers diff_contract_wrappers tmp_remove_contract_wrappers`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @0x/abi-gen@2.0.10 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/gene/.npm/_logs/2019-07-02T16_31_02_732Z-debug.log
----------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------------|----------|----------|----------|----------|-------------------|
All files | 63.9 | 25 | 71.79 | 65.28 | |
bin | 100 | 100 | 100 | 100 | |
abi-gen.js | 100 | 100 | 100 | 100 | |
src | 50.99 | 25 | 47.62 | 52.14 | |
index.ts | 63.01 | 37.5 | 16.67 | 64.71 |... 43,149,150,151 |
types.ts | 100 | 100 | 100 | 100 | |
utils.ts | 34.72 | 4.17 | 53.85 | 34.85 |... 05,120,124,150 |
test | 100 | 100 | 100 | 100 | |
utils_test.ts | 100 | 100 | 100 | 100 | |
----------------|----------|----------|----------|----------|-------------------|
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2Jul12:31:02 rc=1 [1 job] ~/dev/0x-monorepo/packages/abi-gen[development $%=]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment