Skip to content

Commit

Permalink
build(deps): bump web3[-*] from 1.2.1 to 1.2.4
Browse files Browse the repository at this point in the history
Refactor typings as necessary. In order for `bignumber.js` in the root
`node_modules` to not conflict with `@types/bignumber.js`, specify
`"bignumber.js": "5.0.0"` in `devDependencies` and `"embark-ui/bignumber.js"`
in `nohoist` of the root `package.json`.

Bump simples from 0.8.8 to 0.9.0-alpha-10 in
`packages/embark-blockchain-process/package.json` and refactor
`packages/embark-blockchain-process/src/proxy.js`. Drop simples as a dependency
in `packages/embark/package.json` since it's not needed there. The upgrade of
simples allows embark 4.2.x's proxy to work correctly with geth `>=1.9.1`.

Bump ganache-cli from 6.4.3 to 6.7.0 (latest) because 6.4.3 doesn't support
`eth_chainId` and since web3 1.2.4 makes use of the `eth_chainId` RPC
method (EIP 695).

BREAKING CHANGE: bump embark's minimum supported version of geth from
`>=1.8.14` to `>=1.9.0` and its minimum supported version of parity from
`>=2.0.0` to `>=2.2.1`. This is necessary since web3 1.2.4 makes use of the
`eth_chainId` RPC method (EIP 695) and those client versions are the earliest
ones to implement it.
  • Loading branch information
michaelsbradleyjr committed Dec 18, 2019
1 parent 706e43c commit e7ed552
Show file tree
Hide file tree
Showing 40 changed files with 487 additions and 1,019 deletions.
2 changes: 1 addition & 1 deletion dapps/templates/boilerplate/embark.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"buildDir": "dist/",
"config": "config/",
"versions": {
"web3": "1.2.1",
"web3": "1.2.4",
"solc": "0.5.0",
"ipfs-api": "17.2.4"
},
Expand Down
2 changes: 1 addition & 1 deletion dapps/templates/demo/embark.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"buildDir": "dist/",
"config": "config/",
"versions": {
"web3": "1.2.1",
"web3": "1.2.4",
"solc": "0.5.0",
"ipfs-api": "17.2.4"
},
Expand Down
2 changes: 1 addition & 1 deletion dapps/tests/app/embark.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"config": "config/",
"versions": {
"solc": "0.4.25",
"web3": "1.2.1",
"web3": "1.2.4",
"ipfs-api": "17.2.7"
},
"plugins": {
Expand Down
2 changes: 1 addition & 1 deletion dapps/tests/contracts/embark.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"namesystem": "ens.json"
},
"versions": {
"web3": "1.2.1",
"web3": "1.2.4",
"solc": "0.4.24"
},
"plugins": {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@babel/preset-typescript": "7.1.0",
"babel-plugin-dynamic-import-node": "2.2.0",
"babel-plugin-macros": "2.4.5",
"bignumber.js": "5.0.0",
"chalk": "2.4.2",
"coveralls": "3.0.2",
"eslint-plugin-react": "7.14.3",
Expand Down Expand Up @@ -81,7 +82,8 @@
"embark/embark-test-contract-1",
"embark-dapp-template-demo/bootstrap",
"embark-dapp-test-app/embark-dapp-test-service",
"embark-dapp-test-app/zeppelin-solidity"
"embark-dapp-test-app/zeppelin-solidity",
"embark-ui/bignumber.js"
]
}
}
4 changes: 2 additions & 2 deletions packages/embark-blockchain-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"embarkjs": "^4.1.1",
"ethereumjs-tx": "1.3.7",
"ethereumjs-util": "6.0.0",
"ganache-cli": "6.4.3",
"web3": "1.2.1"
"ganache-cli": "6.7.0",
"web3": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-blockchain-listener/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"embark-core": "^4.1.1",
"embark-process-logs-api": "^4.1.1",
"embark-utils": "^4.1.1",
"web3": "1.2.1"
"web3": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-blockchain-process/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"pump": "3.0.0",
"semver": "5.6.0",
"shelljs": "0.8.3",
"simples": "0.8.8",
"simples": "0.9.0-alpha-10",
"stream-json": "1.3.0",
"ws": "7.1.2"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/embark-blockchain-process/src/gethClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const constants = require('embark-core/constants');

