From 89429c54a7424eb6aa233047fa83fe595faa44d5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:33 +0100 Subject: Updated CHANGELOGS --- contracts/examples/CHANGELOG.json | 9 +++++++++ contracts/examples/CHANGELOG.md | 4 ++++ contracts/extensions/CHANGELOG.json | 9 +++++++++ contracts/extensions/CHANGELOG.md | 4 ++++ contracts/interfaces/CHANGELOG.json | 9 +++++++++ contracts/interfaces/CHANGELOG.md | 4 ++++ contracts/libs/CHANGELOG.json | 9 +++++++++ contracts/libs/CHANGELOG.md | 4 ++++ contracts/multisig/CHANGELOG.json | 9 +++++++++ contracts/multisig/CHANGELOG.md | 4 ++++ contracts/protocol/CHANGELOG.json | 9 +++++++++ contracts/protocol/CHANGELOG.md | 4 ++++ contracts/test-utils/CHANGELOG.json | 9 +++++++++ contracts/test-utils/CHANGELOG.md | 4 ++++ contracts/tokens/CHANGELOG.json | 9 +++++++++ contracts/tokens/CHANGELOG.md | 4 ++++ contracts/utils/CHANGELOG.json | 9 +++++++++ contracts/utils/CHANGELOG.md | 4 ++++ 18 files changed, 117 insertions(+) (limited to 'contracts') diff --git a/contracts/examples/CHANGELOG.json b/contracts/examples/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/examples/CHANGELOG.json +++ b/contracts/examples/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/examples/CHANGELOG.md b/contracts/examples/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/examples/CHANGELOG.md +++ b/contracts/examples/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/extensions/CHANGELOG.json b/contracts/extensions/CHANGELOG.json index de1ada0a8..c4aafdd44 100644 --- a/contracts/extensions/CHANGELOG.json +++ b/contracts/extensions/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "1.2.0", "changes": [ diff --git a/contracts/extensions/CHANGELOG.md b/contracts/extensions/CHANGELOG.md index 452cc8e82..00a7196c4 100644 --- a/contracts/extensions/CHANGELOG.md +++ b/contracts/extensions/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.2.1 - _January 11, 2019_ + + * Dependencies updated + ## v1.2.0 - _January 9, 2019_ * Added Dutch Auction Wrapper (#1465) diff --git a/contracts/interfaces/CHANGELOG.json b/contracts/interfaces/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/interfaces/CHANGELOG.json +++ b/contracts/interfaces/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/interfaces/CHANGELOG.md b/contracts/interfaces/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/interfaces/CHANGELOG.md +++ b/contracts/interfaces/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/libs/CHANGELOG.json b/contracts/libs/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/libs/CHANGELOG.json +++ b/contracts/libs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/libs/CHANGELOG.md b/contracts/libs/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/libs/CHANGELOG.md +++ b/contracts/libs/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/multisig/CHANGELOG.json b/contracts/multisig/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/multisig/CHANGELOG.json +++ b/contracts/multisig/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/multisig/CHANGELOG.md b/contracts/multisig/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/multisig/CHANGELOG.md +++ b/contracts/multisig/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/protocol/CHANGELOG.json b/contracts/protocol/CHANGELOG.json index 6672ce9c3..039f0f94a 100644 --- a/contracts/protocol/CHANGELOG.json +++ b/contracts/protocol/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "2.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.2.0", "changes": [ diff --git a/contracts/protocol/CHANGELOG.md b/contracts/protocol/CHANGELOG.md index a8ad921a2..75d4b9a5e 100644 --- a/contracts/protocol/CHANGELOG.md +++ b/contracts/protocol/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.2.1 - _January 11, 2019_ + + * Dependencies updated + ## v2.2.0 - _January 9, 2019_ * Added LibAddressArray (#1383) diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json index 8ba8d179a..13f076893 100644 --- a/contracts/test-utils/CHANGELOG.json +++ b/contracts/test-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/test-utils/CHANGELOG.md b/contracts/test-utils/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/test-utils/CHANGELOG.md +++ b/contracts/test-utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/tokens/CHANGELOG.json b/contracts/tokens/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/tokens/CHANGELOG.json +++ b/contracts/tokens/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/tokens/CHANGELOG.md b/contracts/tokens/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/tokens/CHANGELOG.md +++ b/contracts/tokens/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated diff --git a/contracts/utils/CHANGELOG.json b/contracts/utils/CHANGELOG.json index 50872eb07..7f3908990 100644 --- a/contracts/utils/CHANGELOG.json +++ b/contracts/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "1.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1547040760, "version": "1.0.3", diff --git a/contracts/utils/CHANGELOG.md b/contracts/utils/CHANGELOG.md index 4732f1746..6aa89cd76 100644 --- a/contracts/utils/CHANGELOG.md +++ b/contracts/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.4 - _January 11, 2019_ + + * Dependencies updated + ## v1.0.3 - _January 9, 2019_ * Dependencies updated -- cgit From cf3787edbb9e8acf7160ab93b903b54c63bdffda Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:43 +0100 Subject: Publish - 0x.js@3.0.1 - @0x/abi-gen@1.0.21 - @0x/abi-gen-wrappers@2.1.1 - @0x/assert@1.0.22 - @0x/asset-buyer@4.0.0 - @0x/base-contract@3.0.12 - @0x/connect@3.0.12 - @0x/contract-wrappers@4.2.1 - @0x/dev-tools-pages@0.0.12 - @0x/dev-utils@1.0.23 - ethereum-types@1.1.5 - @0x/fill-scenarios@1.1.1 - @0x/instant@1.0.6 - @0x/json-schemas@2.1.6 - @0x/metacoin@0.0.34 - @0x/migrations@2.3.1 - @0x/monorepo-scripts@1.0.17 - @0x/order-utils@3.1.1 - @0x/order-watcher@2.4.1 - @0x/pipeline@1.0.4 - @0x/react-docs@1.0.24 - @0x/react-shared@1.1.1 - @0x/sol-compiler@2.0.1 - @0x/sol-coverage@1.0.1 - @0x/sol-doc@1.0.13 - @0x/sol-profiler@1.0.1 - @0x/sol-resolver@1.2.2 - @0x/sol-trace@1.0.1 - @0x/sol-tracing-utils@3.0.0 - @0x/sra-spec@1.0.15 - @0x/subproviders@2.1.10 - @0x/testnet-faucets@1.0.62 - @0x/tslint-config@2.0.1 - @0x/types@1.5.1 - @0x/typescript-typings@3.0.7 - @0x/utils@3.0.0 - @0x/web3-wrapper@3.2.3 - @0x/website@0.0.65 - @0x/contracts-examples@1.0.4 - @0x/contracts-extensions@1.2.1 - @0x/contracts-interfaces@1.0.4 - @0x/contracts-libs@1.0.4 - @0x/contracts-multisig@1.0.4 - @0x/contracts-protocol@2.2.1 - @0x/contracts-test-utils@1.0.4 - @0x/contracts-tokens@1.0.4 - @0x/contracts-utils@1.0.4 --- contracts/examples/package.json | 38 ++++++++++++++++++------------------- contracts/extensions/package.json | 40 +++++++++++++++++++-------------------- contracts/interfaces/package.json | 24 +++++++++++------------ contracts/libs/package.json | 32 +++++++++++++++---------------- contracts/multisig/package.json | 28 +++++++++++++-------------- contracts/protocol/package.json | 40 +++++++++++++++++++-------------------- contracts/test-utils/package.json | 30 ++++++++++++++--------------- contracts/tokens/package.json | 36 +++++++++++++++++------------------ contracts/utils/package.json | 30 ++++++++++++++--------------- 9 files changed, 149 insertions(+), 149 deletions(-) (limited to 'contracts') diff --git a/contracts/examples/package.json b/contracts/examples/package.json index d04b5fc44..d1778f85f 100644 --- a/contracts/examples/package.json +++ b/contracts/examples/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-examples", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -33,12 +33,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/examples/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -58,20 +58,20 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-interfaces": "^1.0.3", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-multisig": "^1.0.3", - "@0x/contracts-tokens": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-interfaces": "^1.0.4", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-multisig": "^1.0.4", + "@0x/contracts-tokens": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 99b5b35a8..6e8c12631 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-extensions", - "version": "1.2.0", + "version": "1.2.1", "engines": { "node": ">=6.12" }, @@ -44,13 +44,13 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contract-wrappers": "^4.2.0", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contract-wrappers": "^4.2.1", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -70,20 +70,20 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-interfaces": "^1.0.3", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-protocol": "^2.2.0", - "@0x/contracts-tokens": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-interfaces": "^1.0.4", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-protocol": "^2.2.1", + "@0x/contracts-tokens": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 9017f0a73..8e3f67f67 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-interfaces", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -30,9 +30,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/interfaces/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/sol-compiler": "^2.0.0", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/sol-compiler": "^2.0.1", + "@0x/tslint-config": "^2.0.1", "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solhint": "^1.4.1", @@ -41,14 +41,14 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", - "ethereum-types": "^1.1.4", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", + "ethereum-types": "^1.1.5", "lodash": "^4.17.5" }, "publishConfig": { diff --git a/contracts/libs/package.json b/contracts/libs/package.json index 9d28cc038..5946faf74 100644 --- a/contracts/libs/package.json +++ b/contracts/libs/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-libs", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -44,12 +44,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -69,17 +69,17 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-multisig": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-multisig": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index e0bbc001d..030323cbf 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-multisig", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -44,12 +44,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/ethereumjs-abi": "^0.6.0", "@types/lodash": "4.14.104", @@ -69,13 +69,13 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", - "ethereum-types": "^1.1.4", + "@0x/base-contract": "^3.0.12", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", + "ethereum-types": "^1.1.5", "lodash": "^4.17.5" }, "publishConfig": { diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index 7d49dfbe8..daece8876 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-protocol", - "version": "2.2.0", + "version": "2.2.1", "engines": { "node": ">=6.12" }, @@ -44,11 +44,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -68,22 +68,22 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-examples": "^1.0.3", - "@0x/contracts-interfaces": "^1.0.3", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-multisig": "^1.0.3", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/contracts-tokens": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-examples": "^1.0.4", + "@0x/contracts-interfaces": "^1.0.4", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-multisig": "^1.0.4", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/contracts-tokens": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/test-utils/package.json b/contracts/test-utils/package.json index 2653fc0e4..bf3b23921 100644 --- a/contracts/test-utils/package.json +++ b/contracts/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-test-utils", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -40,19 +40,19 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/sol-coverage": "^1.0.0", - "@0x/sol-profiler": "^1.0.0", - "@0x/sol-trace": "^1.0.0", - "@0x/abi-gen": "^1.0.20", - "@0x/dev-utils": "^1.0.22", - "@0x/order-utils": "^3.1.0", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/abi-gen": "^1.0.21", + "@0x/dev-utils": "^1.0.23", + "@0x/order-utils": "^3.1.1", + "@0x/sol-compiler": "^2.0.1", + "@0x/sol-coverage": "^1.0.1", + "@0x/sol-profiler": "^1.0.1", + "@0x/sol-trace": "^1.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/bn.js": "^4.11.0", "@types/ethereumjs-abi": "^0.6.0", "@types/js-combinatorics": "^0.5.29", @@ -63,7 +63,7 @@ "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", "dirty-chai": "^2.0.1", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-abi": "0.6.5", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", diff --git a/contracts/tokens/package.json b/contracts/tokens/package.json index 31bf8f7cc..4601566e3 100644 --- a/contracts/tokens/package.json +++ b/contracts/tokens/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-tokens", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -44,12 +44,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -69,19 +69,19 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-interfaces": "^1.0.3", - "@0x/contracts-libs": "^1.0.3", - "@0x/contracts-multisig": "^1.0.3", - "@0x/contracts-utils": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-interfaces": "^1.0.4", + "@0x/contracts-libs": "^1.0.4", + "@0x/contracts-multisig": "^1.0.4", + "@0x/contracts-utils": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@types/js-combinatorics": "^0.5.29", "bn.js": "^4.11.8", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, diff --git a/contracts/utils/package.json b/contracts/utils/package.json index 732556f34..3745323ce 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-utils", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=6.12" }, @@ -44,12 +44,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md", "devDependencies": { - "@0x/abi-gen": "^1.0.20", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/dev-utils": "^1.0.22", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/abi-gen": "^1.0.21", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/dev-utils": "^1.0.23", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "@types/node": "*", @@ -70,14 +70,14 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/base-contract": "^3.0.11", - "@0x/contracts-multisig": "^1.0.3", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", - "ethereum-types": "^1.1.4", + "@0x/base-contract": "^3.0.12", + "@0x/contracts-multisig": "^1.0.4", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", + "ethereum-types": "^1.1.5", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.5" }, -- cgit From 943c378309a84ed142852c6584b53958df7817c8 Mon Sep 17 00:00:00 2001 From: Xianny <8582774+xianny@users.noreply.github.com> Date: Fri, 11 Jan 2019 10:04:30 -0800 Subject: Implement tslint enum-naming to enforce PascalCase on enum members (#1474) --- .../test/extensions/balance_threshold_filter.ts | 28 +++++++++++----------- .../extensions/test/extensions/order_validator.ts | 12 +++++----- contracts/protocol/test/exchange/core.ts | 20 ++++++++-------- contracts/protocol/test/exchange/wrapper.ts | 24 +++++++++---------- .../protocol/test/utils/match_order_tester.ts | 8 +++---- contracts/test-utils/CHANGELOG.json | 9 +++++++ contracts/test-utils/src/types.ts | 14 +++++------ 7 files changed, 62 insertions(+), 53 deletions(-) (limited to 'contracts') diff --git a/contracts/extensions/test/extensions/balance_threshold_filter.ts b/contracts/extensions/test/extensions/balance_threshold_filter.ts index 07199d60b..a1c322e08 100644 --- a/contracts/extensions/test/extensions/balance_threshold_filter.ts +++ b/contracts/extensions/test/extensions/balance_threshold_filter.ts @@ -1457,7 +1457,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( validSignedOrder, ); - expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); // Cancel const txReceipt = await erc721MakerBalanceThresholdWrapper.cancelOrderAsync( validSignedOrder, @@ -1470,7 +1470,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( validSignedOrder, ); - expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); }); it('Should successfully cancel order if maker does not meet balance threshold', async () => { // Create order where maker does not meet balance threshold @@ -1479,7 +1479,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync( signedOrderWithBadMakerAddress, ); - expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); // Cancel const txReceipt = await erc721NonValidBalanceThresholdWrapper.cancelOrderAsync( signedOrderWithBadMakerAddress, @@ -1492,7 +1492,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( signedOrderWithBadMakerAddress, ); - expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); }); }); @@ -1512,7 +1512,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); }); // Cancel const txReceipt = await erc721MakerBalanceThresholdWrapper.batchCancelOrdersAsync( @@ -1527,7 +1527,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); }); }); it('Should successfully batch cancel order if maker does not meet balance threshold', async () => { @@ -1542,7 +1542,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); }); // Cancel const txReceipt = await erc721NonValidBalanceThresholdWrapper.batchCancelOrdersAsync( @@ -1557,7 +1557,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoAfterCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); }); }); }); @@ -1578,7 +1578,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); }); // Cancel const cancelOrdersUpToThisSalt = new BigNumber(1); @@ -1596,9 +1596,9 @@ describe(ContractName.BalanceThresholdFilter, () => { ); const saltAsBigNumber = new BigNumber(salt); if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) { - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); } else { - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); } }); }); @@ -1614,7 +1614,7 @@ describe(ContractName.BalanceThresholdFilter, () => { const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync( signedOrder, ); - return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); }); // Cancel const cancelOrdersUpToThisSalt = new BigNumber(1); @@ -1632,9 +1632,9 @@ describe(ContractName.BalanceThresholdFilter, () => { ); const saltAsBigNumber = new BigNumber(salt); if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) { - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); } else { - return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE); + return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); } }); }); diff --git a/contracts/extensions/test/extensions/order_validator.ts b/contracts/extensions/test/extensions/order_validator.ts index 82a6b937f..7d8675f36 100644 --- a/contracts/extensions/test/extensions/order_validator.ts +++ b/contracts/extensions/test/extensions/order_validator.ts @@ -432,7 +432,7 @@ describe('OrderValidator', () => { takerAddress, ); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); expect(traderInfo.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT); @@ -485,7 +485,7 @@ describe('OrderValidator', () => { takerAddress, ); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); expect(traderInfo.makerBalance).to.be.bignumber.equal(makerBalance); @@ -514,10 +514,10 @@ describe('OrderValidator', () => { ] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers); const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder); const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2); - expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1); expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); - expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2); expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); expect(traderInfo1.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT); @@ -581,10 +581,10 @@ describe('OrderValidator', () => { ] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers); const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder); const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2); - expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1); expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); - expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable); expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2); expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT); expect(traderInfo1.makerBalance).to.be.bignumber.equal(makerBalance); diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index 42db8623d..700643b79 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1043,7 +1043,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1053,7 +1053,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1064,7 +1064,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1074,7 +1074,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1086,7 +1086,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1098,7 +1098,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1112,7 +1112,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = takerAssetFillAmount; - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1126,7 +1126,7 @@ describe('Exchange core', () => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; // FULLY_FILLED takes precedence over EXPIRED - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1136,7 +1136,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.INVALID_MAKER_ASSET_AMOUNT; + const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); @@ -1146,7 +1146,7 @@ describe('Exchange core', () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.INVALID_TAKER_ASSET_AMOUNT; + const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts index c9efb0c9d..4c4506945 100644 --- a/contracts/protocol/test/exchange/wrapper.ts +++ b/contracts/protocol/test/exchange/wrapper.ts @@ -1288,7 +1288,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1303,7 +1303,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.FILLABLE; + const expectedOrderStatus = OrderStatus.Fillable; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1317,7 +1317,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount; - const expectedOrderStatus = OrderStatus.FULLY_FILLED; + const expectedOrderStatus = OrderStatus.FullyFilled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1331,7 +1331,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1347,7 +1347,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.CANCELLED; + const expectedOrderStatus = OrderStatus.Cancelled; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1363,7 +1363,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1381,7 +1381,7 @@ describe('Exchange wrappers', () => { _.forEach(signedOrders, (signedOrder, index) => { const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2); - const expectedOrderStatus = OrderStatus.EXPIRED; + const expectedOrderStatus = OrderStatus.Expired; const orderInfo = ordersInfo[index]; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); @@ -1408,7 +1408,7 @@ describe('Exchange wrappers', () => { const expectedUnfilledOrderHash = orderHashUtils.getOrderHashHex(unfilledOrder); const expectedUnfilledTakerAssetFilledAmount = new BigNumber(0); - const expectedUnfilledOrderStatus = OrderStatus.FILLABLE; + const expectedUnfilledOrderStatus = OrderStatus.Fillable; const unfilledOrderInfo = ordersInfo[0]; expect(unfilledOrderInfo.orderHash).to.be.equal(expectedUnfilledOrderHash); expect(unfilledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1418,7 +1418,7 @@ describe('Exchange wrappers', () => { const expectedPartialOrderHash = orderHashUtils.getOrderHashHex(partiallyFilledOrder); const expectedPartialTakerAssetFilledAmount = partiallyFilledOrder.takerAssetAmount.div(2); - const expectedPartialOrderStatus = OrderStatus.FILLABLE; + const expectedPartialOrderStatus = OrderStatus.Fillable; const partialOrderInfo = ordersInfo[1]; expect(partialOrderInfo.orderHash).to.be.equal(expectedPartialOrderHash); expect(partialOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1428,7 +1428,7 @@ describe('Exchange wrappers', () => { const expectedFilledOrderHash = orderHashUtils.getOrderHashHex(fullyFilledOrder); const expectedFilledTakerAssetFilledAmount = fullyFilledOrder.takerAssetAmount; - const expectedFilledOrderStatus = OrderStatus.FULLY_FILLED; + const expectedFilledOrderStatus = OrderStatus.FullyFilled; const filledOrderInfo = ordersInfo[2]; expect(filledOrderInfo.orderHash).to.be.equal(expectedFilledOrderHash); expect(filledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1438,7 +1438,7 @@ describe('Exchange wrappers', () => { const expectedCancelledOrderHash = orderHashUtils.getOrderHashHex(cancelledOrder); const expectedCancelledTakerAssetFilledAmount = new BigNumber(0); - const expectedCancelledOrderStatus = OrderStatus.CANCELLED; + const expectedCancelledOrderStatus = OrderStatus.Cancelled; const cancelledOrderInfo = ordersInfo[3]; expect(cancelledOrderInfo.orderHash).to.be.equal(expectedCancelledOrderHash); expect(cancelledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( @@ -1448,7 +1448,7 @@ describe('Exchange wrappers', () => { const expectedExpiredOrderHash = orderHashUtils.getOrderHashHex(expiredOrder); const expectedExpiredTakerAssetFilledAmount = new BigNumber(0); - const expectedExpiredOrderStatus = OrderStatus.EXPIRED; + const expectedExpiredOrderStatus = OrderStatus.Expired; const expiredOrderInfo = ordersInfo[4]; expect(expiredOrderInfo.orderHash).to.be.equal(expectedExpiredOrderHash); expect(expiredOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal( diff --git a/contracts/protocol/test/utils/match_order_tester.ts b/contracts/protocol/test/utils/match_order_tester.ts index 8f574704e..31864820f 100644 --- a/contracts/protocol/test/utils/match_order_tester.ts +++ b/contracts/protocol/test/utils/match_order_tester.ts @@ -268,15 +268,15 @@ export class MatchOrderTester { const maxAmountBoughtByLeftMaker = signedOrderLeft.takerAssetAmount.minus(initialLeftOrderFilledAmount); const leftOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderLeft); const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.equals(maxAmountBoughtByLeftMaker) - ? OrderStatus.FULLY_FILLED - : OrderStatus.FILLABLE; + ? OrderStatus.FullyFilled + : OrderStatus.Fillable; expect(leftOrderInfo.orderStatus, 'Checking exchange status for left order').to.be.equal(leftExpectedStatus); // Assert right order status const maxAmountBoughtByRightMaker = signedOrderRight.takerAssetAmount.minus(initialRightOrderFilledAmount); const rightOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderRight); const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.equals(maxAmountBoughtByRightMaker) - ? OrderStatus.FULLY_FILLED - : OrderStatus.FILLABLE; + ? OrderStatus.FullyFilled + : OrderStatus.Fillable; expect(rightOrderInfo.orderStatus, 'Checking exchange status for right order').to.be.equal(rightExpectedStatus); } /// @dev Asserts account balances after matching orders. diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json index 13f076893..7bebd0fcb 100644 --- a/contracts/test-utils/CHANGELOG.json +++ b/contracts/test-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule", + "pr": 1474 + } + ] + }, { "timestamp": 1547225310, "version": "1.0.4", diff --git a/contracts/test-utils/src/types.ts b/contracts/test-utils/src/types.ts index 1630eab0d..60cb2b102 100644 --- a/contracts/test-utils/src/types.ts +++ b/contracts/test-utils/src/types.ts @@ -70,13 +70,13 @@ export interface Token { } export enum OrderStatus { - INVALID, - INVALID_MAKER_ASSET_AMOUNT, - INVALID_TAKER_ASSET_AMOUNT, - FILLABLE, - EXPIRED, - FULLY_FILLED, - CANCELLED, + Invalid, + InvalidMakerAssetAmount, + InvalidTakerAssetAmount, + Fillable, + Expired, + FullyFilled, + Cancelled, } export enum ContractName { -- cgit From 285fb3deadd0413bf993557575a3f96a840f0e10 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Mon, 17 Dec 2018 18:26:03 -0800 Subject: Progress --- contracts/protocol/test/asset_proxy/proxies.ts | 24 ++++++++++++++++++++++++ contracts/protocol/test/exchange/core.ts | 24 ++++++++++++------------ contracts/protocol/test/utils/erc721_wrapper.ts | 4 ++++ 3 files changed, 40 insertions(+), 12 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/asset_proxy/proxies.ts b/contracts/protocol/test/asset_proxy/proxies.ts index bbb44f402..b2e7f5afb 100644 --- a/contracts/protocol/test/asset_proxy/proxies.ts +++ b/contracts/protocol/test/asset_proxy/proxies.ts @@ -78,6 +78,7 @@ describe('Asset Transfer Proxies', () => { await blockchainLifecycle.revertAsync(); }); before(async () => { + console.log('1'); const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, notAuthorized, authorized, fromAddress, toAddress] = _.slice(accounts, 0, 5)); @@ -93,6 +94,7 @@ describe('Asset Transfer Proxies', () => { txDefaults, ); + console.log('2'); // Configure ERC20Proxy await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -100,6 +102,7 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('3'); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -107,6 +110,8 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('4'); + // Configure ERC721Proxy await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -114,6 +119,8 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + + console.log('5'); await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -121,6 +128,8 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('6'); + // Configure MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -128,12 +137,16 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); + + console.log('7'); await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, { from: owner, }), constants.AWAIT_TRANSACTION_MINED_MS, ); + + console.log('8'); await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, { from: owner, @@ -141,6 +154,8 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('9'); + // Deploy and configure ERC20 tokens const numDummyErc20ToDeploy = 2; [erc20TokenA, erc20TokenB] = await erc20Wrapper.deployDummyTokensAsync( @@ -166,11 +181,14 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); + console.log('10'); + await erc20Wrapper.setBalancesAndAllowancesAsync(); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('11'); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.approve.sendTransactionAsync( erc20Proxy.address, @@ -179,6 +197,7 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('12'); await web3Wrapper.awaitTransactionSuccessAsync( await multipleReturnErc20Token.setBalance.sendTransactionAsync( fromAddress, @@ -186,6 +205,7 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('13'); await web3Wrapper.awaitTransactionSuccessAsync( await multipleReturnErc20Token.approve.sendTransactionAsync( erc20Proxy.address, @@ -194,6 +214,7 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('14'); // Deploy and configure ERC721 tokens and receiver [erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync(); @@ -202,9 +223,12 @@ describe('Asset Transfer Proxies', () => { provider, txDefaults, ); + console.log('15'); await erc721Wrapper.setBalancesAndAllowancesAsync(); + console.log('16'); const erc721Balances = await erc721Wrapper.getBalancesAsync(); + console.log('17'); erc721AFromTokenId = erc721Balances[fromAddress][erc721TokenA.address][0]; erc721BFromTokenId = erc721Balances[fromAddress][erc721TokenB.address][0]; }); diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index 700643b79..6688f0fad 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1035,18 +1035,18 @@ describe('Exchange core', () => { }); }); - describe('getOrderInfo', () => { + describe.only('getOrderInfo', () => { beforeEach(async () => { signedOrder = await orderFactory.newSignedOrderAsync(); }); - it('should return the correct orderInfo for an unfilled valid order', async () => { + it.only('should return the correct orderInfo for an unfilled valid order', async () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1056,7 +1056,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1067,7 +1067,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and unfilled order', async () => { await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress); @@ -1077,7 +1077,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1089,7 +1089,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and unfilled order', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); @@ -1101,7 +1101,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1115,7 +1115,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1129,7 +1129,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a makerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetAmount: new BigNumber(0) }); @@ -1139,7 +1139,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a takerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ takerAssetAmount: new BigNumber(0) }); @@ -1149,7 +1149,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); }); }); }); diff --git a/contracts/protocol/test/utils/erc721_wrapper.ts b/contracts/protocol/test/utils/erc721_wrapper.ts index 1f658ce86..138fccf6f 100644 --- a/contracts/protocol/test/utils/erc721_wrapper.ts +++ b/contracts/protocol/test/utils/erc721_wrapper.ts @@ -102,12 +102,15 @@ export class ERC721Wrapper { public async approveAsync(to: string, tokenAddress: string, tokenId: BigNumber): Promise { const tokenContract = this._getTokenContractFromAssetData(tokenAddress); const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId); + console.log('a'); + console.log(to, ':', tokenId, ':', tokenOwner); await this._web3Wrapper.awaitTransactionSuccessAsync( await tokenContract.approve.sendTransactionAsync(to, tokenId, { from: tokenOwner, }), constants.AWAIT_TRANSACTION_MINED_MS, ); + console.log('b'); } public async transferFromAsync( tokenAddress: string, @@ -144,6 +147,7 @@ export class ERC721Wrapper { public async ownerOfAsync(tokenAddress: string, tokenId: BigNumber): Promise { const tokenContract = this._getTokenContractFromAssetData(tokenAddress); const owner = await tokenContract.ownerOf.callAsync(tokenId); + console.log(`OWNER OF = ${owner}`); return owner; } public async isOwnerAsync(userAddress: string, tokenAddress: string, tokenId: BigNumber): Promise { -- cgit From 2f1454e90e5fd7d85c4deb3a8c674043e8a14564 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 18 Dec 2018 21:44:26 -0800 Subject: Working for almost every test --- contracts/protocol/test/exchange/core.ts | 24 ++++++++++++------------ contracts/protocol/test/exchange/fill_order.ts | 2 +- contracts/protocol/test/exchange/internal.ts | 6 ++++-- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index 6688f0fad..ec0f41f85 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1035,18 +1035,18 @@ describe('Exchange core', () => { }); }); - describe.only('getOrderInfo', () => { + describe('getOrderInfo', () => { beforeEach(async () => { signedOrder = await orderFactory.newSignedOrderAsync(); }); - it.only('should return the correct orderInfo for an unfilled valid order', async () => { + it('should return the correct orderInfo for an unfilled valid order', async () => { const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder); const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder); const expectedTakerAssetFilledAmount = new BigNumber(0); const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1056,7 +1056,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1067,7 +1067,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and unfilled order', async () => { await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress); @@ -1077,7 +1077,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1089,7 +1089,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and unfilled order', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); @@ -1101,7 +1101,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1115,7 +1115,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1129,7 +1129,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a makerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetAmount: new BigNumber(0) }); @@ -1139,7 +1139,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a takerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ takerAssetAmount: new BigNumber(0) }); @@ -1149,7 +1149,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.bignumber.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); }); }); }); diff --git a/contracts/protocol/test/exchange/fill_order.ts b/contracts/protocol/test/exchange/fill_order.ts index 2bdbe4855..82f1dd9bf 100644 --- a/contracts/protocol/test/exchange/fill_order.ts +++ b/contracts/protocol/test/exchange/fill_order.ts @@ -51,7 +51,7 @@ const defaultFillScenario = { }, }; -describe('FillOrder Tests', () => { +describe.skip('FillOrder Tests', () => { let fillOrderCombinatorialUtils: FillOrderCombinatorialUtils; before(async () => { diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index 972f5efb6..225890f02 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -8,6 +8,7 @@ import { testCombinatoriallyWithReferenceFuncAsync, txDefaults, uint256Values, + orderUtils, web3Wrapper, } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; @@ -49,7 +50,7 @@ const emptySignedOrder: SignedOrder = { const overflowErrorForCall = new Error(RevertReason.Uint256Overflow); -describe('Exchange core internal functions', () => { +describe.skip('Exchange core internal functions', () => { let testExchange: TestExchangeInternalsContract; let overflowErrorForSendTransaction: Error | undefined; let divisionByZeroErrorForCall: Error | undefined; @@ -450,9 +451,10 @@ describe('Exchange core internal functions', () => { makerFeePaid: new BigNumber(0), takerFeePaid: new BigNumber(0), }; + //console.log(`EMPTY ORDER:\n ${JSON.stringify(emptySignedOrder, null ,4)}`); await web3Wrapper.awaitTransactionSuccessAsync( await testExchange.publicUpdateFilledState.sendTransactionAsync( - emptySignedOrder, + orderUtils.getOrderWithoutExchangeAddress(emptySignedOrder), constants.NULL_ADDRESS, orderHash, orderTakerAssetFilledAmount, -- cgit From e4551c8f6037302124cae4cda51b8f7624ade687 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 18 Dec 2018 22:01:48 -0800 Subject: Works for almost all tests --- contracts/protocol/test/asset_proxy/proxies.ts | 17 ----------------- contracts/protocol/test/exchange/internal.ts | 1 - contracts/protocol/test/utils/erc721_wrapper.ts | 4 ---- 3 files changed, 22 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/asset_proxy/proxies.ts b/contracts/protocol/test/asset_proxy/proxies.ts index b2e7f5afb..650594c12 100644 --- a/contracts/protocol/test/asset_proxy/proxies.ts +++ b/contracts/protocol/test/asset_proxy/proxies.ts @@ -78,7 +78,6 @@ describe('Asset Transfer Proxies', () => { await blockchainLifecycle.revertAsync(); }); before(async () => { - console.log('1'); const accounts = await web3Wrapper.getAvailableAddressesAsync(); const usedAddresses = ([owner, notAuthorized, authorized, fromAddress, toAddress] = _.slice(accounts, 0, 5)); @@ -94,7 +93,6 @@ describe('Asset Transfer Proxies', () => { txDefaults, ); - console.log('2'); // Configure ERC20Proxy await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -102,7 +100,6 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('3'); await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -110,7 +107,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('4'); // Configure ERC721Proxy await web3Wrapper.awaitTransactionSuccessAsync( @@ -120,7 +116,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('5'); await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -128,7 +123,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('6'); // Configure MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( @@ -138,7 +132,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('7'); await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, { from: owner, @@ -146,7 +139,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('8'); await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, { from: owner, @@ -154,7 +146,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('9'); // Deploy and configure ERC20 tokens const numDummyErc20ToDeploy = 2; @@ -181,14 +172,12 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); - console.log('10'); await erc20Wrapper.setBalancesAndAllowancesAsync(); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('11'); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.approve.sendTransactionAsync( erc20Proxy.address, @@ -197,7 +186,6 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('12'); await web3Wrapper.awaitTransactionSuccessAsync( await multipleReturnErc20Token.setBalance.sendTransactionAsync( fromAddress, @@ -205,7 +193,6 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('13'); await web3Wrapper.awaitTransactionSuccessAsync( await multipleReturnErc20Token.approve.sendTransactionAsync( erc20Proxy.address, @@ -214,7 +201,6 @@ describe('Asset Transfer Proxies', () => { ), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('14'); // Deploy and configure ERC721 tokens and receiver [erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync(); @@ -223,12 +209,9 @@ describe('Asset Transfer Proxies', () => { provider, txDefaults, ); - console.log('15'); await erc721Wrapper.setBalancesAndAllowancesAsync(); - console.log('16'); const erc721Balances = await erc721Wrapper.getBalancesAsync(); - console.log('17'); erc721AFromTokenId = erc721Balances[fromAddress][erc721TokenA.address][0]; erc721BFromTokenId = erc721Balances[fromAddress][erc721TokenB.address][0]; }); diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index 225890f02..ffe1f8a55 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -451,7 +451,6 @@ describe.skip('Exchange core internal functions', () => { makerFeePaid: new BigNumber(0), takerFeePaid: new BigNumber(0), }; - //console.log(`EMPTY ORDER:\n ${JSON.stringify(emptySignedOrder, null ,4)}`); await web3Wrapper.awaitTransactionSuccessAsync( await testExchange.publicUpdateFilledState.sendTransactionAsync( orderUtils.getOrderWithoutExchangeAddress(emptySignedOrder), diff --git a/contracts/protocol/test/utils/erc721_wrapper.ts b/contracts/protocol/test/utils/erc721_wrapper.ts index 138fccf6f..1f658ce86 100644 --- a/contracts/protocol/test/utils/erc721_wrapper.ts +++ b/contracts/protocol/test/utils/erc721_wrapper.ts @@ -102,15 +102,12 @@ export class ERC721Wrapper { public async approveAsync(to: string, tokenAddress: string, tokenId: BigNumber): Promise { const tokenContract = this._getTokenContractFromAssetData(tokenAddress); const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId); - console.log('a'); - console.log(to, ':', tokenId, ':', tokenOwner); await this._web3Wrapper.awaitTransactionSuccessAsync( await tokenContract.approve.sendTransactionAsync(to, tokenId, { from: tokenOwner, }), constants.AWAIT_TRANSACTION_MINED_MS, ); - console.log('b'); } public async transferFromAsync( tokenAddress: string, @@ -147,7 +144,6 @@ export class ERC721Wrapper { public async ownerOfAsync(tokenAddress: string, tokenId: BigNumber): Promise { const tokenContract = this._getTokenContractFromAssetData(tokenAddress); const owner = await tokenContract.ownerOf.callAsync(tokenId); - console.log(`OWNER OF = ${owner}`); return owner; } public async isOwnerAsync(userAddress: string, tokenAddress: string, tokenId: BigNumber): Promise { -- cgit From f8684d6a776724d0172c30126a7277885ed4e966 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 18 Dec 2018 22:37:36 -0800 Subject: All contract tests working with new abi encoder --- .../libs/contracts/test/TestLibs/TestLibs.sol | 26 ++++++++++++++++++++++ contracts/protocol/test/exchange/fill_order.ts | 2 +- contracts/protocol/test/exchange/internal.ts | 2 +- contracts/protocol/test/utils/exchange_wrapper.ts | 16 +++++++++++-- .../test/utils/fill_order_combinatorial_utils.ts | 7 +++--- 5 files changed, 46 insertions(+), 7 deletions(-) (limited to 'contracts') diff --git a/contracts/libs/contracts/test/TestLibs/TestLibs.sol b/contracts/libs/contracts/test/TestLibs/TestLibs.sol index bd5f9f9da..7a090adfb 100644 --- a/contracts/libs/contracts/test/TestLibs/TestLibs.sol +++ b/contracts/libs/contracts/test/TestLibs/TestLibs.sol @@ -48,6 +48,32 @@ contract TestLibs is return fillOrderCalldata; } + function publicAbiDecodeFillOrder( + bytes memory fillOrderCalldata + ) + public + pure + returns ( + Order memory order, + uint256 takerAssetFillAmount, + bytes memory signature + ) + { + ( + order, + takerAssetFillAmount, + signature + ) = abi.decode( + fillOrderCalldata, + "((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)" + ); + return ( + order, + takerAssetFillAmount, + signature + ); + } + function publicGetPartialAmountFloor( uint256 numerator, uint256 denominator, diff --git a/contracts/protocol/test/exchange/fill_order.ts b/contracts/protocol/test/exchange/fill_order.ts index 82f1dd9bf..2bdbe4855 100644 --- a/contracts/protocol/test/exchange/fill_order.ts +++ b/contracts/protocol/test/exchange/fill_order.ts @@ -51,7 +51,7 @@ const defaultFillScenario = { }, }; -describe.skip('FillOrder Tests', () => { +describe('FillOrder Tests', () => { let fillOrderCombinatorialUtils: FillOrderCombinatorialUtils; before(async () => { diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index ffe1f8a55..c65c477b2 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -50,7 +50,7 @@ const emptySignedOrder: SignedOrder = { const overflowErrorForCall = new Error(RevertReason.Uint256Overflow); -describe.skip('Exchange core internal functions', () => { +describe('Exchange core internal functions', () => { let testExchange: TestExchangeInternalsContract; let overflowErrorForSendTransaction: Error | undefined; let divisionByZeroErrorForCall: Error | undefined; diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index cb6dce901..28532f44b 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -7,10 +7,12 @@ import { SignedTransaction, } from '@0x/contracts-test-utils'; import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; -import { SignedOrder } from '@0x/types'; +import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; -import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import { AbiDefinition, MethodAbi ,Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import * as _ from 'lodash'; +import { AbiEncoder } from '@0x/utils'; import { ExchangeContract } from '../../generated-wrappers/exchange'; import { artifacts } from '../../src/artifacts'; @@ -275,6 +277,16 @@ export class ExchangeWrapper { ); return data; } + // @hysz -- TEMPORARY HACK @TODO remove + public abiDecodeFillOrder(data: string): {order: OrderWithoutExchangeAddress, takerAssetFillAmount: BigNumber, signature: string} { + let fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { + if ((value.type === 'function') && (value as MethodAbi).name === 'fillOrder') { + return true; + } + return false; + }) as MethodAbi; + return (new AbiEncoder.Method(fillOrderAbi)).decode(data) as {order: OrderWithoutExchangeAddress, takerAssetFillAmount: BigNumber, signature: string}; + } public getExchangeAddress(): string { return this._exchange.address; } diff --git a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts index 5d0ea07a8..df38bd59c 100644 --- a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts @@ -42,6 +42,7 @@ import { ExchangeWrapper } from './exchange_wrapper'; import { OrderFactoryFromScenario } from './order_factory_from_scenario'; import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher'; import { SimpleOrderFilledCancelledFetcher } from './simple_order_filled_cancelled_fetcher'; +import { Method } from '@0x/utils/lib/src/abi_encoder'; chaiSetup.configure(); const expect = chai.expect; @@ -613,13 +614,13 @@ export class FillOrderCombinatorialUtils { takerAssetFillAmount: BigNumber, ): Promise { const params = orderUtils.createFill(signedOrder, takerAssetFillAmount); - const expectedAbiEncodedData = this.exchangeWrapper.abiEncodeFillOrder(signedOrder, { takerAssetFillAmount }); - const libsAbiEncodedData = await this.testLibsContract.publicAbiEncodeFillOrder.callAsync( + const abiDataEncodedByContract = await this.testLibsContract.publicAbiEncodeFillOrder.callAsync( params.order, params.takerAssetFillAmount, params.signature, ); - expect(libsAbiEncodedData).to.be.equal(expectedAbiEncodedData, 'ABIEncodedFillOrderData'); + const paramsDecodeddByClient = this.exchangeWrapper.abiDecodeFillOrder(abiDataEncodedByContract); + expect(paramsDecodeddByClient).to.be.deep.equal(params, 'ABIEncodedFillOrderData'); } private async _getTakerAssetFillAmountAsync( signedOrder: SignedOrder, -- cgit From b06f8239e1fe75703f88d34c0d225701406e28c2 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sat, 22 Dec 2018 17:23:02 -0800 Subject: Finished porting new abi encoder to contracts --- .../libs/contracts/test/TestLibs/TestLibs.sol | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'contracts') diff --git a/contracts/libs/contracts/test/TestLibs/TestLibs.sol b/contracts/libs/contracts/test/TestLibs/TestLibs.sol index 7a090adfb..bd5f9f9da 100644 --- a/contracts/libs/contracts/test/TestLibs/TestLibs.sol +++ b/contracts/libs/contracts/test/TestLibs/TestLibs.sol @@ -48,32 +48,6 @@ contract TestLibs is return fillOrderCalldata; } - function publicAbiDecodeFillOrder( - bytes memory fillOrderCalldata - ) - public - pure - returns ( - Order memory order, - uint256 takerAssetFillAmount, - bytes memory signature - ) - { - ( - order, - takerAssetFillAmount, - signature - ) = abi.decode( - fillOrderCalldata, - "((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)" - ); - return ( - order, - takerAssetFillAmount, - signature - ); - } - function publicGetPartialAmountFloor( uint256 numerator, uint256 denominator, -- cgit From d1fd4421be0a7639b99b374bf04e57fac4e8a486 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 23 Dec 2018 19:27:38 -0800 Subject: Use string argument encoding with new encoder --- contracts/protocol/test/asset_proxy/proxies.ts | 7 ------- contracts/protocol/test/exchange/core.ts | 20 ++++++++++---------- contracts/protocol/test/exchange/internal.ts | 3 +-- 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/asset_proxy/proxies.ts b/contracts/protocol/test/asset_proxy/proxies.ts index 650594c12..bbb44f402 100644 --- a/contracts/protocol/test/asset_proxy/proxies.ts +++ b/contracts/protocol/test/asset_proxy/proxies.ts @@ -107,7 +107,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Configure ERC721Proxy await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -115,7 +114,6 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -123,7 +121,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Configure MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -131,14 +128,12 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, { from: owner, }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, { from: owner, @@ -146,7 +141,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Deploy and configure ERC20 tokens const numDummyErc20ToDeploy = 2; [erc20TokenA, erc20TokenB] = await erc20Wrapper.deployDummyTokensAsync( @@ -172,7 +166,6 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); - await erc20Wrapper.setBalancesAndAllowancesAsync(); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE), diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index ec0f41f85..700643b79 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1046,7 +1046,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1056,7 +1056,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1067,7 +1067,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and unfilled order', async () => { await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress); @@ -1077,7 +1077,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1089,7 +1089,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and unfilled order', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); @@ -1101,7 +1101,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1115,7 +1115,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1129,7 +1129,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a makerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetAmount: new BigNumber(0) }); @@ -1139,7 +1139,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a takerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ takerAssetAmount: new BigNumber(0) }); @@ -1149,7 +1149,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); }); }); diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index c65c477b2..972f5efb6 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -8,7 +8,6 @@ import { testCombinatoriallyWithReferenceFuncAsync, txDefaults, uint256Values, - orderUtils, web3Wrapper, } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; @@ -453,7 +452,7 @@ describe('Exchange core internal functions', () => { }; await web3Wrapper.awaitTransactionSuccessAsync( await testExchange.publicUpdateFilledState.sendTransactionAsync( - orderUtils.getOrderWithoutExchangeAddress(emptySignedOrder), + emptySignedOrder, constants.NULL_ADDRESS, orderHash, orderTakerAssetFilledAmount, -- cgit From 0b6c9c84688b565a9000b2c4e889c682ccaa7e51 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 23 Dec 2018 19:49:08 -0800 Subject: Ran prettier --- contracts/protocol/test/utils/exchange_wrapper.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 28532f44b..2c27d0f2b 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -10,7 +10,7 @@ import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; -import { AbiDefinition, MethodAbi ,Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import { AbiDefinition, MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; import { AbiEncoder } from '@0x/utils'; @@ -277,15 +277,25 @@ export class ExchangeWrapper { ); return data; } - // @hysz -- TEMPORARY HACK @TODO remove - public abiDecodeFillOrder(data: string): {order: OrderWithoutExchangeAddress, takerAssetFillAmount: BigNumber, signature: string} { + // @TODO hysz -- Remove once abi decoding has been added to contract templates + public abiDecodeFillOrder( + data: string, + ): { order: OrderWithoutExchangeAddress; takerAssetFillAmount: BigNumber; signature: string } { + // Lookup fillOrder ABI let fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { - if ((value.type === 'function') && (value as MethodAbi).name === 'fillOrder') { + if (value.type === 'function' && (value as MethodAbi).name === 'fillOrder') { return true; } return false; }) as MethodAbi; - return (new AbiEncoder.Method(fillOrderAbi)).decode(data) as {order: OrderWithoutExchangeAddress, takerAssetFillAmount: BigNumber, signature: string}; + // Decode input data + const abiEncoder = new AbiEncoder.Method(fillOrderAbi); + const decodedData = abiEncoder.decode(data) as { + order: OrderWithoutExchangeAddress; + takerAssetFillAmount: BigNumber; + signature: string; + }; + return decodedData; } public getExchangeAddress(): string { return this._exchange.address; -- cgit From f73c68ee612841323357703fbc2ea58566934a4e Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 23 Dec 2018 21:37:41 -0800 Subject: Created an interface for abi decoded fillOrder data --- contracts/protocol/test/utils/exchange_wrapper.ts | 11 ++++------- contracts/protocol/test/utils/types.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 contracts/protocol/test/utils/types.ts (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 2c27d0f2b..804b0141e 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -17,6 +17,8 @@ import { AbiEncoder } from '@0x/utils'; import { ExchangeContract } from '../../generated-wrappers/exchange'; import { artifacts } from '../../src/artifacts'; +import { AbiDecodedFillOrderData } from './types'; + export class ExchangeWrapper { private readonly _exchange: ExchangeContract; private readonly _web3Wrapper: Web3Wrapper; @@ -277,10 +279,9 @@ export class ExchangeWrapper { ); return data; } - // @TODO hysz -- Remove once abi decoding has been added to contract templates public abiDecodeFillOrder( data: string, - ): { order: OrderWithoutExchangeAddress; takerAssetFillAmount: BigNumber; signature: string } { + ): AbiDecodedFillOrderData { // Lookup fillOrder ABI let fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { if (value.type === 'function' && (value as MethodAbi).name === 'fillOrder') { @@ -290,11 +291,7 @@ export class ExchangeWrapper { }) as MethodAbi; // Decode input data const abiEncoder = new AbiEncoder.Method(fillOrderAbi); - const decodedData = abiEncoder.decode(data) as { - order: OrderWithoutExchangeAddress; - takerAssetFillAmount: BigNumber; - signature: string; - }; + const decodedData = abiEncoder.decode(data) as AbiDecodedFillOrderData; return decodedData; } public getExchangeAddress(): string { diff --git a/contracts/protocol/test/utils/types.ts b/contracts/protocol/test/utils/types.ts new file mode 100644 index 000000000..d18cd0599 --- /dev/null +++ b/contracts/protocol/test/utils/types.ts @@ -0,0 +1,8 @@ +import { SignedOrder } from '@0x/types'; +import { BigNumber } from '@0x/utils'; + +export interface AbiDecodedFillOrderData { + order: SignedOrder; + akerAssetFillAmount: BigNumber; + signature: string; +} \ No newline at end of file -- cgit From f39c03191c8a8870aaf5180d2764cd8c8eb17d0c Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 23 Dec 2018 21:54:51 -0800 Subject: Ran linter --- contracts/protocol/test/utils/exchange_wrapper.ts | 13 +++++-------- .../protocol/test/utils/fill_order_combinatorial_utils.ts | 1 - contracts/protocol/test/utils/types.ts | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 804b0141e..0feb5af15 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -7,12 +7,11 @@ import { SignedTransaction, } from '@0x/contracts-test-utils'; import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; -import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types'; -import { BigNumber } from '@0x/utils'; +import { SignedOrder } from '@0x/types'; +import { AbiEncoder, BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { AbiDefinition, MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { AbiEncoder } from '@0x/utils'; import { ExchangeContract } from '../../generated-wrappers/exchange'; import { artifacts } from '../../src/artifacts'; @@ -279,12 +278,10 @@ export class ExchangeWrapper { ); return data; } - public abiDecodeFillOrder( - data: string, - ): AbiDecodedFillOrderData { + public abiDecodeFillOrder(data: string): AbiDecodedFillOrderData { // Lookup fillOrder ABI - let fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { - if (value.type === 'function' && (value as MethodAbi).name === 'fillOrder') { + const fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { + if (value.type === 'function' && (value as any).name === 'fillOrder') { return true; } return false; diff --git a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts index df38bd59c..86490c37e 100644 --- a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts @@ -42,7 +42,6 @@ import { ExchangeWrapper } from './exchange_wrapper'; import { OrderFactoryFromScenario } from './order_factory_from_scenario'; import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher'; import { SimpleOrderFilledCancelledFetcher } from './simple_order_filled_cancelled_fetcher'; -import { Method } from '@0x/utils/lib/src/abi_encoder'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/protocol/test/utils/types.ts b/contracts/protocol/test/utils/types.ts index d18cd0599..b4cd88673 100644 --- a/contracts/protocol/test/utils/types.ts +++ b/contracts/protocol/test/utils/types.ts @@ -2,7 +2,7 @@ import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; export interface AbiDecodedFillOrderData { - order: SignedOrder; + order: SignedOrder; akerAssetFillAmount: BigNumber; signature: string; -} \ No newline at end of file +} -- cgit From 6892f929fb0c996b8c8a99a17686aa232dc266d9 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 23 Dec 2018 21:57:59 -0800 Subject: circle build failed. New commit to resubmit job. --- contracts/protocol/test/utils/exchange_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 0feb5af15..7eca809e6 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -279,7 +279,7 @@ export class ExchangeWrapper { return data; } public abiDecodeFillOrder(data: string): AbiDecodedFillOrderData { - // Lookup fillOrder ABI + // Lookup fillOrder ABI in exchange abi const fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { if (value.type === 'function' && (value as any).name === 'fillOrder') { return true; -- cgit From 892be49b98acae61d1892ea89ef3c0b42168d8eb Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Wed, 9 Jan 2019 10:43:36 -0800 Subject: Use simpler `_.find` to locate fillOrderBai --- contracts/protocol/test/utils/exchange_wrapper.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 7eca809e6..871db3529 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -280,12 +280,7 @@ export class ExchangeWrapper { } public abiDecodeFillOrder(data: string): AbiDecodedFillOrderData { // Lookup fillOrder ABI in exchange abi - const fillOrderAbi = _.find(this._exchange.abi, (value: AbiDefinition) => { - if (value.type === 'function' && (value as any).name === 'fillOrder') { - return true; - } - return false; - }) as MethodAbi; + const fillOrderAbi = _.find(this._exchange.abi, { name: 'fillOrder' }) as MethodAbi; // Decode input data const abiEncoder = new AbiEncoder.Method(fillOrderAbi); const decodedData = abiEncoder.decode(data) as AbiDecodedFillOrderData; -- cgit From 82a44559f6a3d795a6a8b0baa9486633bc884475 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Wed, 9 Jan 2019 11:18:56 -0800 Subject: Style cleanup for Compressed Calldata in Contract Wrappers PR --- contracts/protocol/test/utils/fill_order_combinatorial_utils.ts | 4 ++-- contracts/protocol/test/utils/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts index 86490c37e..2fd33bebd 100644 --- a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts @@ -618,8 +618,8 @@ export class FillOrderCombinatorialUtils { params.takerAssetFillAmount, params.signature, ); - const paramsDecodeddByClient = this.exchangeWrapper.abiDecodeFillOrder(abiDataEncodedByContract); - expect(paramsDecodeddByClient).to.be.deep.equal(params, 'ABIEncodedFillOrderData'); + const paramsDecodedByClient = this.exchangeWrapper.abiDecodeFillOrder(abiDataEncodedByContract); + expect(paramsDecodedByClient).to.be.deep.equal(params, 'ABIEncodedFillOrderData'); } private async _getTakerAssetFillAmountAsync( signedOrder: SignedOrder, diff --git a/contracts/protocol/test/utils/types.ts b/contracts/protocol/test/utils/types.ts index b4cd88673..bbe4ffdab 100644 --- a/contracts/protocol/test/utils/types.ts +++ b/contracts/protocol/test/utils/types.ts @@ -3,6 +3,6 @@ import { BigNumber } from '@0x/utils'; export interface AbiDecodedFillOrderData { order: SignedOrder; - akerAssetFillAmount: BigNumber; + makerAssetFillAmount: BigNumber; signature: string; } -- cgit From 80aa2884a3aeb8b6f64080d665671e22a5c453cd Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Thu, 10 Jan 2019 00:36:42 -0800 Subject: Linter --- contracts/protocol/test/utils/exchange_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/exchange_wrapper.ts b/contracts/protocol/test/utils/exchange_wrapper.ts index 871db3529..437882b41 100644 --- a/contracts/protocol/test/utils/exchange_wrapper.ts +++ b/contracts/protocol/test/utils/exchange_wrapper.ts @@ -10,7 +10,7 @@ import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { SignedOrder } from '@0x/types'; import { AbiEncoder, BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; -import { AbiDefinition, MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import { MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; import { ExchangeContract } from '../../generated-wrappers/exchange'; -- cgit From 1907ecc02edc8fb362485800b58946913387fa7d Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Thu, 10 Jan 2019 18:25:50 -0800 Subject: makerAssetFillAmount -> takerAssetFillAmount --- contracts/protocol/test/utils/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contracts') diff --git a/contracts/protocol/test/utils/types.ts b/contracts/protocol/test/utils/types.ts index bbe4ffdab..5f12635a7 100644 --- a/contracts/protocol/test/utils/types.ts +++ b/contracts/protocol/test/utils/types.ts @@ -3,6 +3,6 @@ import { BigNumber } from '@0x/utils'; export interface AbiDecodedFillOrderData { order: SignedOrder; - makerAssetFillAmount: BigNumber; + takerAssetFillAmount: BigNumber; signature: string; } -- cgit