From ecbdf5f12bc9a1e654241f2051f152a1d5fea5bc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 12 Sep 2018 11:02:14 +0200 Subject: Upgrade to TS version of ethers --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 831b6c819..c9e8fba83 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -49,7 +49,7 @@ "detect-node": "2.0.3", "ethereum-types": "^1.0.6", "ethereumjs-util": "^5.1.1", - "ethers": "3.0.22", + "ethers": "^4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", "js-sha3": "^0.7.0", "lodash": "^4.17.5" -- cgit v1.2.3 From 5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Sep 2018 14:04:13 +0200 Subject: Fixes for the breaking changes in ethers --- packages/utils/src/abi_decoder.ts | 4 ++-- packages/utils/src/abi_utils.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 265eb105e..ea8c91d10 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -47,7 +47,7 @@ export class AbiDecoder { let decodedData: any[]; try { - decodedData = ethersInterface.events[event.name].parse(log.data); + decodedData = ethersInterface.events[event.name].decode(log.data); } catch (error) { if (error.code === ethers.errors.INVALID_ARGUMENT) { // Because we index events by Method ID, and Method IDs are derived from the method @@ -99,7 +99,7 @@ export class AbiDecoder { const ethersInterface = new ethers.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { - const topic = ethersInterface.events[abi.name].topics[0]; + const topic = ethersInterface.events[abi.name].topic; const numIndexedArgs = _.reduce(abi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); this._methodIds[topic] = { ...this._methodIds[topic], diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index c9b70966c..b5ab28ba2 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -4,11 +4,17 @@ import * as _ from 'lodash'; import { BigNumber } from './configured_bignumber'; +type ParamName = null | string | NestedParamName; +interface NestedParamName { + name: string | null; + names: ParamName[]; +} + // Note(albrow): This function is unexported in ethers.js. Copying it here for // now. // Source: https://github.com/ethers-io/ethers.js/blob/884593ab76004a808bf8097e9753fb5f8dcc3067/contracts/interface.js#L30 -function parseEthersParams(params: DataItem[]): { names: ethers.ParamName[]; types: string[] } { - const names: ethers.ParamName[] = []; +function parseEthersParams(params: DataItem[]): { names: ParamName[]; types: string[] } { + const names: ParamName[] = []; const types: string[] = []; params.forEach((param: DataItem) => { @@ -37,7 +43,7 @@ function parseEthersParams(params: DataItem[]): { names: ethers.ParamName[]; typ // returns true if x is equal to y and false otherwise. Performs some minimal // type conversion and data massaging for x and y, depending on type. name and // type should typically be derived from parseEthersParams. -function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): boolean { +function isAbiDataEqual(name: ParamName, type: string, x: any, y: any): boolean { if (_.isUndefined(x) && _.isUndefined(y)) { return true; } else if (_.isUndefined(x) && !_.isUndefined(y)) { @@ -89,7 +95,7 @@ function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): b // const nestedName = _.isString(name.names[i]) ? (name.names[i] as string) - : ((name.names[i] as ethers.NestedParamName).name as string); + : ((name.names[i] as NestedParamName).name as string); if (!isAbiDataEqual(name.names[i], types[i], x[nestedName], y[nestedName])) { return false; } -- cgit v1.2.3 From 3167bfde1a426e567de1b2f9809062217bb19b6b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 11:47:30 +0200 Subject: Remove unused import --- packages/utils/src/abi_utils.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index b5ab28ba2..598ea5fcc 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -1,5 +1,4 @@ import { AbiDefinition, AbiType, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; -import * as ethers from 'ethers'; import * as _ from 'lodash'; import { BigNumber } from './configured_bignumber'; -- cgit v1.2.3 From f3deabccf4e6caec57351a09f82b3f786122b5ea Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 12:10:25 +0200 Subject: Add CHANGELOG entries --- packages/utils/CHANGELOG.json | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index c1b7db100..1a868d676 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Make abi_decoder compatible with ethers ^4.0.0", + "pr": 1069 + } + ] + }, { "timestamp": 1536142250, "version": "1.0.8", -- cgit v1.2.3 From 900a8aee76237778398a5940e723ce30c4af1860 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:33:55 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 1536c1960..d395a7dec 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537907159, + "version": "1.0.11", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1537875740, "version": "1.0.10", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index ff26a0900..60b6d1b7e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.11 - _September 25, 2018_ + + * Dependencies updated + ## v1.0.10 - _September 25, 2018_ * Dependencies updated -- cgit v1.2.3 From 1b35a6e3b5d050fa33097b35e1d739ca13c6806e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:34:14 +0100 Subject: Publish - 0x.js@1.0.6 - @0xproject/abi-gen@1.0.11 - @0xproject/assert@1.0.11 - @0xproject/asset-buyer@1.0.1 - @0xproject/base-contract@2.0.5 - @0xproject/connect@2.0.4 - @0xproject/contract-wrappers@2.0.0 - contracts@2.1.47 - @0xproject/dev-utils@1.0.10 - ethereum-types@1.0.8 - @0xproject/fill-scenarios@1.0.5 - @0xproject/json-schemas@1.0.4 - @0xproject/metacoin@0.0.21 - @0xproject/migrations@1.0.12 - @0xproject/order-utils@1.0.5 - @0xproject/order-watcher@2.0.0 - @0xproject/react-docs@1.0.11 - @0xproject/react-shared@1.0.12 - @0xproject/sol-compiler@1.1.5 - @0xproject/sol-cov@2.1.5 - @0xproject/sol-resolver@1.0.11 - @0xproject/sra-report@1.0.11 - @0xproject/sra-spec@1.0.4 - @0xproject/subproviders@2.0.5 - @0xproject/testnet-faucets@1.0.49 - @0xproject/types@1.1.1 - @0xproject/typescript-typings@2.0.2 - @0xproject/utils@1.0.11 - @0xproject/web3-wrapper@3.0.1 - @0xproject/website@0.0.52 --- packages/utils/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 77d11c41c..1fd2f57fa 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.10", + "version": "1.0.11", "engines": { "node": ">=6.12" }, @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.0", - "@0xproject/typescript-typings": "^2.0.1", + "@0xproject/types": "^1.1.1", + "@0xproject/typescript-typings": "^2.0.2", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.7", + "ethereum-types": "^1.0.8", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From a51919db0e2414dc345f55ce7ad4fc50286dfd19 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 27 Sep 2018 11:24:03 +0200 Subject: Remove ethers.js carret as it's a beta version --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 8b9161ce7..db265dd8f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -49,7 +49,7 @@ "detect-node": "2.0.3", "ethereum-types": "^1.0.8", "ethereumjs-util": "^5.1.1", - "ethers": "^4.0.0-beta.14", + "ethers": "4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", "js-sha3": "^0.7.0", "lodash": "^4.17.5" -- cgit v1.2.3 From c354129b6f4a8b9373655ecb29ffb4ae87f19c56 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 28 Sep 2018 19:15:38 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 3 ++- packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index b4f438966..a24d58b30 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Make abi_decoder compatible with ethers ^4.0.0", "pr": 1069 } - ] + ], + "timestamp": 1538157789 }, { "timestamp": 1537907159, diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 60b6d1b7e..80b3bfd2d 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.0 - _September 28, 2018_ + + * Make abi_decoder compatible with ethers ^4.0.0 (#1069) + ## v1.0.11 - _September 25, 2018_ * Dependencies updated -- cgit v1.2.3 From ac14dd2b29b42ef4d2a46db9b70d4d30cf9bd40f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 28 Sep 2018 19:16:07 +0100 Subject: Publish - 0x.js@1.0.7 - @0xproject/abi-gen@1.0.12 - @0xproject/assert@1.0.12 - @0xproject/asset-buyer@1.0.2 - @0xproject/base-contract@3.0.0 - @0xproject/connect@3.0.0 - @0xproject/contract-wrappers@2.0.1 - contracts@2.1.48 - @0xproject/dev-utils@1.0.11 - ethereum-types@1.0.9 - @0xproject/fill-scenarios@1.0.6 - @0xproject/json-schemas@1.0.5 - @0xproject/metacoin@0.0.22 - @0xproject/migrations@1.0.13 - @0xproject/monorepo-scripts@1.0.10 - @0xproject/order-utils@1.0.6 - @0xproject/order-watcher@2.1.0 - @0xproject/react-docs@1.0.12 - @0xproject/react-shared@1.0.13 - @0xproject/sol-compiler@1.1.6 - @0xproject/sol-cov@2.1.6 - @0xproject/sol-doc@1.0.1 - @0xproject/sol-resolver@1.0.12 - @0xproject/sra-report@1.0.12 - @0xproject/sra-spec@1.0.5 - @0xproject/subproviders@2.0.6 - @0xproject/testnet-faucets@1.0.50 - @0xproject/types@1.1.2 - @0xproject/typescript-typings@3.0.0 - @0xproject/utils@2.0.0 - @0xproject/web3-wrapper@3.0.2 - @0xproject/website@0.0.53 --- packages/utils/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index db265dd8f..a68a05d52 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.11", + "version": "2.0.0", "engines": { "node": ">=6.12" }, @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.1", - "@0xproject/typescript-typings": "^2.0.2", + "@0xproject/types": "^1.1.2", + "@0xproject/typescript-typings": "^3.0.0", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.8", + "ethereum-types": "^1.0.9", "ethereumjs-util": "^5.1.1", "ethers": "4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 8b7888b736b9a18f03166c9095a2dec65eca4d66 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 2 Oct 2018 12:37:34 +0200 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index a24d58b30..b666ee829 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1538475601, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.0.0", "changes": [ diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 80b3bfd2d..c62e414f8 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.1 - _October 2, 2018_ + + * Dependencies updated + ## v2.0.0 - _September 28, 2018_ * Make abi_decoder compatible with ethers ^4.0.0 (#1069) -- cgit v1.2.3 From f80faf0b4870fcd6be259c4a1a46a64054d2aa31 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 2 Oct 2018 14:45:16 +0200 Subject: Update package.json versions to match the npm ones --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index a68a05d52..68869565c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "2.0.0", + "version": "2.0.1", "engines": { "node": ">=6.12" }, -- cgit v1.2.3 From f4e4eef48e703afb923ba4f969fc77f32be81745 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 1 Oct 2018 16:37:35 +0200 Subject: Introduce a build:ci command that doesn't build webpack bundles --- packages/utils/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 68869565c..d2ed67554 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -9,6 +9,7 @@ "types": "lib/src/index.d.ts", "scripts": { "build": "tsc -b", + "build:ci": "yarn build", "clean": "shx rm -rf lib", "lint": "tslint --project .", "test": "yarn run_mocha", -- cgit v1.2.3