From a4cb63b483d61578dd0d356fc0c9c20d8a2024e0 Mon Sep 17 00:00:00 2001 From: AzaharaC Date: Wed, 5 May 2021 13:15:27 +0200 Subject: [PATCH] fix(connector-besu): removed repeated check Signed-off-by: AzaharaC --- .../main/typescript/plugin-ledger-connector-besu.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts index fd25b46dba..ca849bed80 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts @@ -557,11 +557,7 @@ export class PluginLedgerConnectorBesu keychainPlugin, `${fnTag} keychain for ID:"${req.keychainId}"`, ); - if (!keychainPlugin.has(req.contractName)) { - throw new Error( - `${fnTag} Cannot create an instance of the contract because the contractName and the contractName on the keychain does not match`, - ); - } + const networkId = await this.web3.eth.net.getId(); const tmpContract = new this.web3.eth.Contract(req.contractAbi); @@ -621,6 +617,10 @@ export class PluginLedgerConnectorBesu keychainPlugin.set(contractName, contractJSON); } + } else { + throw new Error( + `${fnTag} Cannot create an instance of the contract because the contractName and the contractName on the keychain does not match`, + ); } return runTxResponse; }