48 Commits

Author SHA1 Message Date
Leonid Logvinov
ea12e34809
Ignore coverage of generated files 2018-07-09 12:07:42 +02:00
Leonid Logvinov
258fe8ea50
Render callAsync in templates even if it returns nothing 2018-07-09 11:13:21 +02:00
Leonid Logvinov
b21f6e4d86
Merge pull request #822 from 0xProject/v2-contract-wrappers-WIP
V2 contract wrappers
2018-07-06 12:10:55 +03:00
Jacob Evans
0557d6a9bf
Forwarding contract (squashed commits) 2018-07-06 15:30:07 +10:00
Leonid Logvinov
0c8264801a
Fix tests 2018-07-05 19:11:41 +02:00
Leonid Logvinov
f8772d8850
Rename {{*}}ContractEventArgs to {{*}}EventArgs and append {{contractName}} to each event name (ERC721TransferEventArgs instead of TransferContractEventArgs) 2018-06-29 17:52:51 +03:00
Greg Hysen
783ac3c105 Fixed callAsync template. Previously did not append callData, so we couldn’t specify from address 2018-06-20 13:54:39 -07:00
Fabio Berger
f3ae5d8160 Prettier fix 2018-06-19 13:46:39 +02:00
F. Eugene Aumson
8bac1706a1 change @0xproject/types to ethereum-types 2018-06-15 10:37:37 -04:00
F. Eugene Aumson
f9e05d0cad remove mistaken comment
It must have been left over from when an abi-gen output was modified to
be the source of this template.
2018-06-14 13:52:10 -04:00
F. Eugene Aumson
15a63c4bc5 workaround for TypeScript trailing comma bug
before this change, TypeScript compilation of the generated contract
wrapper was giving me the following errors:

$ abi-gen --abis 'build/contracts/*.json' --out build/types --template contract_templates/contract.handlebars --partials 'contract_templates/partials/*.handlebars'
Found 7 partial templates
Found 1 ABI files
Processing: Migrations...
Created: build/types/migrations.ts
$ tsc
build/types/migrations.ts(81,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(108,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(130,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(146,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(173,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(195,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is the generated code around the first error:

74:    public setCompleted = {
75:        async sendTransactionAsync(
76:            completed: BigNumber,
77:            txData: Partial<TxData> = {},
78:        ): Promise<string> {
79:            const self = this as any as MigrationsContract;
80:            const inputAbi = self._lookupAbi('setCompleted(uint256)').inputs;
81:            [completed,
82:    ] = BaseContract._formatABIDataItemList(inputAbi, [completed,
83:    ], BaseContract._bigNumberToString.bind(self));

All of the other errors are the same, a destructuring assignment with a
single element but with a trailing comma.

This is legal JavaScript but it is not allowed by the TypeScript
compiler, apparently per the bug described at
https://github.com/Microsoft/TypeScript/issues/24628 .

While awaiting the 3.0 version of TypeScript, it's a simple enough
change to have the template not append a trailing comma.
2018-06-14 13:51:18 -04:00
F. Eugene Aumson
4a2e4d2b55 Document contract_templates 2018-06-14 13:51:10 -04:00
fragosti
a97d77064a Get build and tests to pass 2018-06-06 15:26:40 -07:00
fragosti
58603e2a5a Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting 2018-06-06 11:17:13 -07:00
Leonid Logvinov
61d9e418e8
Fix linter issues in generated contract wrappers 2018-06-06 10:11:51 -07:00
Fabio Berger
cea81df969 Add missing import 2018-06-06 14:49:41 +02:00
Fabio Berger
f2ced67a8d Remove unused imports from contract handlebar template 2018-06-06 12:21:12 +02:00
Leonid Logvinov
b8a267370d
Fix linter errors 2018-05-31 11:04:06 -07:00
Leonid Logvinov
a7fc9caacb
Introduce ethereum-types package 2018-05-31 11:04:05 -07:00
Alex Browne
b05a3b7aed
Check transaction receipt status codes where applicable 2018-05-23 15:09:17 -07:00
Remco Bloemen
5cc2e8de7b Ignore classnames linter rule 2018-05-22 13:45:18 +02:00
Leonid Logvinov
c093aab350
Fix ganache subprovider config 2018-05-11 11:59:08 +02:00
Leonid Logvinov
2e1c2d9dfe
Fix templates 2018-05-10 17:56:57 +02:00
Leonid Logvinov
f854f3ee2b
Remove unused deployer docs configs 2018-05-10 17:47:38 +02:00
Leonid Logvinov
a5fea3b9c3
Add a check for compiler output 2018-05-10 17:47:38 +02:00
Leonid Logvinov
7eb9444458
Remove _applyDefaultsToDeployTxDataAsync 2018-05-10 17:47:38 +02:00
Leonid Logvinov
75d24dea0e
Fix linter issues 2018-05-10 17:47:38 +02:00
Leonid Logvinov
a6f72de09d
Rename deployer to sol-compiler 2018-05-10 17:47:38 +02:00
Leonid Logvinov
f9d80adaee
Remove deployer from 0x.js and migrations 2018-05-10 17:46:57 +02:00
Leonid Logvinov
3d58b38e4e
Remove deployer from metacoin and contract tests 2018-05-10 17:46:57 +02:00
Amir Bandeali
a10e466fed Fix getABIEncodedTransactionData in contract templates 2018-04-20 13:54:33 -07:00
Jacob Evans
72336eb393
Remove ethers-contracts types 2018-04-20 08:26:10 +10:00
Jacob Evans
5c232b6a8d
Update CHANGELOGs 2018-04-19 17:16:05 +10:00
Jacob Evans
12ae7c009d
Support Tuples from function returns 2018-04-19 11:21:32 +10:00
Greg Hysen
61fc3346c2 Updated deployer to accept a list of contract directories as input. Contract directories are namespaced to a void clashes. Also in this commit is a fix for overloading contract functions. 2018-04-09 17:22:58 -07:00
Leonid Logvinov
249bf0163d
Move our contract templates to accept Provider instead of Web3Wrapper 2018-04-04 11:56:32 +03:00
Leonid Logvinov
4d9029bb0e
Add metacoin example project 2018-04-02 12:34:29 +03:00
Leonid Logvinov
0b09cc36b0
Remove redundant cast 2018-03-28 10:26:56 +02:00
Leonid Logvinov
d72b7299c6
Move common types out of web3 types 2018-03-27 17:56:21 +02:00
Amir Bandeali
cb612360ca Transform input data before encoding for callAsync and getABIEncodedTransactionData 2018-03-13 20:41:07 -07:00
Fabio Berger
c797c720be Update all mentions of the repo name being 0x.js to 0x-monorepo 2018-03-03 19:11:09 +01:00
Leonid Logvinov
72e6e1ce8b
Move BaseContract to its own package 2018-02-27 17:51:31 -08:00
Leonid Logvinov
8fe844bcc9
Move BaseContract to web3Wrapper 2018-02-27 12:07:58 -08:00
Leonid Logvinov
ef40cb9687
Add txData to async calls 2018-02-27 12:07:06 -08:00
Leonid Logvinov
a5ef1db0c5
Rewrite templates to decode call data on transactions 2018-02-27 12:06:02 -08:00
Leonid Logvinov
2aec1501d0
Update template link 2018-02-27 12:06:02 -08:00
Leonid Logvinov
4e451479f8
Fix build 2018-02-27 12:05:46 -08:00
Leonid Logvinov
93b2736d65
Use the same templates as 0x.js 2018-02-27 12:05:46 -08:00