Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

switch @0x/contract-wrappers to generated wrappers #2037

Merged
merged 5 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*.svg linguist-generated=true
packages/contract-artifacts/artifacts/*json linguist-generated=true
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️


1 change: 0 additions & 1 deletion contracts/dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this package wasn't using contract-wrappers

"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
Expand Down
1 change: 0 additions & 1 deletion contracts/exchange-forwarder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this package wasn't using contract-wrappers

"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
"devDependencies": {
"@0x/abi-gen": "^3.1.2",
"@0x/contract-wrappers": "^10.1.0",
"@0x/contract-wrappers": "10.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pinning the version to do a mass refactor later. Some packages will be complicated to refactor, and before publishing, we can't specify 11.0.0 in some packages and 10.1.0 in others. So for now all packages will still use 10.1.0.

"@0x/contracts-gen": "^1.0.12",
"@0x/contracts-test-utils": "^3.1.12",
"@0x/dev-utils": "^2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"config": {
"contractsPackages": "@0x/contracts-asset-proxy @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-extensions @0x/contracts-multisig @0x/contracts-test-utils @0x/contracts-utils @0x/contracts-coordinator @0x/contracts-dev-utils",
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper order-utils order-watcher sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will publish documentation later. Waiting for #2033. Tracking this in #1989

"ignoreDependencyVersions": "@types/styled-components @types/node",
"ignoreDependencyVersionsForPackage": "website instant dev-tools-pages"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/0x.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@0x/assert": "^2.1.2",
"@0x/asset-swapper": "^1.0.0",
"@0x/base-contract": "^5.3.0",
"@0x/contract-wrappers": "^10.1.0",
"@0x/contract-wrappers": "10.1.0",
"@0x/order-utils": "^8.2.4",
"@0x/order-watcher": "^4.0.16",
"@0x/subproviders": "^5.0.0",
Expand Down
10 changes: 7 additions & 3 deletions packages/0x.js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export {
} from '@0x/contract-wrappers';

export {
DutchAuctionContract,
ERC20ProxyContract,
ERC721ProxyContract,
ExchangeContract,
ForwarderContract,
OrderValidatorContract,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test:docs_generate complains if we don't include this

WETH9Contract,
WETH9Events,
WETH9WithdrawalEventArgs,
WETH9ApprovalEventArgs,
Expand Down Expand Up @@ -102,15 +109,12 @@ export {
ObjectMap,
OrderRelevantState,
Stats,
DutchAuctionDetails,
ZeroExTransaction,
SignedZeroExTransaction,
} from '@0x/types';

export {
BlockParamLiteral,
ContractAbi,
BlockParam,
LogWithDecodedArgs,
ContractEventArg,
SupportedProvider,
Expand Down
6 changes: 4 additions & 2 deletions packages/abi-gen-templates/contract.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ export class {{contractName}}Contract extends BaseContract {
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
if (Object.keys(logDecodeDependencies) !== undefined) {
for (const key of Object.keys(logDecodeDependencies)) {
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was throwing runtime errors.

}
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly, {{> params inputs=ctor.inputs}});
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading