Skip to content

Commit

Permalink
build: fix eth tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
  • Loading branch information
outSH committed Jul 13, 2023
1 parent c80ab41 commit ba29028
Show file tree
Hide file tree
Showing 25 changed files with 907 additions and 5,133 deletions.
11 changes: 0 additions & 11 deletions .taprc
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ files:
- ./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object.test.ts
- ./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/openapi/openapi-validation.test.ts
- ./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-invoke-contract-json-object.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v2.3.0-invoke-contract-json-object-endpoints.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v21.4.1-invoke-contract-json-object-endpoints.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object-endpoints.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object-endpoints.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/openapi/openapi-validation-no-keychain.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v2.3.0-invoke-contract-json-object.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v2.3.0-deploy-contract-from-json.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/openapi/openapi-validation.test.ts
- ./packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/integration/plugin-ledger-connector-ethereum/deploy-contract/v21.4.1-invoke-contract-json-object.test.ts
- ./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts
- ./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/own-htlc-endpoint.test.ts
- ./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/withdraw-counterparty-endpoint.test.ts
Expand Down
11 changes: 0 additions & 11 deletions jest.config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/cactus-plugin-ledger-connector-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
"rxjs": "7.8.1",
"sanitize-html": "2.7.0",
"typescript-optional": "2.0.1",
"web3": "4.0.3-dev.602dada.0",
"web3-eth-contract": "4.0.3-dev.602dada.0",
"web3-utils": "4.0.3-dev.602dada.0"
"web3": "4.0.3",
"web3-eth-contract": "4.0.3",
"web3-utils": "4.0.3"
},
"devDependencies": {
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
Expand All @@ -84,8 +84,8 @@
"@types/minimist": "1.2.2",
"@types/sanitize-html": "2.6.2",
"chalk": "4.1.2",
"web3-eth": "4.0.3-dev.602dada.0",
"web3-eth-accounts": "4.0.3-dev.602dada.0"
"web3-eth": "4.0.3",
"web3-eth-accounts": "4.0.3"
},
"engines": {
"node": ">=10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ export class PluginLedgerConnectorEthereum
public async shutdown(): Promise<void> {
this.log.info(`Shutting down ${this.className}...`);
const provider = this.web3.currentProvider;
if (provider && typeof provider == "object") {
if ("disconnect" in provider) {
provider.disconnect(1000, "shutdown");
}
try {
provider?.disconnect(1000, "shutdown");
} catch (error) {
this.log.info("Could not disconnect the provider - may not be supported");
}
}

Expand Down Expand Up @@ -818,10 +818,13 @@ export class PluginLedgerConnectorEthereum
);

const looseWeb3Eth = this.web3.eth as any;
const isSafeToCall = this.isSafeToCallObjectMethod(
looseWeb3Eth,
args.methodName,
);
// web3.eth methods in 4.X are stored in parent class
const isSafeToCall =
this.isSafeToCallObjectMethod(looseWeb3Eth, args.methodName) ||
this.isSafeToCallObjectMethod(
Object.getPrototypeOf(looseWeb3Eth),
args.methodName,
);
if (!isSafeToCall) {
throw new RuntimeError(
`Invalid method name provided in request. ${args.methodName} does not exist on the Web3.Eth object.`,
Expand Down
Loading

0 comments on commit ba29028

Please sign in to comment.