const DEFAULTS = {
"BIN": "geth",
"VERSIONS_SUPPORTED": ">=1.8.14",
"VERSIONS_SUPPORTED": ">=1.9.0",
"NETWORK_TYPE": "custom",
"NETWORK_ID": 1337,
"RPC_API": ['eth', 'web3', 'net', 'debug', 'personal'],
Expand Down Expand Up @@ -392,4 +392,3 @@ class GethClient {
}

module.exports = GethClient;

2 changes: 1 addition & 1 deletion packages/embark-blockchain-process/src/parityClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const constants = require('embark-core/constants');

const DEFAULTS = {
"BIN": "parity",
"VERSIONS_SUPPORTED": ">=2.0.0",
"VERSIONS_SUPPORTED": ">=2.2.1",
"NETWORK_TYPE": "dev",
"NETWORK_ID": 17,
"RPC_API": ["web3", "eth", "pubsub", "net", "parity", "private", "parity_pubsub", "traces", "rpc", "shh", "shh_pubsub"],
Expand Down
18 changes: 8 additions & 10 deletions packages/embark-blockchain-process/src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const http = require('http');
const httpProxy = require('http-proxy');
const {parser: jsonParser} = require('stream-json');
const pump = require('pump');
const WsParser = require('simples/lib/parsers/ws');
const WsWrapper = require('simples/lib/ws/wrapper');
const WsParser = require('simples/lib/parsers/ws-parser');
const WsFrame = require('simples/lib/ws/frame');
const modifyResponse = require('node-http-proxy-json');
const Transaction = require('ethereumjs-tx');
const ethUtil = require('ethereumjs-util');
Expand Down Expand Up @@ -258,19 +258,17 @@ export class Proxy {
},
ws: ws,
createWsServerTransformStream: (_req, _proxyReq, _proxyRes) => {
const parser = new WsParser(0, true);
parser.on('frame', ({data: buffer}) => {
const parser = new WsParser(true, null, true);
parser.on('message', ({data: buffer}) => {
let object = parseJsonMaybe(buffer.toString());
if (object) {
object = modifyPayload(this.toModifyPayloads, object, accounts);
// track the modified response
this.trackResponse(object);
// send the modified response
WsWrapper.wrap(
{connection: dupl, masked: 0},
Buffer.from(JSON.stringify(object)),
() => {}
);
WsFrame.wrap(JSON.stringify(object), 0, (data) => {
dupl.push(data);
});
}
});
const dupl = new Duplex({
Expand Down Expand Up @@ -325,7 +323,7 @@ export class Proxy {

proxy.on('proxyReqWs', (_proxyReq, req, socket) => {
// messages TO the target
pump(socket, new WsParser(0, false)).on('frame', ({data: buffer}) => {
pump(socket, new WsParser(false, null, true)).on('message', ({data: buffer}) => {
const object = parseJsonMaybe(buffer.toString());
this.trackRequest({ ws: true, data: object });
});
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-code-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"fs-extra": "7.0.1",
"parse-json": "4.0.0",
"vm2": "3.6.4",
"web3": "1.2.1"
"web3": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/embark-coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"prettier-plugin-solidity": "1.0.0-alpha.25",
"semver": "5.6.0",
"solidity-parser-antlr": "0.4.5",
"web3-eth-contract": "1.2.1"
"web3-core": "1.2.4",
"web3-eth-contract": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand All @@ -59,7 +60,6 @@
"@types/mocha": "5.2.7",
"@types/prettier": "1.16.4",
"@types/semver": "5.5.0",
"@types/web3": "1.0.12",
"cross-env": "5.2.0",
"eslint": "5.7.0",
"mocha": "5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-coverage/src/lib/contractEnhanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { File } from "embark-utils";
import * as fs from "fs-extra";
import * as path from "path";
import parser, { LineColumn, Location, SourceUnit } from "solidity-parser-antlr";
import { EventLog } from "web3/types";
import { EventLog } from "web3-core";

import { decrypt } from "./eventId";
import { Injector } from "./injector";
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-coverage/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dappPath, File } from "embark-utils";
import * as globule from "globule";
import * as path from "path";
import Web3Contract from "web3/eth/contract";
import { Contract as Web3Contract } from "web3-eth-contract";

import { Contract, Embark } from "embark";
import { ContractEnhanced } from "./contractEnhanced";
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-profiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@babel/runtime-corejs2": "7.3.1",
"ascii-table": "0.0.9",
"async": "2.6.1",
"web3-utils": "1.2.1"
"web3-utils": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
3 changes: 2 additions & 1 deletion packages/embark-scaffolding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"embark-i18n": "^4.1.1",
"embark-utils": "^4.1.1"
"embark-utils": "^4.1.1",
"web3-utils": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Contract, Embark } /* supplied by @types/embark in packages/embark-typi
import { __ } from "embark-i18n";
import Handlebars from "handlebars";
import * as path from "path";
import { ABIDefinition } from "web3/eth/abi";
import { AbiItem } from "web3-utils";
import { Builder } from "../../builder";
import { CommandOptions } from "../../commandOptions";
import { SmartContractsRecipe } from "../../smartContractsRecipe";

const utils = require("embark-utils");
require("../../handlebarHelpers");

interface ABIDefinitionDecorated extends ABIDefinition {
interface AbiItemDecorated extends AbiItem {
isIpfsText?: boolean;
isIpfsFile?: boolean;
isStandard?: boolean;
Expand Down Expand Up @@ -82,7 +82,7 @@ export class ReactBuilder implements Builder {
const ipfsAttributes = this.description.ipfsAttributes(contract.className);

return contract.abiDefinition.filter((entry) => entry.type === "function").map((entry) => {
const decorated: ABIDefinitionDecorated = entry;
const decorated: AbiItemDecorated = entry;
const inputName = entry.inputs && entry.inputs.length > 1 ? entry.inputs[1].name.substring(1, entry.inputs[1].name.length) : "";
const functionName = entry.name || "";

Expand Down
4 changes: 2 additions & 2 deletions packages/embark-scaffolding/src/handlebarHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Handlebars from "handlebars";
import { ABIDefinition } from "web3/eth/abi";
import { AbiItem } from "web3-utils";

Handlebars.registerHelper("capitalize", (word: string) => {
return word.charAt(0).toUpperCase() + word.slice(1);
Expand Down Expand Up @@ -53,7 +53,7 @@ Handlebars.registerHelper("trim", (name: string) => {
return name.replace("[]", "");
});

Handlebars.registerHelper("methodname", (abiDefinition: ABIDefinition[], functionName: string, inputs: any[]) => {
Handlebars.registerHelper("methodname", (abiDefinition: AbiItem[], functionName: string, inputs: any[]) => {
const funCount = abiDefinition.filter((x) => x.name === functionName).length;
if (funCount === 1) {
return "." + functionName;
Expand Down
4 changes: 2 additions & 2 deletions packages/embark-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"watch": "npm run typecheck -- --preserveWatchOutput --watch"
},
"devDependencies": {
"@types/web3": "1.0.12",
"npm-run-all": "4.1.5",
"tslint": "5.16.0",
"typescript": "3.4.5"
"typescript": "3.4.5",
"web3-utils": "1.2.4"
},
"engines": {
"node": ">=8.12.0 <12.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/embark-typings/src/contract.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ABIDefinition } from "web3/eth/abi";
import { AbiItem } from "web3-utils";

export interface Contract {
abiDefinition: ABIDefinition[];
abiDefinition: AbiItem[];
deployedAddress: string;
className: string;
silent?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/embark-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"url-loader": "2.1.0",
"uuid": "3.3.2",
"velocity-react": "^1.4.1",
"web3": "1.2.1",
"web3": "1.2.4",
"webpack": "4.39.2",
"webpack-dev-server": "3.1.11",
"webpack-manifest-plugin": "2.0.4",
Expand Down
7 changes: 4 additions & 3 deletions packages/embark-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@
"ora": "2.1.0",
"pretty-ms": "4.0.0",
"shelljs": "0.8.3",
"web3": "1.2.1",
"web3-eth": "1.2.1",
"web3-eth-abi": "1.2.1"
"web3": "1.2.4",
"web3-eth": "1.2.4",
"web3-eth-abi": "1.2.4",
"web3-utils": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.2.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/embark-utils/src/transactionUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Contract } /* supplied by @types/embark in packages/embark-typings */ from "embark";
import { ABIDefinition } from "web3/eth/abi";
import { AbiItem } from "web3-utils";
import { decodeParams, sha3 } from "./web3Utils";

interface AddressToContract {
Expand All @@ -13,7 +13,7 @@ interface AddressToContractArray {
}

interface FunctionSignature {
abi: ABIDefinition;
abi: AbiItem;
functionName?: string;
name: string;
}
Expand All @@ -33,8 +33,8 @@ export function getAddressToContract(contractsList: Contract[], addressToContrac
}
const funcSignatures: { [name: string]: FunctionSignature } = {};
contract.abiDefinition
.filter((func: ABIDefinition) => func.type === "function")
.map((func: ABIDefinition) => {
.filter((func: AbiItem) => func.type === "function")
.map((func: AbiItem) => {
const name = `${func.name}(${func.inputs ? func.inputs.map((input) => input.type).join(",") : ""})`;
funcSignatures[sha3(name).substring(0, 10)] = {
abi: func,
Expand Down
Loading

0 comments on commit e7ed552

Please sign in to comment.