116 Commits

Author SHA1 Message Date
F. Eugene Aumson
ead8099109
Auto-gen Python Exchange wrapper (#1919)
* Rename existing wrapper, to match contract name

* base contract: make member var public

* json_schemas.py: stop storing copies of schemas!

* .gitignore generated erc20_token.py wrapper

* json schemas: allow uppercase digits in address

* existing exchange wrapper: re-order methods

to match method order in Solidity contract, to reduce noise in upcoming
diffs of newly generated code vs. old manually-written code.

* existing exchange wrapper: rename method params

To match contract method param names

* existing exchange wrapper: remove redundant member

* existing exchange wrapper: make signatures bytes

Not strings.

* abi-gen/test-cli: show context on diff failure

* abi-gen-templates/Py: fix broken event interface

Previous changes had removed the `token_address` parameter from all
generated methods, but this instance was missed because there weren't
tests/examples using events for the first contract for which wrappers
were generated (ERC20Token).

* abi-gen: remove unused method parameters

* abi-gen: convert Py method params to snake case

* abi-gen: rewrite Python tuple handling

* python-generated-wrappers: include Exchange

* abi-gen-templates/Py: easy linter fixes

* abi-gen-templates/Py: satisfy docstring linters

* abi-gen-templates/Py: normalize bytes before use

* contract_wrappers.py: replace Exchange w/generated

* contract_wrappers.py: rm manually written Exchange

* contract_wrappers.py/doctest: rename variables

* abi-gen: fix misspelling in docstring

Co-Authored-By: Fabio B <me@fabioberger.com>

* Py docs: error on warning, and test build in CI

* abi-gen: doc Py bytes params as requiring UTF-8

* abi-gen: git mv diff.sh test-cli/

* abi-gen: put Py wrapper in module folder, not file

This leaves space for user-defined additions to the same module, such as
for custom types, as shown herein.

* abi-gen: customizable param validation for Python

* contract_wrappers.py: JSON schema Order validation

* CircleCI Build Artifacts

For abi-gen command-line test output, for generated Python contract
wrappers as output by abi-gen, for generated Python contract wrappers as
reformatted and included in the Python package area, and for the "build"
output folder in each Python package, which includes the generated
documentation.

* CHANGELOG updates for all components

* abi-gen: grammar in comments

Co-Authored-By: Fabio B <me@fabioberger.com>

* abi-gen: CHANGELOG spelling correction

Co-Authored-By: Fabio B <me@fabioberger.com>

* order_utils.py: reverse (chronological) CHANGELOG

* abi-gen-templates: reset CHANGELOG patch version

* CHANGELOGs: use multiple entries where appropriate

* abi-gen: enable devdoc solc output in test-cli

* abi-gen-templates/Py: consolidate return type

* abi-gen/test-cli: non-pure fixture contract method

Added a method to the "dummy" test fixture contract that isn't pure.
All of the other prior method cases were pure.

* abi-gen/Py: fix const methods missing return type

* abi-gen/Py: fix wrong return types on some methods

Specifically, wrapper methods wrapping contract methods that modify
contract state and return no return value.  There was no test case for
this.  Now there is.

* contract_wrappers.py: rm generated code in `clean`

* Parallelize Py monorepo scripts (test, lint, etc)
2019-07-23 12:58:18 -04:00
Xianny
7423028fea
Replace lodash with built-ins where possible to reduce bundle size (#1766)
* add tslint rule to disallow lodash.isUndefined

* add tslint rule to disallow lodash.isNull

* apply fixes
2019-04-10 09:36:32 -07:00
ochikov
6242e0aeec
Update constants.ts 2019-03-25 00:21:07 +02:00
ochikov
1328882ab6
Update constants.ts 2019-03-14 18:12:50 +02:00
Leonid Logvinov
0d0fcfe49a
Remove redundant logging from sol-compiler 2019-02-26 15:03:06 -08:00
Leonid Logvinov
8f64784781
Fix a bug when combining sol-compiler settings from different sources 2019-02-26 13:50:45 -08:00
Leonid Logvinov
9186af1433
Fix a PR number 2019-02-19 14:20:13 -08:00
Leonid Logvinov
1a3fd0227d
Implement sol-compiler offline mode 2019-02-19 10:35:52 -08:00
Leonid Logvinov
2b7699c26a
Omit remapping in compiler settings equality checks 2019-02-07 13:20:03 +01:00
Leonid Logvinov
d567c58d3b
Fix a bug when ast and legacyAST were not present in the artifacts even if requested 2019-02-07 13:10:08 +01:00
Leonid Logvinov
64d6dae672
Remove the bin_paths and fetch the solidity release list from github repo 2019-02-07 12:58:46 +01:00
Leonid Logvinov
c20285dd36
Fix the undefined opts bug 2019-02-07 12:30:54 +01:00
Leonid Logvinov
fd4d3cff88
Fix sol-compiler bug with remappings causing smart recompilation to now work 2019-02-07 12:13:24 +01:00
Leonid Logvinov
6943bbcacb
Temp 2019-02-04 10:38:02 +01:00
Leonid Logvinov
e1244648e0
Rename dependencyNameToPackagePath to dependencyNameToPath 2019-01-30 13:11:18 +01:00
Leonid Logvinov
8d72e253c8
Add a comment 2019-01-30 13:11:18 +01:00
Leonid Logvinov
33ed6a7c06
Remove + concatenation 2019-01-30 13:11:18 +01:00
Leonid Logvinov
c82a4a5760
Fail fast 2019-01-30 13:11:18 +01:00
Fabio B
445a629016
Update packages/sol-compiler/src/utils/compiler.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2019-01-30 13:08:10 +01:00
Leonid Logvinov
08f541535b
Fix naming 2019-01-28 17:37:15 +01:00
Leonid Logvinov
0c12128f64
Temp CI 2019-01-28 17:24:44 +01:00
Leonid Logvinov
e8d68dc07f
Implement docker as another backend for sol-compiler 2019-01-23 16:54:27 +01:00
Alex Browne
89e398fa39
Update prettier to version ^1.15.3 2019-01-10 17:41:13 -08:00
Leonid Logvinov
62b5eef4a0
Update sol-compiler binPaths to include the newest solidity 2019-01-09 12:36:05 +01:00
Fabio B
d456710441
Update packages/sol-compiler/src/compiler.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2018-12-19 15:57:30 +01:00
Fabio B
e886ef8c4b
Update packages/sol-compiler/src/utils/compiler.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2018-12-19 15:57:19 +01:00
Leonid Logvinov
86a9375d04
Run prettier 2018-12-19 15:41:49 +01:00
Leonid Logvinov
5656605355
Describe regexes 2018-12-19 15:41:49 +01:00
Leonid Logvinov
5c4a992b87
Add a NOTE comment 2018-12-19 15:41:49 +01:00
Leonid Logvinov
85be2fbf19
Move logWithTime to logUtils 2018-12-19 15:41:49 +01:00
Fabio B
69de1d05ef
Update packages/sol-compiler/src/compiler.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2018-12-19 15:41:49 +01:00
Leonid Logvinov
237014e823
Disable linter no a hanging promise with a comment 2018-12-19 15:41:49 +01:00
Leonid Logvinov
87d157b805
Move logWithTime function to utils 2018-12-19 15:41:49 +01:00
Leonid Logvinov
657b698e1e
Add sol-compiler watch mode 2018-12-19 15:41:48 +01:00
Leonid Logvinov
c5632490f2
Refactor most of the sol-compiler methods into helper functions in utils and make resolver pluggable into them 2018-12-19 15:41:48 +01:00
kao
f14603ca4d Implement prefer-template tslint rule 2018-12-07 17:06:52 -08:00
Fabio B
91397bf8a5
Update packages/sol-compiler/src/compiler.ts
Co-Authored-By: LogvinovLeon <logvinov.leon@gmail.com>
2018-12-03 13:34:55 +01:00
Leonid Logvinov
eefb1cfe5d
Fix an issue when we tried to append base contracts path to absolute imports (NPM) in sol-compiler 2018-12-03 12:09:28 +01:00
Jacob Evans
9f924e459c
chore: change package org from 0xproject to 0x 2018-10-18 22:27:31 +11:00
Fabio Berger
bdae4ba2a2 chore: tslint fix 2018-10-17 18:23:06 +01:00
Fabio Berger
87fabbb943 chore: Fix remaining necessary casts 2018-10-17 17:36:21 +01:00
F. Eugene Aumson
f614a2425f
fix: comment need for sourceCodes pruning 2018-10-03 10:57:37 -04:00
F. Eugene Aumson
39a336ca6d
fix: use original source ID's from compiler output
Previously, was generating fresh source ID's but per @LogvinovLeon 's
comment (cited below) that will likely break existing source code
mappings.

Changed to use the original source code mapping ID's that were generated
by the compiler

https://app.asana.com/0/684263176955174/842516551768097/f
https://github.com/0xProject/0x-monorepo/pull/1108
https://github.com/0xProject/0x-monorepo/pull/1108#pullrequestreview-161059063
2018-10-03 10:44:19 -04:00
Alex Browne
37c55302e7 Fix some small bugs in compiler.ts 2018-10-02 17:29:47 -07:00
F. Eugene Aumson
98c1952956
fix: persist artifacts with only relevant sources
https://github.com/0xProject/0x-monorepo/pull/1108
https://app.asana.com/0/684263176955174/842516551768097/f
2018-10-02 17:50:58 -04:00
Fabio Berger
c7e26cd448 Un-nest the interface to fix the doc rendering 2018-09-28 18:59:28 +01:00
F. Eugene Aumson
3e5d427d4e
feat: add sol-doc command-line interface
modified sol-compiler to output progress/warning/error/etc messages to
stderr rather than stdout, so that sol-doc can put its output (and
nothing else) to stdout.

for posterity, added sol-doc cli usage as npm scripts to package.json.
2018-09-22 10:14:49 -04:00
F. Eugene Aumson
6273339f7c add named references for returned objects 2018-08-30 10:43:43 -04:00
F. Eugene Aumson
29f2ae605e re-word comment: 'construction' -> 'instantiation' 2018-08-30 10:43:43 -04:00
F. Eugene Aumson
6450844d7f rename method _addHexPrefixes 2018-08-30 10:43:43 -04:00