From 11dacbcef25ba3e7fa9f9880f60655be1e2396ef Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Mon, 14 Oct 2024 15:59:51 -0700 Subject: [PATCH] fix(besu): deployContractSolBytecodeNoKeychainV1 requires keychainId In the DeployContractSolidityBytecodeNoKeychainV1Request of `packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.tpl.json` there are parameters that are required despite the entire point of this operation is to not need them (e.g. keychainId and contract JSON object). Fixes #3586 Signed-off-by: Peter Somogyvari --- .../openapi/go-client/api/openapi.yaml | 8 ---- ...olidity_bytecode_no_keychain_v1_request.go | 37 -------------- .../src/main/json/openapi.json | 7 --- .../src/main/json/openapi.tpl.json | 7 --- ...y_bytecode_no_keychain_v1_request_pb.proto | 3 -- .../generated/openapi/typescript-axios/api.ts | 6 --- ...dity_bytecode_no_keychain_v1_request_pb.ts | 23 --------- .../deploy-contract-v1-keychain.ts | 4 +- .../deploy-contract-v1-no-keychain.ts | 48 +++---------------- .../impl/transact-v1/transact-v1-signed.ts | 6 +-- .../plugin-ledger-connector-besu.ts | 40 ++++++---------- ...-solidity-bytecode-no-keychain-endpoint.ts | 4 +- ...loy-contract-from-json-no-keychain.test.ts | 2 - 13 files changed, 28 insertions(+), 167 deletions(-) diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml index d03386aefd..50e642bff4 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -1024,7 +1024,6 @@ components: web3SigningCredential: type: null contractName: contractName - contractJSONString: contractJSONString gasPrice: gasPrice properties: contractName: @@ -1038,11 +1037,6 @@ components: items: {} nullable: false type: array - contractJSONString: - description: "For use when not using keychain, pass the contract in as this\ - \ string variable" - nullable: false - type: string constructorArgs: default: [] items: {} @@ -1076,9 +1070,7 @@ components: - bytecode - constructorArgs - contractAbi - - contractJson - contractName - - keychainId - web3SigningCredential type: object DeployContractSolidityBytecodeV1Response: diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go index f53c7825c4..a23d97391c 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go @@ -23,8 +23,6 @@ type DeployContractSolidityBytecodeNoKeychainV1Request struct { ContractName string `json:"contractName"` // The application binary interface of the solidity contract ContractAbi []interface{} `json:"contractAbi"` - // For use when not using keychain, pass the contract in as this string variable - ContractJSONString *string `json:"contractJSONString,omitempty"` ConstructorArgs []interface{} `json:"constructorArgs"` Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode @@ -110,38 +108,6 @@ func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetContractAbi(v []i o.ContractAbi = v } -// GetContractJSONString returns the ContractJSONString field value if set, zero value otherwise. -func (o *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractJSONString() string { - if o == nil || IsNil(o.ContractJSONString) { - var ret string - return ret - } - return *o.ContractJSONString -} - -// GetContractJSONStringOk returns a tuple with the ContractJSONString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractJSONStringOk() (*string, bool) { - if o == nil || IsNil(o.ContractJSONString) { - return nil, false - } - return o.ContractJSONString, true -} - -// HasContractJSONString returns a boolean if a field has been set. -func (o *DeployContractSolidityBytecodeNoKeychainV1Request) HasContractJSONString() bool { - if o != nil && !IsNil(o.ContractJSONString) { - return true - } - - return false -} - -// SetContractJSONString gets a reference to the given string and assigns it to the ContractJSONString field. -func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetContractJSONString(v string) { - o.ContractJSONString = &v -} - // GetConstructorArgs returns the ConstructorArgs field value func (o *DeployContractSolidityBytecodeNoKeychainV1Request) GetConstructorArgs() []interface{} { if o == nil { @@ -354,9 +320,6 @@ func (o DeployContractSolidityBytecodeNoKeychainV1Request) ToMap() (map[string]i toSerialize := map[string]interface{}{} toSerialize["contractName"] = o.ContractName toSerialize["contractAbi"] = o.ContractAbi - if !IsNil(o.ContractJSONString) { - toSerialize["contractJSONString"] = o.ContractJSONString - } toSerialize["constructorArgs"] = o.ConstructorArgs toSerialize["web3SigningCredential"] = o.Web3SigningCredential toSerialize["bytecode"] = o.Bytecode diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json index c33949faef..545d518403 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json @@ -766,10 +766,8 @@ "required": [ "contractName", "contractAbi", - "contractJson", "bytecode", "web3SigningCredential", - "keychainId", "constructorArgs" ], "additionalProperties": false, @@ -787,11 +785,6 @@ "items": {}, "nullable": false }, - "contractJSONString": { - "description": "For use when not using keychain, pass the contract in as this string variable", - "nullable": false, - "type": "string" - }, "constructorArgs": { "type": "array", "items": {}, diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.tpl.json b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.tpl.json index c33949faef..545d518403 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.tpl.json +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.tpl.json @@ -766,10 +766,8 @@ "required": [ "contractName", "contractAbi", - "contractJson", "bytecode", "web3SigningCredential", - "keychainId", "constructorArgs" ], "additionalProperties": false, @@ -787,11 +785,6 @@ "items": {}, "nullable": false }, - "contractJSONString": { - "description": "For use when not using keychain, pass the contract in as this string variable", - "nullable": false, - "type": "string" - }, "constructorArgs": { "type": "array", "items": {}, diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto index 76b1407497..e28f470ea6 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto @@ -25,9 +25,6 @@ message DeployContractSolidityBytecodeNoKeychainV1RequestPB { // The application binary interface of the solidity contract repeated google.protobuf.Any contractAbi = 512852493; - // For use when not using keychain, pass the contract in as this string variable - string contractJSONString = 405816750; - repeated google.protobuf.Any constructorArgs = 336490508; Web3SigningCredentialPB web3SigningCredential = 451211679; diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts index 3befbde4ca..31cb240ce2 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -150,12 +150,6 @@ export interface DeployContractSolidityBytecodeNoKeychainV1Request { * @memberof DeployContractSolidityBytecodeNoKeychainV1Request */ 'contractAbi': Array; - /** - * For use when not using keychain, pass the contract in as this string variable - * @type {string} - * @memberof DeployContractSolidityBytecodeNoKeychainV1Request - */ - 'contractJSONString'?: string; /** * * @type {Array} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.ts index df13cc00a0..6579e0eb6c 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.ts @@ -13,7 +13,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { constructor(data?: any[] | { contractName?: string; contractAbi?: dependency_1.google.protobuf.Any[]; - contractJSONString?: string; constructorArgs?: dependency_1.google.protobuf.Any[]; web3SigningCredential?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; bytecode?: string; @@ -31,9 +30,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { if ("contractAbi" in data && data.contractAbi != undefined) { this.contractAbi = data.contractAbi; } - if ("contractJSONString" in data && data.contractJSONString != undefined) { - this.contractJSONString = data.contractJSONString; - } if ("constructorArgs" in data && data.constructorArgs != undefined) { this.constructorArgs = data.constructorArgs; } @@ -69,12 +65,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { set contractAbi(value: dependency_1.google.protobuf.Any[]) { pb_1.Message.setRepeatedWrapperField(this, 512852493, value); } - get contractJSONString() { - return pb_1.Message.getFieldWithDefault(this, 405816750, "") as string; - } - set contractJSONString(value: string) { - pb_1.Message.setField(this, 405816750, value); - } get constructorArgs() { return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 336490508) as dependency_1.google.protobuf.Any[]; } @@ -126,7 +116,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { static fromObject(data: { contractName?: string; contractAbi?: ReturnType[]; - contractJSONString?: string; constructorArgs?: ReturnType[]; web3SigningCredential?: ReturnType; bytecode?: string; @@ -142,9 +131,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { if (data.contractAbi != null) { message.contractAbi = data.contractAbi.map(item => dependency_1.google.protobuf.Any.fromObject(item)); } - if (data.contractJSONString != null) { - message.contractJSONString = data.contractJSONString; - } if (data.constructorArgs != null) { message.constructorArgs = data.constructorArgs.map(item => dependency_1.google.protobuf.Any.fromObject(item)); } @@ -172,7 +158,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { const data: { contractName?: string; contractAbi?: ReturnType[]; - contractJSONString?: string; constructorArgs?: ReturnType[]; web3SigningCredential?: ReturnType; bytecode?: string; @@ -187,9 +172,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { if (this.contractAbi != null) { data.contractAbi = this.contractAbi.map((item: dependency_1.google.protobuf.Any) => item.toObject()); } - if (this.contractJSONString != null) { - data.contractJSONString = this.contractJSONString; - } if (this.constructorArgs != null) { data.constructorArgs = this.constructorArgs.map((item: dependency_1.google.protobuf.Any) => item.toObject()); } @@ -221,8 +203,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { writer.writeString(328784197, this.contractName); if (this.contractAbi.length) writer.writeRepeatedMessage(512852493, this.contractAbi, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); - if (this.contractJSONString.length) - writer.writeString(405816750, this.contractJSONString); if (this.constructorArgs.length) writer.writeRepeatedMessage(336490508, this.constructorArgs, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); if (this.has_web3SigningCredential) @@ -252,9 +232,6 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { case 512852493: reader.readMessage(message.contractAbi, () => pb_1.Message.addToRepeatedWrapperField(message, 512852493, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); break; - case 405816750: - message.contractJSONString = reader.readString(); - break; case 336490508: reader.readMessage(message.constructorArgs, () => pb_1.Message.addToRepeatedWrapperField(message, 336490508, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); break; diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-keychain.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-keychain.ts index 4aaae48d76..bcbdc8ff50 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-keychain.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-keychain.ts @@ -35,11 +35,11 @@ export async function deployContractV1Keychain( }, req: DeployContractSolidityBytecodeV1Request, ): Promise { - const fnTag = `deployContract()`; + const fnTag = `deployContractV1Keychain()`; Checks.truthy(req, `${fnTag} req`); const log = LoggerProvider.getOrCreate({ - label: "getBlockV1Impl()", + label: fnTag, level: ctx.logLevel, }); diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-no-keychain.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-no-keychain.ts index a980430d0d..8fe1d3a2d0 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-no-keychain.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/deploy-contract-v1/deploy-contract-v1-no-keychain.ts @@ -15,15 +15,6 @@ import { PluginRegistry } from "@hyperledger/cactus-core"; import { PrometheusExporter } from "../../prometheus-exporter/prometheus-exporter"; import Web3 from "web3"; import { transactV1Impl } from "../transact-v1/transact-v1-impl"; -import createHttpError from "http-errors"; -import { Contract } from "web3-eth-contract"; - -export interface IDeployContractV1NoKeychainResponse { - contractName: string; - contract: Contract; - contractJsonString: string; - deployResponse: DeployContractSolidityBytecodeV1Response; -} export async function deployContractV1NoKeychain( ctx: { @@ -33,20 +24,18 @@ export async function deployContractV1NoKeychain( readonly logLevel: LogLevelDesc; }, req: DeployContractSolidityBytecodeNoKeychainV1Request, -): Promise { +): Promise { const fnTag = `deployContractNoKeychain()`; Checks.truthy(req, `${fnTag} req`); const log = LoggerProvider.getOrCreate({ - label: "getBlockV1Impl()", + label: "deployContractV1NoKeychain()", level: ctx.logLevel, }); if (isWeb3SigningCredentialNone(req.web3SigningCredential)) { throw new Error(`${fnTag} Cannot deploy contract with pre-signed TX`); } - const { contractName, contractJSONString } = req; - const networkId = await ctx.web3.eth.net.getId(); const tmpContract = new ctx.web3.eth.Contract(req.contractAbi); const deployment = tmpContract.deploy({ @@ -95,33 +84,8 @@ export async function deployContractV1NoKeychain( Checks.truthy(contractAddress, `deployContractNoKeychain():contractAddress`); - if (contractJSONString) { - const networkInfo = { address: contractAddress }; - const contractJSON = JSON.parse(contractJSONString); - log.debug("Contract JSON: \n%o", JSON.stringify(contractJSON)); - const contract = new ctx.web3.eth.Contract( - contractJSON.abi, - contractAddress || " ", - ); - // this.contracts[contractName] = contract; - const network = { [networkId]: networkInfo }; - contractJSON.networks = network; - - const deployResponse: DeployContractSolidityBytecodeV1Response = { - transactionReceipt: runTxResponse.transactionReceipt, - }; - const deployContractV1NoKeychainResponse: IDeployContractV1NoKeychainResponse = - { - contractName: contractName, - contract: contract, - contractJsonString: contractJSONString, - deployResponse: deployResponse, - }; - return deployContractV1NoKeychainResponse; - } else { - const errorMessage = - `${fnTag} Cannot create an instance of the contract instance because` + - `the contractName in the request does not exist on the keychain`; - throw new createHttpError[400](errorMessage); - } + const res: DeployContractSolidityBytecodeV1Response = { + transactionReceipt: runTxResponse.transactionReceipt, + }; + return res; } diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/transact-v1/transact-v1-signed.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/transact-v1/transact-v1-signed.ts index b8e6a9ec54..a22daca130 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/transact-v1/transact-v1-signed.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/transact-v1/transact-v1-signed.ts @@ -29,7 +29,7 @@ export async function transactV1Signed( `${fnTag}:req.transactionConfig.rawTransaction`, ); const log = LoggerProvider.getOrCreate({ - label: "getBlockGrpc()", + label: "transactV1Signed()", level: ctx.logLevel, }); const rawTx = req.transactionConfig.rawTransaction as string; @@ -53,7 +53,7 @@ export async function getTxReceipt( const fnTag = `getTxReceipt()`; const log = LoggerProvider.getOrCreate({ - label: "getBlockGrpc()", + label: "getTxReceipt", level: ctx.logLevel, }); log.debug("Received preliminary receipt from Besu node."); @@ -103,7 +103,7 @@ export async function pollForTxReceipt( ): Promise { const fnTag = `pollForTxReceipt()`; const log = LoggerProvider.getOrCreate({ - label: "getBlockGrpc()", + label: "pollForTxReceipt()", level: ctx.logLevel, }); let txReceipt; 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 2cb3d80e36..36aca2bcae 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 @@ -102,14 +102,8 @@ import { BesuGrpcSvcOpenApi } from "./grpc-services/besu-grpc-svc-open-api"; import { BesuGrpcSvcStreams } from "./grpc-services/besu-grpc-svc-streams"; import { getBlockV1Http } from "./impl/get-block-v1/get-block-v1-http"; import { transactV1Impl } from "./impl/transact-v1/transact-v1-impl"; -import { - IDeployContractV1KeychainResponse, - deployContractV1Keychain, -} from "./impl/deploy-contract-v1/deploy-contract-v1-keychain"; -import { - IDeployContractV1NoKeychainResponse, - deployContractV1NoKeychain, -} from "./impl/deploy-contract-v1/deploy-contract-v1-no-keychain"; +import { deployContractV1Keychain } from "./impl/deploy-contract-v1/deploy-contract-v1-keychain"; +import { deployContractV1NoKeychain } from "./impl/deploy-contract-v1/deploy-contract-v1-no-keychain"; export const E_KEYCHAIN_NOT_FOUND = "cactus.connector.besu.keychain_not_found"; @@ -166,6 +160,7 @@ export class PluginLedgerConnectorBesu const label = this.className; this.log = LoggerProvider.getOrCreate({ level: this.logLevel, label }); + this.log.debug("Creating WebsocketProvider for %s", options.rpcApiWsHost); this.web3Provider = new Web3.providers.WebsocketProvider( this.options.rpcApiWsHost, ); @@ -203,6 +198,9 @@ export class PluginLedgerConnectorBesu public async onPluginInit(): Promise { this.web3Quorum = Web3JsQuorum(this.web3); + this.log.info("onPluginInit() querying networkId..."); + const networkId = await this.web3.eth.net.getId(); + this.log.info("onPluginInit() obtained networkId: %d", networkId); } public async shutdown(): Promise { @@ -639,17 +637,12 @@ export class PluginLedgerConnectorBesu logLevel: this.logLevel, }; - const deployContractV1KeychainResponse: IDeployContractV1KeychainResponse = - await deployContractV1Keychain(ctx, req); - if ( - deployContractV1KeychainResponse.status && - deployContractV1KeychainResponse.contractAddress && - deployContractV1KeychainResponse.contract - ) { - this.contracts[deployContractV1KeychainResponse.contractName] = - deployContractV1KeychainResponse.contract; + const res = await deployContractV1Keychain(ctx, req); + const { status, contractAddress, contractName, contract } = res; + if (status && contractAddress && contract) { + this.contracts[contractName] = contract; } - return deployContractV1KeychainResponse.deployResponse; + return res.deployResponse; } public async deployContractNoKeychain( @@ -661,13 +654,10 @@ export class PluginLedgerConnectorBesu web3: this.web3, logLevel: this.logLevel, }; - const deployContractV1NoKeychainResponse: IDeployContractV1NoKeychainResponse = - await deployContractV1NoKeychain(ctx, req); - if (deployContractV1NoKeychainResponse.contractJsonString) { - this.contracts[deployContractV1NoKeychainResponse.contractName] = - deployContractV1NoKeychainResponse.contract; - } - return deployContractV1NoKeychainResponse.deployResponse; + this.log.debug("Invoking deployContractV1NoKeychain()..."); + const res = deployContractV1NoKeychain(ctx, req); + this.log.debug("Ran deployContractV1NoKeychain() OK"); + return res; } public async signTransaction( diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts index 6d34e0a6f3..8df4ff857a 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts @@ -20,7 +20,7 @@ import { } from "@hyperledger/cactus-core"; import { PluginLedgerConnectorBesu } from "../plugin-ledger-connector-besu"; -import { DeployContractSolidityBytecodeV1Request } from "../generated/openapi/typescript-axios"; +import type { DeployContractSolidityBytecodeNoKeychainV1Request } from "../generated/openapi/typescript-axios"; import OAS from "../../json/openapi.json"; export interface IDeployContractSolidityBytecodeNoKeychainOptions { @@ -96,7 +96,7 @@ export class DeployContractSolidityBytecodeNoKeychainEndpoint const fnTag = `${this.className}#handleRequest()`; const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; this.log.debug(reqTag); - const reqBody: DeployContractSolidityBytecodeV1Request = req.body; + const reqBody: DeployContractSolidityBytecodeNoKeychainV1Request = req.body; try { const resBody = await this.options.connector.deployContractNoKeychain(reqBody); diff --git a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-deploy-contract-from-json-no-keychain.test.ts b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-deploy-contract-from-json-no-keychain.test.ts index 44a64dc8b7..2b01785d90 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-deploy-contract-from-json-no-keychain.test.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-deploy-contract-from-json-no-keychain.test.ts @@ -186,11 +186,9 @@ describe("PluginLedgerConnectorBesu", () => { }); test("deploys contract via .json file", async () => { - const contractJSONString = JSON.stringify(HelloWorldContractJson); const deployOut = await connector.deployContractNoKeychain({ contractName: HelloWorldContractJson.contractName, contractAbi: HelloWorldContractJson.abi, - contractJSONString: contractJSONString, constructorArgs: [], web3SigningCredential: { ethAccount: firstHighNetWorthAccount,