Skip to content

Commit

Permalink
build(deps): upgrade web3 project-wide to v1.6.1
Browse files Browse the repository at this point in the history
Update from Peter: I needed to do an unsafe cast because that was the least
bad option (other option was to make a breaking change in the quourm
connector's API).

The issue opened for tracking a proper resolution to this is titled as:
refactor(connector-quorum): make Web3BlockHeader.receiptRoot optional hyperledger-cacti#2555
and the link to it on GitHub is https://github.com/hyperledger/cacti/issues/2555

Fixes hyperledger-cacti#2332

Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
2 people authored and sandeepnRES committed Dec 21, 2023
1 parent abec3c1 commit b31e844
Show file tree
Hide file tree
Showing 15 changed files with 391 additions and 386 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"openapi-types": "9.1.0",
"typescript-optional": "2.0.1",
"uuid": "8.3.2",
"web3-core": "1.5.2",
"web3-utils": "1.5.2"
"web3-core": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@types/express": "4.17.13",
Expand Down
2 changes: 1 addition & 1 deletion examples/cactus-example-supply-chain-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"solc": "0.8.6",
"typescript-optional": "2.0.1",
"uuid": "8.3.2",
"web3-core": "1.5.2"
"web3-core": "1.6.1"
},
"devDependencies": {
"@types/express": "4.17.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-cmd-socketio-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"shelljs": "0.8.5",
"socket.io": "4.5.4",
"socket.io-client": "4.5.4",
"web3": "1.6.0",
"web3": "1.6.1",
"xmlhttprequest": "1.8.0"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/cactus-plugin-ledger-connector-besu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@
"rxjs": "7.8.1",
"socket.io-client": "4.5.4",
"typescript-optional": "2.0.1",
"web3": "1.5.2",
"web3-core": "1.5.2",
"web3-eth": "1.5.2",
"web3-utils": "1.5.2",
"web3": "1.6.1",
"web3-core": "1.6.1",
"web3-eth": "1.6.1",
"web3-utils": "1.6.1",
"web3js-quorum": "21.7.0-rc1"
},
"devDependencies": {
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1",
"@types/express": "4.17.13",
"socket.io": "4.5.4",
"web3-core": "1.5.2",
"web3-eth": "1.5.2"
"web3-core": "1.6.1",
"web3-eth": "1.6.1"
},
"engines": {
"node": ">=10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Logger, Checks } from "@hyperledger/cactus-common";
import { LogLevelDesc, LoggerProvider } from "@hyperledger/cactus-common";
import { WatchBlocksV1Progress } from "../generated/openapi/typescript-axios";
import { WatchBlocksV1 } from "../generated/openapi/typescript-axios";
import { Web3BlockHeader } from "../generated/openapi/typescript-axios";

export interface IWatchBlocksV1EndpointOptions {
logLevel?: LogLevelDesc;
Expand Down Expand Up @@ -43,12 +44,17 @@ export class WatchBlocksV1Endpoint {
public async subscribe(): Promise<void> {
const { socket, log, web3 } = this;
log.debug(`${WatchBlocksV1.Subscribe} => ${socket.id}`);

const sub = web3.eth.subscribe("newBlockHeaders", (ex, blockHeader) => {
log.debug("newBlockHeaders: Error=%o BlockHeader=%o", ex, blockHeader);
if (blockHeader) {
const next: WatchBlocksV1Progress = {
blockHeader,
// Cast needed because somewhere between Web3 v1.5.2 and v1.6.1 they
// made the receiptRoot property of the BlockHeader type optional.
// This could be accopmanied by a breaking change in their code or
// it could've been just a mistake in their typings that they corrected.
// Either way, with the next major release, we need to make it optional
// in our API specs as well so that they match up.
blockHeader: (blockHeader as unknown as Web3BlockHeader),
};
socket.emit(WatchBlocksV1.Next, next);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/cactus-plugin-ledger-connector-quorum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
"rxjs": "7.8.1",
"sanitize-html": "2.7.0",
"typescript-optional": "2.0.1",
"web3": "1.5.2",
"web3-eth-contract": "1.5.2",
"web3-utils": "1.5.2"
"web3": "1.6.1",
"web3-eth-contract": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
Expand All @@ -79,7 +79,7 @@
"@types/minimist": "1.2.2",
"@types/sanitize-html": "2.6.2",
"chalk": "4.1.2",
"web3-eth": "1.5.2"
"web3-eth": "1.6.1"
},
"engines": {
"node": ">=10",
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-ledger-connector-xdai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"openapi-types": "9.1.0",
"prom-client": "13.2.0",
"typescript-optional": "2.0.1",
"web3": "1.5.2",
"web3-utils": "1.5.2"
"web3": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-plugin-odap-hermes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"socket.io": "4.5.4",
"sqlite3": "5.1.5",
"typescript-optional": "2.0.1",
"web3": "1.5.2",
"web3-utils": "1.5.2"
"web3": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@types/crypto-js": "4.0.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/cactus-plugin-persistence-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"run-time-error": "1.4.0",
"sanitize-html": "2.7.0",
"uuid": "8.3.2",
"web3-utils": "1.5.2"
"web3-utils": "1.6.1"
},
"devDependencies": {
"@hyperledger/cactus-api-client": "2.0.0-alpha.1",
Expand All @@ -76,9 +76,9 @@
"@types/pg": "8.6.5",
"jest-extended": "2.0.0",
"rxjs": "7.8.1",
"web3": "1.5.2",
"web3-core": "1.5.2",
"web3-eth": "1.5.2"
"web3": "1.6.1",
"web3-core": "1.6.1",
"web3-eth": "1.6.1"
},
"engines": {
"node": ">=10",
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-test-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@hyperledger/cactus-core-api": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-consortium-manual": "2.0.0-alpha.1",
"jose": "4.9.2",
"web3": "1.5.2"
"web3": "1.6.1"
},
"devDependencies": {
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/cactus-test-plugin-htlc-eth-besu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1",
"axios": "0.21.4",
"key-encoder": "2.0.3",
"web3": "1.5.2",
"web3": "1.6.1",
"web3js-quorum": "21.7.0-rc1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1",
"@hyperledger/cactus-verifier-client": "2.0.0-alpha.1",
"key-encoder": "2.0.3",
"web3": "1.5.2",
"web3": "1.6.1",
"web3js-quorum": "21.7.0-rc1"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-ledger-connector-quorum": "2.0.0-alpha.1",
"@hyperledger/cactus-verifier-client": "2.0.0-alpha.1",
"web3": "1.5.2",
"web3-utils": "1.5.2"
"web3": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/cactus-test-tooling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
"temp": "0.9.4",
"typescript-optional": "2.0.1",
"uuid": "8.3.2",
"web3": "1.5.2",
"web3-core": "1.5.2",
"web3-utils": "1.5.2"
"web3": "1.6.1",
"web3-core": "1.6.1",
"web3-utils": "1.6.1"
},
"devDependencies": {
"@types/dockerode": "3.2.7",
Expand Down
Loading

0 comments on commit b31e844

Please sign in to comment.