Skip to content

Commit

Permalink
build(deps): bump web3[-*] from 1.2.4 to 1.2.6
Browse files Browse the repository at this point in the history
Remove `bignumber.js` workaround (in the root, from PR #2152) because it's no
longer needed (verified locally).

Remove the `"skipLibCheck"` workaround (in `packages/plugins/solidity-tests`,
from PR #2152) because it's no longer needed (verified locally).

Refactor a typing in `packages/plugins/geth`. What's happening is that in web3
v1.2.4 `sendTransaction` has a return type of `PromiEvent<TransactionReceipt>`
but in v1.2.6 it has a return type of `PromiEvent<TransactionReceipt |
TransactionRevertInstructionError>`.

Compare:
* [v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294](https://github.com/ethereum/web3.js/blob/v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294)
* [v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298](https://github.com/ethereum/web3.js/blob/v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298)

The problem is that the `TransactionRevertInstructionError` type doesn't have a
`transactionHash` property. Since at present the code in
`packages/plugins/geth/src/devtxs.ts` only deals with the success case re:
`sendTransaction`, import the `TransactionReceipt` type from `web3-eth` and
cast the resolved return value's type using TypeScript's `as` operator.
  • Loading branch information
michaelsbradleyjr committed Feb 3, 2020
1 parent 1790027 commit bf04670
Show file tree
Hide file tree
Showing 39 changed files with 314 additions and 78 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"babel-eslint": "10.0.3",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-macros": "2.7.1",
"bignumber.js": "5.0.0",
"chalk": "2.4.2",
"coveralls": "3.0.9",
"eslint": "6.2.2",
Expand Down Expand Up @@ -102,7 +101,6 @@
"embark-dapp-test-app/embark-dapp-test-service",
"embark-dapp-test-app/zeppelin-solidity",
"embark-ui/@storybook/**",
"embark-ui/bignumber.js",
"embark-ui/react-scripts",
"embark-ui/react-scripts/**",
"embark/embark-test-contract-0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cockpit/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"typescript": "3.7.2",
"uuid": "3.3.2",
"velocity-react": "1.4.3",
"web3": "1.2.4",
"web3": "1.2.6",
"webpack": "4.41.2"
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/code-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"fs-extra": "8.1.0",
"parse-json": "5.0.0",
"vm2": "3.8.4",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"@babel/core": "7.7.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"parse-json": "4.0.0",
"shelljs": "0.8.3",
"uuid": "3.3.2",
"web3": "1.2.4",
"web3-utils": "1.2.4",
"web3": "1.2.6",
"web3-utils": "1.2.6",
"window-size": "1.1.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
"ora": "4.0.3",
"pretty-ms": "5.1.0",
"shelljs": "0.8.3",
"web3": "1.2.4",
"web3-eth": "1.2.4",
"web3-eth-abi": "1.2.4",
"web3": "1.2.6",
"web3-eth": "1.2.6",
"web3-eth-abi": "1.2.6",
"ws": "7.1.2"
},
"devDependencies": {
Expand Down
38 changes: 19 additions & 19 deletions packages/embark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@
"term.js": "0.0.7",
"viz.js": "1.8.2",
"vm2": "3.6.4",
"web3": "1.2.4",
"web3-bzz": "1.2.4",
"web3-core": "1.2.4",
"web3-core-helpers": "1.2.4",
"web3-core-method": "1.2.4",
"web3-core-promievent": "1.2.4",
"web3-core-subscriptions": "1.2.4",
"web3-eth": "1.2.4",
"web3-eth-abi": "1.2.4",
"web3-eth-accounts": "1.2.4",
"web3-eth-contract": "1.2.4",
"web3-eth-iban": "1.2.4",
"web3-eth-personal": "1.2.4",
"web3-net": "1.2.4",
"web3-providers-http": "1.2.4",
"web3-providers-ipc": "1.2.4",
"web3-providers-ws": "1.2.4",
"web3-shh": "1.2.4",
"web3-utils": "1.2.4",
"web3": "1.2.6",
"web3-bzz": "1.2.6",
"web3-core": "1.2.6",
"web3-core-helpers": "1.2.6",
"web3-core-method": "1.2.6",
"web3-core-promievent": "1.2.6",
"web3-core-subscriptions": "1.2.6",
"web3-eth": "1.2.6",
"web3-eth-abi": "1.2.6",
"web3-eth-accounts": "1.2.6",
"web3-eth-contract": "1.2.6",
"web3-eth-iban": "1.2.6",
"web3-eth-personal": "1.2.6",
"web3-net": "1.2.6",
"web3-providers-http": "1.2.6",
"web3-providers-ipc": "1.2.6",
"web3-providers-ws": "1.2.6",
"web3-shh": "1.2.6",
"web3-utils": "1.2.6",
"window-size": "1.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/embarkjs/embarkjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"nyc": "13.1.0",
"rimraf": "3.0.0",
"source-map-support": "0.5.13",
"web3": "1.2.4"
"web3": "1.2.6"
},
"engines": {
"node": ">=10.17.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/embarkjs/embarkjs/src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ EmbarkJS.Contract = function() {
throw new Error('EmbarkJS.Contract is deprecated: please use EmbarkJS.Blockchain.Contract instead');
};
EmbarkJS.isNewWeb3 = function() {
throw new Error('EmbarkJS.isNewWeb3 is deprecated: only Web3 >=1.2.4 is supported now');
throw new Error('EmbarkJS.isNewWeb3 is deprecated: only Web3 >=1.2.6 is supported now');
};

export default EmbarkJS;
2 changes: 1 addition & 1 deletion packages/embarkjs/ens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"core-js": "3.4.3",
"embarkjs": "^5.1.1-nightly.2",
"eth-ens-namehash": "2.0.8",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"ajv": "6.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/embarkjs/swarm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@babel/runtime-corejs3": "7.7.4",
"core-js": "3.4.3",
"swarm-api": "0.1.2",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"ajv": "6.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/embarkjs/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dependencies": {
"@babel/runtime-corejs3": "7.7.4",
"core-js": "3.4.3",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"ajv": "6.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/embarkjs/whisper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@babel/runtime-corejs3": "7.7.4",
"core-js": "3.4.3",
"rxjs": "6.4.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"ajv": "6.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/accounts-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"embark-i18n": "^5.1.1-nightly.2",
"embark-logger": "^5.1.1-nightly.2",
"embark-utils": "^5.1.1-nightly.2",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"prettier-plugin-solidity": "1.0.0-alpha.25",
"semver": "5.6.0",
"solidity-parser-antlr": "0.4.5",
"web3-core": "1.2.4",
"web3-eth-contract": "1.2.4"
"web3-core": "1.2.6",
"web3-eth-contract": "1.2.6"
},
"devDependencies": {
"@babel/cli": "7.7.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/deploy-tracker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"embark-logger": "^5.1.1-nightly.2",
"embark-utils": "^5.1.1-nightly.2",
"fs-extra": "8.1.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/ens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"embarkjs-ens": "^5.1.1-nightly.2",
"eth-ens-namehash": "2.0.8",
"lodash.clonedeep": "4.5.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"@babel/core": "7.7.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/ethereum-blockchain-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"embark-utils": "^5.1.1-nightly.2",
"embarkjs": "^5.1.1-nightly.2",
"ethereumjs-util": "6.0.0",
"web3": "1.2.4",
"web3-core-requestmanager": "1.2.4"
"web3": "1.2.6",
"web3-core-requestmanager": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/geth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"fs-extra": "8.1.0",
"netcat": "1.3.5",
"semver": "5.6.0",
"web3": "1.2.4",
"web3": "1.2.6",
"web3-eth": "1.2.6",
"ws": "7.1.2"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/geth/src/devtxs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { __ } from 'embark-i18n';
import { Embark, EmbarkEvents } from "embark-core";
import { Logger } from "embark-logger";
import Web3 from "web3";
import { TransactionReceipt } from "web3-eth";
import constants from "embark-core/constants.json";
export default class DevTxs {
private embark: Embark;
Expand Down Expand Up @@ -65,7 +66,7 @@ export default class DevTxs {
matches: ["senddevtx"],
process: async (_cmd, callback) => {
this.logger.info(__("Sending a tx from the dev account..."));
const receipt = await this.sendTx();
const receipt = (await this.sendTx()) as TransactionReceipt;
callback(null, __("Transaction sent. Tx hash: ") + `\n${JSON.stringify(receipt && receipt.transactionHash)}`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/mocha-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"embark-utils": "^5.1.1-nightly.2",
"embarkjs": "^5.1.1-nightly.2",
"mocha": "6.2.2",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/profiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"ascii-table": "0.0.9",
"async": "2.6.1",
"core-js": "3.4.3",
"web3": "1.2.4",
"web3-utils": "1.2.4"
"web3": "1.2.6",
"web3-utils": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/rpc-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"embark-i18n": "^5.1.1-nightly.2",
"embark-logger": "^5.1.1-nightly.2",
"embark-utils": "^5.1.1-nightly.2",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"cross-env": "5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/scaffolding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"embark-logger": "^5.1.1-nightly.2",
"embark-utils": "^5.1.1-nightly.2",
"handlebars": "4.3.0",
"web3-utils": "1.2.4"
"web3-utils": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
9 changes: 2 additions & 7 deletions packages/plugins/solidity-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
"types": "./dist/lib/index.d.ts",
"embark-collective": {
"build:node": true,
"typecheck": {
"compilerOptions": {
"skipLibCheck": true
}
}
"typecheck": true
},
"scripts": {
"_build": "npm run solo -- build",
Expand All @@ -54,12 +50,11 @@
"core-js": "3.4.3",
"embark-utils": "^5.1.1-nightly.2",
"remix-tests": "0.1.24",
"web3": "1.2.4",
"web3": "1.2.6",
"yo-yoify": "4.3.0"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
"embark-utils": "^5.0.0-alpha.4",
"eslint": "5.7.0",
"mocha": "6.2.2",
"npm-run-all": "4.1.5",
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/solidity-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"composite": true,
"declarationDir": "./dist",
"rootDir": "./src",
"skipLibCheck": true,
"tsBuildInfoFile": "./node_modules/.cache/tsc/tsconfig.embark-solidity-tests.tsbuildinfo"
},
"extends": "../../../tsconfig.base.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/transaction-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"embark-utils": "^5.1.1-nightly.2",
"ethereumjs-tx": "1.3.7",
"ethereumjs-util": "6.0.0",
"web3": "1.2.4",
"web3-utils": "1.2.4"
"web3": "1.2.6",
"web3-utils": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/whisper-geth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"eslint": "5.7.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"engines": {
"node": ">=10.17.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/whisper-parity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"eslint": "5.7.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"engines": {
"node": ">=10.17.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/blockchain-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"@babel/runtime-corejs3": "7.7.4",
"core-js": "3.4.3",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/stack/contracts-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"embark-i18n": "^5.1.1-nightly.2",
"embark-logger": "^5.1.1-nightly.2",
"embark-utils": "^5.1.1-nightly.2",
"web3": "1.2.4",
"web3-utils": "1.2.4"
"web3": "1.2.6",
"web3-utils": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/library-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"eslint": "5.7.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"engines": {
"node": ">=10.17.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/stack/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"embark-utils": "^5.1.1-nightly.2",
"express": "4.17.1",
"express-ws": "4.0.0",
"web3-core-requestmanager": "1.2.4",
"web3-providers-ws": "1.2.4"
"web3-core-requestmanager": "1.2.6",
"web3-providers-ws": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/test-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"istanbul-reports": "2.2.4",
"mocha": "6.2.2",
"open": "6.4.0",
"web3": "1.2.4"
"web3": "1.2.6"
},
"devDependencies": {
"embark-solo": "^5.1.1-nightly.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It goes without saying, the entire web is JS. Look around you - JS. View the s

JavaScript, specifically Node, really is in everything we use, and that now also applies to our wonderful world of Cryptocurrencies.

As I mentioned briefly in my [***last*** article](/news/2019/11/28/nim-vs-crystal-part-3-cryto-dapps-p2p/), my ***next*** article series is going to be about building your first DApp – from start to finish. Inevitably, the frontend of our DApp needs to be able to communicate with the Ethereum Network. This is where [Web3.js](https://web3js.readthedocs.io/en/v1.2.4/index.html) comes into the mix. `Web3.js` is a collection of APIs allowing us such functionality as: Reading & Writing data from Smart Contracts, sending and receiving Ether, encrypting / decrypting wallets & data, and *a whole bunch* of other stuff too. Basically, *most* of the backend functionality available on the Ethereum Network natively becomes available for use in the browser.
As I mentioned briefly in my [***last*** article](/news/2019/11/28/nim-vs-crystal-part-3-cryto-dapps-p2p/), my ***next*** article series is going to be about building your first DApp – from start to finish. Inevitably, the frontend of our DApp needs to be able to communicate with the Ethereum Network. This is where [Web3.js](https://web3js.readthedocs.io/en/v1.2.6/index.html) comes into the mix. `Web3.js` is a collection of APIs allowing us such functionality as: Reading & Writing data from Smart Contracts, sending and receiving Ether, encrypting / decrypting wallets & data, and *a whole bunch* of other stuff too. Basically, *most* of the backend functionality available on the Ethereum Network natively becomes available for use in the browser.


This is how the `web3.js` library talks to the Ethereum Network:
Expand Down

0 comments on commit bf04670

Please sign in to comment.