From 1d432972c6ff2c829e0d61ccfac8aaef75d068b2 Mon Sep 17 00:00:00 2001 From: jagpreetsinghsasan Date: Thu, 20 Jun 2024 07:16:25 +0000 Subject: [PATCH] feat(connector): remove hard dependency on keychain Primary Changes --------------- 1. Updated besu connector to remove hard dependency on keychain Changes required to incorporate 1) 2. Updated openapi.json file of the above mentioned connectors to include the new no-keychain endpoints 3. Generated code and updated related web-services for the same Fixes #963 Signed-off-by: jagpreetsinghsasan --- .../src/main/json/openapi.json | 101 ++++ .../src/main/json/openapi.tpl.json | 101 ++++ .../openapi/.openapi-generator/FILES | 1 + ...y_bytecode_no_keychain_v1_request_pb.proto | 47 ++ .../openapi/services/default_service.proto | 8 + .../generated/openapi/typescript-axios/api.ts | 134 +++++ ...dity_bytecode_no_keychain_v1_request_pb.ts | 291 +++++++++++ .../protoc-gen-ts/services/default_service.ts | 318 ++++++----- .../grpc-services/besu-grpc-svc-open-api.ts | 14 + .../plugin-ledger-connector-besu.ts | 87 ++++ ...-solidity-bytecode-no-keychain-endpoint.ts | 109 ++++ ...loy-contract-from-json-no-keychain.test.ts | 492 ++++++++++++++++++ ...private-deploy-contract-from-json.test.ts} | 0 13 files changed, 1586 insertions(+), 117 deletions(-) create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto create mode 100644 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 create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-no-keychain.test.ts rename packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/{private-deploy-contract-from-json-cactus.test.ts => private-deploy-contract-from-json.test.ts} (100%) 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 eebd7448249..caf949a8ba2 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 @@ -761,6 +761,73 @@ } } }, + "DeployContractSolidityBytecodeNoKeychainV1Request": { + "type": "object", + "required": [ + "contractName", + "contractAbi", + "contractJson", + "bytecode", + "web3SigningCredential", + "keychainId", + "constructorArgs" + ], + "additionalProperties": false, + "properties": { + "contractName": { + "type": "string", + "description": "The contract name for retrieve the contracts json on the keychain.", + "minLength": 1, + "maxLength": 100, + "nullable": false + }, + "contractAbi": { + "description": "The application binary interface of the solidity contract", + "type": "array", + "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": {}, + "default": [] + }, + "web3SigningCredential": { + "$ref": "#/components/schemas/Web3SigningCredential", + "nullable": false + }, + "bytecode": { + "type": "string", + "nullable": false, + "minLength": 1, + "maxLength": 24576, + "description": "See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode" + }, + "gas": { + "type": "number", + "nullable": false + }, + "gasPrice": { + "type": "string", + "nullable": false + }, + "timeoutMs": { + "type": "number", + "description": "The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing.", + "minimum": 0, + "default": 60000, + "nullable": false + }, + "privateTransactionConfig": { + "$ref": "#/components/schemas/BesuPrivateTransactionConfig" + } + } + }, "DeployContractSolidityBytecodeV1Response": { "type": "object", "required": ["transactionReceipt"], @@ -1016,6 +1083,40 @@ } } }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain": { + "post": { + "x-hyperledger-cacti": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain" + } + }, + "operationId": "deployContractSolBytecodeNoKeychainV1", + "summary": "Deploys the bytecode of a Solidity contract without the need of keychain", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractSolidityBytecodeNoKeychainV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractSolidityBytecodeV1Response" + } + } + } + } + } + } + }, "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance": { "post": { "x-hyperledger-cacti": { 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 eebd7448249..caf949a8ba2 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 @@ -761,6 +761,73 @@ } } }, + "DeployContractSolidityBytecodeNoKeychainV1Request": { + "type": "object", + "required": [ + "contractName", + "contractAbi", + "contractJson", + "bytecode", + "web3SigningCredential", + "keychainId", + "constructorArgs" + ], + "additionalProperties": false, + "properties": { + "contractName": { + "type": "string", + "description": "The contract name for retrieve the contracts json on the keychain.", + "minLength": 1, + "maxLength": 100, + "nullable": false + }, + "contractAbi": { + "description": "The application binary interface of the solidity contract", + "type": "array", + "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": {}, + "default": [] + }, + "web3SigningCredential": { + "$ref": "#/components/schemas/Web3SigningCredential", + "nullable": false + }, + "bytecode": { + "type": "string", + "nullable": false, + "minLength": 1, + "maxLength": 24576, + "description": "See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode" + }, + "gas": { + "type": "number", + "nullable": false + }, + "gasPrice": { + "type": "string", + "nullable": false + }, + "timeoutMs": { + "type": "number", + "description": "The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing.", + "minimum": 0, + "default": 60000, + "nullable": false + }, + "privateTransactionConfig": { + "$ref": "#/components/schemas/BesuPrivateTransactionConfig" + } + } + }, "DeployContractSolidityBytecodeV1Response": { "type": "object", "required": ["transactionReceipt"], @@ -1016,6 +1083,40 @@ } } }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain": { + "post": { + "x-hyperledger-cacti": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain" + } + }, + "operationId": "deployContractSolBytecodeNoKeychainV1", + "summary": "Deploys the bytecode of a Solidity contract without the need of keychain", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractSolidityBytecodeNoKeychainV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractSolidityBytecodeV1Response" + } + } + } + } + } + } + }, "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance": { "post": { "x-hyperledger-cacti": { diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES index 2683bce8e5e..54faef8d5c5 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES @@ -3,6 +3,7 @@ models/besu_private_transaction_config_pb.proto models/besu_transaction_config_pb.proto models/besu_transaction_config_to_pb.proto models/consistency_strategy_pb.proto +models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto models/deploy_contract_solidity_bytecode_v1_request_pb.proto models/deploy_contract_solidity_bytecode_v1_response_pb.proto models/eth_contract_invocation_type_pb.proto 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 new file mode 100644 index 00000000000..ea3ff925749 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto @@ -0,0 +1,47 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/besu_private_transaction_config_pb.proto"; +import "models/web3_signing_credential_pb.proto"; + +message DeployContractSolidityBytecodeNoKeychainV1RequestPB { + + // The contract name for retrieve the contracts json on the keychain. + string contractName = 328784197; + + // 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; + + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + string bytecode = 256554254; + + float gas = 102105; + + string gasPrice = 5271059; + + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + float timeoutMs = 51479271; + + BesuPrivateTransactionConfigPB privateTransactionConfig = 276796542; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto index 8e076341ab0..9be800ab015 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto @@ -13,6 +13,7 @@ syntax = "proto3"; package org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice; import "google/protobuf/empty.proto"; +import "models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto"; import "models/deploy_contract_solidity_bytecode_v1_request_pb.proto"; import "models/deploy_contract_solidity_bytecode_v1_response_pb.proto"; import "models/get_balance_v1_request_pb.proto"; @@ -33,6 +34,8 @@ import "models/sign_transaction_request_pb.proto"; import "models/sign_transaction_response_pb.proto"; service DefaultService { + rpc DeployContractSolBytecodeNoKeychainV1 (DeployContractSolBytecodeNoKeychainV1Request) returns (DeployContractSolidityBytecodeV1ResponsePB); + rpc DeployContractSolBytecodeV1 (DeployContractSolBytecodeV1Request) returns (DeployContractSolidityBytecodeV1ResponsePB); rpc GetBalanceV1 (GetBalanceV1Request) returns (GetBalanceV1ResponsePB); @@ -57,6 +60,11 @@ service DefaultService { } +message DeployContractSolBytecodeNoKeychainV1Request { + DeployContractSolidityBytecodeNoKeychainV1RequestPB deployContractSolidityBytecodeNoKeychainV1RequestPB = 1; + +} + message DeployContractSolBytecodeV1Request { DeployContractSolidityBytecodeV1RequestPB deployContractSolidityBytecodeV1RequestPB = 1; 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 db5621f40ee..9376e05ff1f 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 @@ -132,6 +132,73 @@ export interface ConsistencyStrategy { } +/** + * + * @export + * @interface DeployContractSolidityBytecodeNoKeychainV1Request + */ +export interface DeployContractSolidityBytecodeNoKeychainV1Request { + /** + * The contract name for retrieve the contracts json on the keychain. + * @type {string} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'contractName': string; + /** + * The application binary interface of the solidity contract + * @type {Array} + * @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} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'constructorArgs': Array; + /** + * + * @type {Web3SigningCredential} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'web3SigningCredential': Web3SigningCredential; + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @type {string} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'bytecode': string; + /** + * + * @type {number} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'gas'?: number; + /** + * + * @type {string} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'gasPrice'?: string; + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * @type {number} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'timeoutMs'?: number; + /** + * + * @type {BesuPrivateTransactionConfig} + * @memberof DeployContractSolidityBytecodeNoKeychainV1Request + */ + 'privateTransactionConfig'?: BesuPrivateTransactionConfig; +} /** * * @export @@ -1302,6 +1369,40 @@ export interface Web3TransactionReceipt { */ export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @summary Deploys the bytecode of a Solidity contract without the need of keychain + * @param {DeployContractSolidityBytecodeNoKeychainV1Request} [deployContractSolidityBytecodeNoKeychainV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deployContractSolBytecodeNoKeychainV1: async (deployContractSolidityBytecodeNoKeychainV1Request?: DeployContractSolidityBytecodeNoKeychainV1Request, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(deployContractSolidityBytecodeNoKeychainV1Request, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary Deploys the bytecode of a Solidity contract. @@ -1680,6 +1781,17 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati export const DefaultApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) return { + /** + * + * @summary Deploys the bytecode of a Solidity contract without the need of keychain + * @param {DeployContractSolidityBytecodeNoKeychainV1Request} [deployContractSolidityBytecodeNoKeychainV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request?: DeployContractSolidityBytecodeNoKeychainV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary Deploys the bytecode of a Solidity contract. @@ -1809,6 +1921,16 @@ export const DefaultApiFp = function(configuration?: Configuration) { export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = DefaultApiFp(configuration) return { + /** + * + * @summary Deploys the bytecode of a Solidity contract without the need of keychain + * @param {DeployContractSolidityBytecodeNoKeychainV1Request} [deployContractSolidityBytecodeNoKeychainV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request?: DeployContractSolidityBytecodeNoKeychainV1Request, options?: any): AxiosPromise { + return localVarFp.deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request, options).then((request) => request(axios, basePath)); + }, /** * * @summary Deploys the bytecode of a Solidity contract. @@ -1927,6 +2049,18 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @extends {BaseAPI} */ export class DefaultApi extends BaseAPI { + /** + * + * @summary Deploys the bytecode of a Solidity contract without the need of keychain + * @param {DeployContractSolidityBytecodeNoKeychainV1Request} [deployContractSolidityBytecodeNoKeychainV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request?: DeployContractSolidityBytecodeNoKeychainV1Request, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).deployContractSolBytecodeNoKeychainV1(deployContractSolidityBytecodeNoKeychainV1Request, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Deploys the bytecode of a Solidity contract. 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 new file mode 100644 index 00000000000..df13cc00a0c --- /dev/null +++ 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 @@ -0,0 +1,291 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./besu_private_transaction_config_pb"; +import * as dependency_3 from "./web3_signing_credential_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class DeployContractSolidityBytecodeNoKeychainV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + 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; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [512852493, 336490508], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("contractName" in data && data.contractName != undefined) { + this.contractName = data.contractName; + } + 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; + } + if ("web3SigningCredential" in data && data.web3SigningCredential != undefined) { + this.web3SigningCredential = data.web3SigningCredential; + } + if ("bytecode" in data && data.bytecode != undefined) { + this.bytecode = data.bytecode; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("gasPrice" in data && data.gasPrice != undefined) { + this.gasPrice = data.gasPrice; + } + if ("timeoutMs" in data && data.timeoutMs != undefined) { + this.timeoutMs = data.timeoutMs; + } + if ("privateTransactionConfig" in data && data.privateTransactionConfig != undefined) { + this.privateTransactionConfig = data.privateTransactionConfig; + } + } + } + get contractName() { + return pb_1.Message.getFieldWithDefault(this, 328784197, "") as string; + } + set contractName(value: string) { + pb_1.Message.setField(this, 328784197, value); + } + get contractAbi() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 512852493) as dependency_1.google.protobuf.Any[]; + } + 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[]; + } + set constructorArgs(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 336490508, value); + } + get web3SigningCredential() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB, 451211679) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + } + set web3SigningCredential(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB) { + pb_1.Message.setWrapperField(this, 451211679, value); + } + get has_web3SigningCredential() { + return pb_1.Message.getField(this, 451211679) != null; + } + get bytecode() { + return pb_1.Message.getFieldWithDefault(this, 256554254, "") as string; + } + set bytecode(value: string) { + pb_1.Message.setField(this, 256554254, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 102105, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 102105, value); + } + get gasPrice() { + return pb_1.Message.getFieldWithDefault(this, 5271059, "") as string; + } + set gasPrice(value: string) { + pb_1.Message.setField(this, 5271059, value); + } + get timeoutMs() { + return pb_1.Message.getFieldWithDefault(this, 51479271, 0) as number; + } + set timeoutMs(value: number) { + pb_1.Message.setField(this, 51479271, value); + } + get privateTransactionConfig() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB, 276796542) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + } + set privateTransactionConfig(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB) { + pb_1.Message.setWrapperField(this, 276796542, value); + } + get has_privateTransactionConfig() { + return pb_1.Message.getField(this, 276796542) != null; + } + static fromObject(data: { + contractName?: string; + contractAbi?: ReturnType[]; + contractJSONString?: string; + constructorArgs?: ReturnType[]; + web3SigningCredential?: ReturnType; + bytecode?: string; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: ReturnType; + }): DeployContractSolidityBytecodeNoKeychainV1RequestPB { + const message = new DeployContractSolidityBytecodeNoKeychainV1RequestPB({}); + if (data.contractName != null) { + message.contractName = data.contractName; + } + 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)); + } + if (data.web3SigningCredential != null) { + message.web3SigningCredential = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.fromObject(data.web3SigningCredential); + } + if (data.bytecode != null) { + message.bytecode = data.bytecode; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.gasPrice != null) { + message.gasPrice = data.gasPrice; + } + if (data.timeoutMs != null) { + message.timeoutMs = data.timeoutMs; + } + if (data.privateTransactionConfig != null) { + message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.fromObject(data.privateTransactionConfig); + } + return message; + } + toObject() { + const data: { + contractName?: string; + contractAbi?: ReturnType[]; + contractJSONString?: string; + constructorArgs?: ReturnType[]; + web3SigningCredential?: ReturnType; + bytecode?: string; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: ReturnType; + } = {}; + if (this.contractName != null) { + data.contractName = this.contractName; + } + 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()); + } + if (this.web3SigningCredential != null) { + data.web3SigningCredential = this.web3SigningCredential.toObject(); + } + if (this.bytecode != null) { + data.bytecode = this.bytecode; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.gasPrice != null) { + data.gasPrice = this.gasPrice; + } + if (this.timeoutMs != null) { + data.timeoutMs = this.timeoutMs; + } + if (this.privateTransactionConfig != null) { + data.privateTransactionConfig = this.privateTransactionConfig.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.contractName.length) + 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) + writer.writeMessage(451211679, this.web3SigningCredential, () => this.web3SigningCredential.serialize(writer)); + if (this.bytecode.length) + writer.writeString(256554254, this.bytecode); + if (this.gas != 0) + writer.writeFloat(102105, this.gas); + if (this.gasPrice.length) + writer.writeString(5271059, this.gasPrice); + if (this.timeoutMs != 0) + writer.writeFloat(51479271, this.timeoutMs); + if (this.has_privateTransactionConfig) + writer.writeMessage(276796542, this.privateTransactionConfig, () => this.privateTransactionConfig.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeployContractSolidityBytecodeNoKeychainV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeployContractSolidityBytecodeNoKeychainV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 328784197: + message.contractName = reader.readString(); + break; + 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; + case 451211679: + reader.readMessage(message.web3SigningCredential, () => message.web3SigningCredential = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.deserialize(reader)); + break; + case 256554254: + message.bytecode = reader.readString(); + break; + case 102105: + message.gas = reader.readFloat(); + break; + case 5271059: + message.gasPrice = reader.readString(); + break; + case 51479271: + message.timeoutMs = reader.readFloat(); + break; + case 276796542: + reader.readMessage(message.privateTransactionConfig, () => message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeployContractSolidityBytecodeNoKeychainV1RequestPB { + return DeployContractSolidityBytecodeNoKeychainV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts index eb183bbef17..d469d422aa8 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts @@ -4,31 +4,102 @@ * source: services/default_service.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../google/protobuf/empty"; -import * as dependency_2 from "./../models/deploy_contract_solidity_bytecode_v1_request_pb"; -import * as dependency_3 from "./../models/deploy_contract_solidity_bytecode_v1_response_pb"; -import * as dependency_4 from "./../models/get_balance_v1_request_pb"; -import * as dependency_5 from "./../models/get_balance_v1_response_pb"; -import * as dependency_6 from "./../models/get_besu_record_v1_request_pb"; -import * as dependency_7 from "./../models/get_besu_record_v1_response_pb"; -import * as dependency_8 from "./../models/get_block_v1_request_pb"; -import * as dependency_9 from "./../models/get_block_v1_response_pb"; -import * as dependency_10 from "./../models/get_past_logs_v1_request_pb"; -import * as dependency_11 from "./../models/get_past_logs_v1_response_pb"; -import * as dependency_12 from "./../models/get_transaction_v1_request_pb"; -import * as dependency_13 from "./../models/get_transaction_v1_response_pb"; -import * as dependency_14 from "./../models/invoke_contract_v1_request_pb"; -import * as dependency_15 from "./../models/invoke_contract_v1_response_pb"; -import * as dependency_16 from "./../models/run_transaction_request_pb"; -import * as dependency_17 from "./../models/run_transaction_response_pb"; -import * as dependency_18 from "./../models/sign_transaction_request_pb"; -import * as dependency_19 from "./../models/sign_transaction_response_pb"; +import * as dependency_2 from "./../models/deploy_contract_solidity_bytecode_no_keychain_v1_request_pb"; +import * as dependency_3 from "./../models/deploy_contract_solidity_bytecode_v1_request_pb"; +import * as dependency_4 from "./../models/deploy_contract_solidity_bytecode_v1_response_pb"; +import * as dependency_5 from "./../models/get_balance_v1_request_pb"; +import * as dependency_6 from "./../models/get_balance_v1_response_pb"; +import * as dependency_7 from "./../models/get_besu_record_v1_request_pb"; +import * as dependency_8 from "./../models/get_besu_record_v1_response_pb"; +import * as dependency_9 from "./../models/get_block_v1_request_pb"; +import * as dependency_10 from "./../models/get_block_v1_response_pb"; +import * as dependency_11 from "./../models/get_past_logs_v1_request_pb"; +import * as dependency_12 from "./../models/get_past_logs_v1_response_pb"; +import * as dependency_13 from "./../models/get_transaction_v1_request_pb"; +import * as dependency_14 from "./../models/get_transaction_v1_response_pb"; +import * as dependency_15 from "./../models/invoke_contract_v1_request_pb"; +import * as dependency_16 from "./../models/invoke_contract_v1_response_pb"; +import * as dependency_17 from "./../models/run_transaction_request_pb"; +import * as dependency_18 from "./../models/run_transaction_response_pb"; +import * as dependency_19 from "./../models/sign_transaction_request_pb"; +import * as dependency_20 from "./../models/sign_transaction_response_pb"; import * as pb_1 from "google-protobuf"; import * as grpc_1 from "@grpc/grpc-js"; export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice { + export class DeployContractSolBytecodeNoKeychainV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + deployContractSolidityBytecodeNoKeychainV1RequestPB?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("deployContractSolidityBytecodeNoKeychainV1RequestPB" in data && data.deployContractSolidityBytecodeNoKeychainV1RequestPB != undefined) { + this.deployContractSolidityBytecodeNoKeychainV1RequestPB = data.deployContractSolidityBytecodeNoKeychainV1RequestPB; + } + } + } + get deployContractSolidityBytecodeNoKeychainV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB, 1) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB; + } + set deployContractSolidityBytecodeNoKeychainV1RequestPB(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_deployContractSolidityBytecodeNoKeychainV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + deployContractSolidityBytecodeNoKeychainV1RequestPB?: ReturnType; + }): DeployContractSolBytecodeNoKeychainV1Request { + const message = new DeployContractSolBytecodeNoKeychainV1Request({}); + if (data.deployContractSolidityBytecodeNoKeychainV1RequestPB != null) { + message.deployContractSolidityBytecodeNoKeychainV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB.fromObject(data.deployContractSolidityBytecodeNoKeychainV1RequestPB); + } + return message; + } + toObject() { + const data: { + deployContractSolidityBytecodeNoKeychainV1RequestPB?: ReturnType; + } = {}; + if (this.deployContractSolidityBytecodeNoKeychainV1RequestPB != null) { + data.deployContractSolidityBytecodeNoKeychainV1RequestPB = this.deployContractSolidityBytecodeNoKeychainV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_deployContractSolidityBytecodeNoKeychainV1RequestPB) + writer.writeMessage(1, this.deployContractSolidityBytecodeNoKeychainV1RequestPB, () => this.deployContractSolidityBytecodeNoKeychainV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeployContractSolBytecodeNoKeychainV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeployContractSolBytecodeNoKeychainV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.deployContractSolidityBytecodeNoKeychainV1RequestPB, () => message.deployContractSolidityBytecodeNoKeychainV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeNoKeychainV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeployContractSolBytecodeNoKeychainV1Request { + return DeployContractSolBytecodeNoKeychainV1Request.deserialize(bytes); + } + } export class DeployContractSolBytecodeV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - deployContractSolidityBytecodeV1RequestPB?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; + deployContractSolidityBytecodeV1RequestPB?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -39,26 +110,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get deployContractSolidityBytecodeV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB, 1) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB, 1) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; } - set deployContractSolidityBytecodeV1RequestPB(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB) { + set deployContractSolidityBytecodeV1RequestPB(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_deployContractSolidityBytecodeV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - deployContractSolidityBytecodeV1RequestPB?: ReturnType; + deployContractSolidityBytecodeV1RequestPB?: ReturnType; }): DeployContractSolBytecodeV1Request { const message = new DeployContractSolBytecodeV1Request({}); if (data.deployContractSolidityBytecodeV1RequestPB != null) { - message.deployContractSolidityBytecodeV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.fromObject(data.deployContractSolidityBytecodeV1RequestPB); + message.deployContractSolidityBytecodeV1RequestPB = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.fromObject(data.deployContractSolidityBytecodeV1RequestPB); } return message; } toObject() { const data: { - deployContractSolidityBytecodeV1RequestPB?: ReturnType; + deployContractSolidityBytecodeV1RequestPB?: ReturnType; } = {}; if (this.deployContractSolidityBytecodeV1RequestPB != null) { data.deployContractSolidityBytecodeV1RequestPB = this.deployContractSolidityBytecodeV1RequestPB.toObject(); @@ -81,7 +152,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.deployContractSolidityBytecodeV1RequestPB, () => message.deployContractSolidityBytecodeV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.deserialize(reader)); + reader.readMessage(message.deployContractSolidityBytecodeV1RequestPB, () => message.deployContractSolidityBytecodeV1RequestPB = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -98,7 +169,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class GetBalanceV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - getBalanceV1RequestPB?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; + getBalanceV1RequestPB?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -109,26 +180,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get getBalanceV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB, 1) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB, 1) as dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; } - set getBalanceV1RequestPB(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB) { + set getBalanceV1RequestPB(value: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_getBalanceV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - getBalanceV1RequestPB?: ReturnType; + getBalanceV1RequestPB?: ReturnType; }): GetBalanceV1Request { const message = new GetBalanceV1Request({}); if (data.getBalanceV1RequestPB != null) { - message.getBalanceV1RequestPB = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.fromObject(data.getBalanceV1RequestPB); + message.getBalanceV1RequestPB = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.fromObject(data.getBalanceV1RequestPB); } return message; } toObject() { const data: { - getBalanceV1RequestPB?: ReturnType; + getBalanceV1RequestPB?: ReturnType; } = {}; if (this.getBalanceV1RequestPB != null) { data.getBalanceV1RequestPB = this.getBalanceV1RequestPB.toObject(); @@ -151,7 +222,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.getBalanceV1RequestPB, () => message.getBalanceV1RequestPB = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.deserialize(reader)); + reader.readMessage(message.getBalanceV1RequestPB, () => message.getBalanceV1RequestPB = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -168,7 +239,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class GetBesuRecordV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - getBesuRecordV1RequestPB?: dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; + getBesuRecordV1RequestPB?: dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -179,26 +250,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get getBesuRecordV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB, 1) as dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB, 1) as dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; } - set getBesuRecordV1RequestPB(value: dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB) { + set getBesuRecordV1RequestPB(value: dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_getBesuRecordV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - getBesuRecordV1RequestPB?: ReturnType; + getBesuRecordV1RequestPB?: ReturnType; }): GetBesuRecordV1Request { const message = new GetBesuRecordV1Request({}); if (data.getBesuRecordV1RequestPB != null) { - message.getBesuRecordV1RequestPB = dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.fromObject(data.getBesuRecordV1RequestPB); + message.getBesuRecordV1RequestPB = dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.fromObject(data.getBesuRecordV1RequestPB); } return message; } toObject() { const data: { - getBesuRecordV1RequestPB?: ReturnType; + getBesuRecordV1RequestPB?: ReturnType; } = {}; if (this.getBesuRecordV1RequestPB != null) { data.getBesuRecordV1RequestPB = this.getBesuRecordV1RequestPB.toObject(); @@ -221,7 +292,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.getBesuRecordV1RequestPB, () => message.getBesuRecordV1RequestPB = dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.deserialize(reader)); + reader.readMessage(message.getBesuRecordV1RequestPB, () => message.getBesuRecordV1RequestPB = dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -238,7 +309,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class GetBlockV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - getBlockV1RequestPB?: dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; + getBlockV1RequestPB?: dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -249,26 +320,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get getBlockV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB, 1) as dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB, 1) as dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; } - set getBlockV1RequestPB(value: dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB) { + set getBlockV1RequestPB(value: dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_getBlockV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - getBlockV1RequestPB?: ReturnType; + getBlockV1RequestPB?: ReturnType; }): GetBlockV1Request { const message = new GetBlockV1Request({}); if (data.getBlockV1RequestPB != null) { - message.getBlockV1RequestPB = dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.fromObject(data.getBlockV1RequestPB); + message.getBlockV1RequestPB = dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.fromObject(data.getBlockV1RequestPB); } return message; } toObject() { const data: { - getBlockV1RequestPB?: ReturnType; + getBlockV1RequestPB?: ReturnType; } = {}; if (this.getBlockV1RequestPB != null) { data.getBlockV1RequestPB = this.getBlockV1RequestPB.toObject(); @@ -291,7 +362,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.getBlockV1RequestPB, () => message.getBlockV1RequestPB = dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.deserialize(reader)); + reader.readMessage(message.getBlockV1RequestPB, () => message.getBlockV1RequestPB = dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -375,7 +446,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class GetPastLogsV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - getPastLogsV1RequestPB?: dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; + getPastLogsV1RequestPB?: dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -386,26 +457,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get getPastLogsV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB, 1) as dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB, 1) as dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; } - set getPastLogsV1RequestPB(value: dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB) { + set getPastLogsV1RequestPB(value: dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_getPastLogsV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - getPastLogsV1RequestPB?: ReturnType; + getPastLogsV1RequestPB?: ReturnType; }): GetPastLogsV1Request { const message = new GetPastLogsV1Request({}); if (data.getPastLogsV1RequestPB != null) { - message.getPastLogsV1RequestPB = dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.fromObject(data.getPastLogsV1RequestPB); + message.getPastLogsV1RequestPB = dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.fromObject(data.getPastLogsV1RequestPB); } return message; } toObject() { const data: { - getPastLogsV1RequestPB?: ReturnType; + getPastLogsV1RequestPB?: ReturnType; } = {}; if (this.getPastLogsV1RequestPB != null) { data.getPastLogsV1RequestPB = this.getPastLogsV1RequestPB.toObject(); @@ -428,7 +499,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.getPastLogsV1RequestPB, () => message.getPastLogsV1RequestPB = dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.deserialize(reader)); + reader.readMessage(message.getPastLogsV1RequestPB, () => message.getPastLogsV1RequestPB = dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -512,7 +583,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class GetTransactionV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - getTransactionV1RequestPB?: dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; + getTransactionV1RequestPB?: dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -523,26 +594,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get getTransactionV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB, 1) as dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB, 1) as dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; } - set getTransactionV1RequestPB(value: dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB) { + set getTransactionV1RequestPB(value: dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_getTransactionV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - getTransactionV1RequestPB?: ReturnType; + getTransactionV1RequestPB?: ReturnType; }): GetTransactionV1Request { const message = new GetTransactionV1Request({}); if (data.getTransactionV1RequestPB != null) { - message.getTransactionV1RequestPB = dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.fromObject(data.getTransactionV1RequestPB); + message.getTransactionV1RequestPB = dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.fromObject(data.getTransactionV1RequestPB); } return message; } toObject() { const data: { - getTransactionV1RequestPB?: ReturnType; + getTransactionV1RequestPB?: ReturnType; } = {}; if (this.getTransactionV1RequestPB != null) { data.getTransactionV1RequestPB = this.getTransactionV1RequestPB.toObject(); @@ -565,7 +636,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.getTransactionV1RequestPB, () => message.getTransactionV1RequestPB = dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.deserialize(reader)); + reader.readMessage(message.getTransactionV1RequestPB, () => message.getTransactionV1RequestPB = dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -582,7 +653,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class InvokeContractV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - invokeContractV1RequestPB?: dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + invokeContractV1RequestPB?: dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -593,26 +664,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get invokeContractV1RequestPB() { - return pb_1.Message.getWrapperField(this, dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB, 1) as dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + return pb_1.Message.getWrapperField(this, dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB, 1) as dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; } - set invokeContractV1RequestPB(value: dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB) { + set invokeContractV1RequestPB(value: dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_invokeContractV1RequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - invokeContractV1RequestPB?: ReturnType; + invokeContractV1RequestPB?: ReturnType; }): InvokeContractV1Request { const message = new InvokeContractV1Request({}); if (data.invokeContractV1RequestPB != null) { - message.invokeContractV1RequestPB = dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.fromObject(data.invokeContractV1RequestPB); + message.invokeContractV1RequestPB = dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.fromObject(data.invokeContractV1RequestPB); } return message; } toObject() { const data: { - invokeContractV1RequestPB?: ReturnType; + invokeContractV1RequestPB?: ReturnType; } = {}; if (this.invokeContractV1RequestPB != null) { data.invokeContractV1RequestPB = this.invokeContractV1RequestPB.toObject(); @@ -635,7 +706,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.invokeContractV1RequestPB, () => message.invokeContractV1RequestPB = dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.deserialize(reader)); + reader.readMessage(message.invokeContractV1RequestPB, () => message.invokeContractV1RequestPB = dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -652,7 +723,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class RunTransactionV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - runTransactionRequestPB?: dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; + runTransactionRequestPB?: dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -663,26 +734,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get runTransactionRequestPB() { - return pb_1.Message.getWrapperField(this, dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB, 1) as dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; + return pb_1.Message.getWrapperField(this, dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB, 1) as dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; } - set runTransactionRequestPB(value: dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB) { + set runTransactionRequestPB(value: dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_runTransactionRequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - runTransactionRequestPB?: ReturnType; + runTransactionRequestPB?: ReturnType; }): RunTransactionV1Request { const message = new RunTransactionV1Request({}); if (data.runTransactionRequestPB != null) { - message.runTransactionRequestPB = dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.fromObject(data.runTransactionRequestPB); + message.runTransactionRequestPB = dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.fromObject(data.runTransactionRequestPB); } return message; } toObject() { const data: { - runTransactionRequestPB?: ReturnType; + runTransactionRequestPB?: ReturnType; } = {}; if (this.runTransactionRequestPB != null) { data.runTransactionRequestPB = this.runTransactionRequestPB.toObject(); @@ -705,7 +776,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.runTransactionRequestPB, () => message.runTransactionRequestPB = dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.deserialize(reader)); + reader.readMessage(message.runTransactionRequestPB, () => message.runTransactionRequestPB = dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -722,7 +793,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def export class SignTransactionV1Request extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - signTransactionRequestPB?: dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; + signTransactionRequestPB?: dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -733,26 +804,26 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } } get signTransactionRequestPB() { - return pb_1.Message.getWrapperField(this, dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB, 1) as dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; + return pb_1.Message.getWrapperField(this, dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB, 1) as dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; } - set signTransactionRequestPB(value: dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB) { + set signTransactionRequestPB(value: dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB) { pb_1.Message.setWrapperField(this, 1, value); } get has_signTransactionRequestPB() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - signTransactionRequestPB?: ReturnType; + signTransactionRequestPB?: ReturnType; }): SignTransactionV1Request { const message = new SignTransactionV1Request({}); if (data.signTransactionRequestPB != null) { - message.signTransactionRequestPB = dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.fromObject(data.signTransactionRequestPB); + message.signTransactionRequestPB = dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.fromObject(data.signTransactionRequestPB); } return message; } toObject() { const data: { - signTransactionRequestPB?: ReturnType; + signTransactionRequestPB?: ReturnType; } = {}; if (this.signTransactionRequestPB != null) { data.signTransactionRequestPB = this.signTransactionRequestPB.toObject(); @@ -775,7 +846,7 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.signTransactionRequestPB, () => message.signTransactionRequestPB = dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.deserialize(reader)); + reader.readMessage(message.signTransactionRequestPB, () => message.signTransactionRequestPB = dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.deserialize(reader)); break; default: reader.skipField(); } @@ -815,14 +886,23 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def } export abstract class UnimplementedDefaultServiceService { static definition = { + DeployContractSolBytecodeNoKeychainV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/DeployContractSolBytecodeNoKeychainV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: DeployContractSolBytecodeNoKeychainV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => DeployContractSolBytecodeNoKeychainV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, DeployContractSolBytecodeV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/DeployContractSolBytecodeV1", requestStream: false, responseStream: false, requestSerialize: (message: DeployContractSolBytecodeV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => DeployContractSolBytecodeV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB.deserialize(new Uint8Array(bytes)) }, GetBalanceV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBalanceV1", @@ -830,8 +910,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: GetBalanceV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => GetBalanceV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB.deserialize(new Uint8Array(bytes)) }, GetBesuRecordV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBesuRecordV1", @@ -839,8 +919,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: GetBesuRecordV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => GetBesuRecordV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB.deserialize(new Uint8Array(bytes)) }, GetBlockV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBlockV1", @@ -848,8 +928,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: GetBlockV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => GetBlockV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB.deserialize(new Uint8Array(bytes)) }, GetOpenApiSpecV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetOpenApiSpecV1", @@ -866,8 +946,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: GetPastLogsV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => GetPastLogsV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB.deserialize(new Uint8Array(bytes)) }, GetPrometheusMetricsV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetPrometheusMetricsV1", @@ -884,8 +964,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: GetTransactionV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => GetTransactionV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB.deserialize(new Uint8Array(bytes)) }, InvokeContractV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/InvokeContractV1", @@ -893,8 +973,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: InvokeContractV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => InvokeContractV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB.deserialize(new Uint8Array(bytes)) }, RunTransactionV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/RunTransactionV1", @@ -902,8 +982,8 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: RunTransactionV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => RunTransactionV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB.deserialize(new Uint8Array(bytes)) }, SignTransactionV1: { path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/SignTransactionV1", @@ -911,58 +991,62 @@ export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.def responseStream: false, requestSerialize: (message: SignTransactionV1Request) => Buffer.from(message.serialize()), requestDeserialize: (bytes: Buffer) => SignTransactionV1Request.deserialize(new Uint8Array(bytes)), - responseSerialize: (message: dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB) => Buffer.from(message.serialize()), - responseDeserialize: (bytes: Buffer) => dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB.deserialize(new Uint8Array(bytes)) + responseSerialize: (message: dependency_20.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_20.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB.deserialize(new Uint8Array(bytes)) } }; [method: string]: grpc_1.UntypedHandleCall; - abstract DeployContractSolBytecodeV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract GetBalanceV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract GetBesuRecordV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract GetBlockV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract DeployContractSolBytecodeNoKeychainV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract DeployContractSolBytecodeV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBalanceV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBesuRecordV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBlockV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; abstract GetOpenApiSpecV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract GetPastLogsV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetPastLogsV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; abstract GetPrometheusMetricsV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract GetTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract InvokeContractV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract RunTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; - abstract SignTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract InvokeContractV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract RunTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract SignTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; } export class DefaultServiceClient extends grpc_1.makeGenericClientConstructor(UnimplementedDefaultServiceService.definition, "DefaultService", {}) { constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { super(address, credentials, options); } - DeployContractSolBytecodeV1: GrpcUnaryServiceInterface = (message: DeployContractSolBytecodeV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + DeployContractSolBytecodeNoKeychainV1: GrpcUnaryServiceInterface = (message: DeployContractSolBytecodeNoKeychainV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.DeployContractSolBytecodeNoKeychainV1(message, metadata, options, callback); + }; + DeployContractSolBytecodeV1: GrpcUnaryServiceInterface = (message: DeployContractSolBytecodeV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.DeployContractSolBytecodeV1(message, metadata, options, callback); }; - GetBalanceV1: GrpcUnaryServiceInterface = (message: GetBalanceV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + GetBalanceV1: GrpcUnaryServiceInterface = (message: GetBalanceV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetBalanceV1(message, metadata, options, callback); }; - GetBesuRecordV1: GrpcUnaryServiceInterface = (message: GetBesuRecordV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + GetBesuRecordV1: GrpcUnaryServiceInterface = (message: GetBesuRecordV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetBesuRecordV1(message, metadata, options, callback); }; - GetBlockV1: GrpcUnaryServiceInterface = (message: GetBlockV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + GetBlockV1: GrpcUnaryServiceInterface = (message: GetBlockV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetBlockV1(message, metadata, options, callback); }; GetOpenApiSpecV1: GrpcUnaryServiceInterface = (message: dependency_1.google.protobuf.Empty, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetOpenApiSpecV1(message, metadata, options, callback); }; - GetPastLogsV1: GrpcUnaryServiceInterface = (message: GetPastLogsV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + GetPastLogsV1: GrpcUnaryServiceInterface = (message: GetPastLogsV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetPastLogsV1(message, metadata, options, callback); }; GetPrometheusMetricsV1: GrpcUnaryServiceInterface = (message: dependency_1.google.protobuf.Empty, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetPrometheusMetricsV1(message, metadata, options, callback); }; - GetTransactionV1: GrpcUnaryServiceInterface = (message: GetTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + GetTransactionV1: GrpcUnaryServiceInterface = (message: GetTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.GetTransactionV1(message, metadata, options, callback); }; - InvokeContractV1: GrpcUnaryServiceInterface = (message: InvokeContractV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + InvokeContractV1: GrpcUnaryServiceInterface = (message: InvokeContractV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.InvokeContractV1(message, metadata, options, callback); }; - RunTransactionV1: GrpcUnaryServiceInterface = (message: RunTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + RunTransactionV1: GrpcUnaryServiceInterface = (message: RunTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.RunTransactionV1(message, metadata, options, callback); }; - SignTransactionV1: GrpcUnaryServiceInterface = (message: SignTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + SignTransactionV1: GrpcUnaryServiceInterface = (message: SignTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { return super.SignTransactionV1(message, metadata, options, callback); }; } diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts index 41e58eb51c3..cad85107957 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts @@ -73,6 +73,20 @@ export class BesuGrpcSvcOpenApi extends default_service.org.hyperledger.cacti }); } + public DeployContractSolBytecodeNoKeychainV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DeployContractSolBytecodeNoKeychainV1Request, + deploy_contract_solidity_bytecode_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + public GetBalanceV1( call: ServerUnaryCall< default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBalanceV1Request, 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 7dfbf7b57f8..dd5daa5e8b8 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 @@ -17,10 +17,12 @@ import Web3JsQuorum, { IWeb3Quorum } from "web3js-quorum"; import { Contract, ContractSendMethod } from "web3-eth-contract"; import { TransactionReceipt } from "web3-eth"; + import { GetBalanceV1Request, GetBalanceV1Response, Web3TransactionReceipt, + DeployContractSolidityBytecodeNoKeychainV1Request, } from "./generated/openapi/typescript-axios/index"; import { @@ -56,6 +58,7 @@ import { } from "@hyperledger/cactus-common"; import { DeployContractSolidityBytecodeEndpoint } from "./web-services/deploy-contract-solidity-bytecode-endpoint"; +import { DeployContractSolidityBytecodeNoKeychainEndpoint } from "./web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint"; import { WatchBlocksV1, @@ -283,6 +286,13 @@ export class PluginLedgerConnectorBesu }); endpoints.push(endpoint); } + { + const endpoint = new DeployContractSolidityBytecodeNoKeychainEndpoint({ + connector: this, + logLevel: this.options.logLevel, + }); + endpoints.push(endpoint); + } { const endpoint = new GetBalanceEndpoint({ connector: this, @@ -971,6 +981,83 @@ export class PluginLedgerConnectorBesu return deployResponse; } + public async deployContractNoKeychain( + req: DeployContractSolidityBytecodeNoKeychainV1Request, + ): Promise { + const fnTag = `${this.className}#deployContract()`; + Checks.truthy(req, `${fnTag} req`); + if (isWeb3SigningCredentialNone(req.web3SigningCredential)) { + throw new Error(`${fnTag} Cannot deploy contract with pre-signed TX`); + } + const { contractName, contractJSONString } = req; + const networkId = await this.web3.eth.net.getId(); + + const tmpContract = new this.web3.eth.Contract(req.contractAbi); + const deployment = tmpContract.deploy({ + data: req.bytecode, + arguments: req.constructorArgs, + }); + + const abi = deployment.encodeABI(); + const data = abi.startsWith("0x") ? abi : `0x${abi}`; + this.log.debug(`Deploying "${req.contractName}" with data %o`, data); + + const web3SigningCredential = req.web3SigningCredential as + | Web3SigningCredentialPrivateKeyHex + | Web3SigningCredentialCactusKeychainRef; + + const runTxResponse = await this.transact({ + transactionConfig: { + data, + from: web3SigningCredential.ethAccount, + gas: req.gas, + gasPrice: req.gasPrice, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NodeTxPoolAck, + timeoutMs: req.timeoutMs || 60000, + }, + web3SigningCredential, + privateTransactionConfig: req.privateTransactionConfig, + }); + + const { transactionReceipt: receipt } = runTxResponse; + const { status, contractAddress } = receipt; + + Checks.truthy(status, `${this.className}#deployContract():status`); + + Checks.truthy( + contractAddress, + `${this.className}#deployContract():contractAddress`, + ); + + if (contractJSONString) { + const networkInfo = { address: contractAddress }; + const contractJSON = JSON.parse(contractJSONString); + this.log.debug("Contract JSON: \n%o", JSON.stringify(contractJSON)); + const contract = new this.web3.eth.Contract( + contractJSON.abi, + contractAddress || " ", + ); + this.contracts[contractName] = contract; + const network = { [networkId]: networkInfo }; + contractJSON.networks = network; + } 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); + } + + // creating solidity byte code response + const deployResponse: DeployContractSolidityBytecodeV1Response = { + transactionReceipt: runTxResponse.transactionReceipt, + }; + + return deployResponse; + } + public async signTransaction( req: SignTransactionRequest, ): Promise> { 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 new file mode 100644 index 00000000000..6d34e0a6f31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/web-services/deploy-contract-solidity-bytecode-no-keychain-endpoint.ts @@ -0,0 +1,109 @@ +import type { Express, Request, Response } from "express"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { + Logger, + Checks, + LogLevelDesc, + LoggerProvider, + IAsyncProvider, +} from "@hyperledger/cactus-common"; + +import { + handleRestEndpointException, + registerWebServiceEndpoint, +} from "@hyperledger/cactus-core"; + +import { PluginLedgerConnectorBesu } from "../plugin-ledger-connector-besu"; +import { DeployContractSolidityBytecodeV1Request } from "../generated/openapi/typescript-axios"; +import OAS from "../../json/openapi.json"; + +export interface IDeployContractSolidityBytecodeNoKeychainOptions { + logLevel?: LogLevelDesc; + connector: PluginLedgerConnectorBesu; +} + +export class DeployContractSolidityBytecodeNoKeychainEndpoint + implements IWebServiceEndpoint +{ + public static readonly CLASS_NAME = + "DeployContractSolidityBytecodeNoKeychainEndpoint"; + + private readonly log: Logger; + + public get className(): string { + return DeployContractSolidityBytecodeNoKeychainEndpoint.CLASS_NAME; + } + + constructor( + public readonly options: IDeployContractSolidityBytecodeNoKeychainOptions, + ) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(options, `${fnTag} arg options`); + Checks.truthy(options.connector, `${fnTag} arg options.connector`); + + const level = this.options.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level, label }); + } + + public get oasPath(): (typeof OAS.paths)["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain"] { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain" + ]; + } + + public getPath(): string { + return this.oasPath.post["x-hyperledger-cacti"].http.path; + } + + public getVerbLowerCase(): string { + return this.oasPath.post["x-hyperledger-cacti"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.oasPath.post.operationId; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + // TODO: make this an injectable dependency in the constructor + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async handleRequest(req: Request, res: Response): Promise { + const { log } = this; + const fnTag = `${this.className}#handleRequest()`; + const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; + this.log.debug(reqTag); + const reqBody: DeployContractSolidityBytecodeV1Request = req.body; + try { + const resBody = + await this.options.connector.deployContractNoKeychain(reqBody); + res.json(resBody); + } catch (ex) { + const errorMsg = `${reqTag} ${fnTag} Failed to deploy contract:`; + await handleRestEndpointException({ errorMsg, log, error: ex, res }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-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/private-deploy-contract-from-json-no-keychain.test.ts new file mode 100644 index 00000000000..0291a183a2c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-no-keychain.test.ts @@ -0,0 +1,492 @@ +import test, { Test } from "tape-promise/tape"; +import { v4 as uuidv4 } from "uuid"; +import HelloWorldContractJson from "../../../../solidity/hello-world-contract/HelloWorld.json"; +import Web3 from "web3"; +import Web3JsQuorum, { IPrivateTransactionReceipt } from "web3js-quorum"; +import { BesuMpTestLedger } from "@hyperledger/cactus-test-tooling"; +import { LogLevelDesc } from "@hyperledger/cactus-common"; +import { + EthContractInvocationType, + PluginFactoryLedgerConnector, + Web3SigningCredentialType, +} from "../../../../../main/typescript"; +import { PluginImportType } from "@hyperledger/cactus-core-api"; +import { PluginRegistry } from "@hyperledger/cactus-core"; + +const containerImageName = + "ghcr.io/hyperledger/cactus-besu-all-in-one-multi-party"; +const containerImageTag = "2023-08-08-pr-2596"; +const testCase = "Executes private transactions on Hyperledger Besu"; +const logLevel: LogLevelDesc = "TRACE"; + +const doctorCactusHex = + "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d446f63746f722043616374757300000000000000000000000000000000000000"; + +// WARNING: the keys here are demo purposes ONLY. Please use a tool like Orchestrate or EthSigner for production, rather than hard coding private keys +const keysStatic = { + tessera: { + member1: { + publicKey: "BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=", + }, + member2: { + publicKey: "QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=", + }, + member3: { + publicKey: "1iTZde/ndBHvzhcl7V68x44Vx7pl8nwx9LqnM/AfJUg=", + }, + }, + besu: { + member1: { + url: "http://127.0.0.1:20000", + wsUrl: "ws://127.0.0.1:20001", + privateKey: + "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", + }, + member2: { + url: "http://127.0.0.1:20002", + wsUrl: "ws://127.0.0.1:20003", + privateKey: + "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", + }, + member3: { + url: "http://127.0.0.1:20004", + wsUrl: "ws://127.0.0.1:20005", + privateKey: + "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", + }, + ethsignerProxy: { + url: "http://127.0.0.1:18545", + accountAddress: "9b790656b9ec0db1936ed84b3bea605873558198", + }, + }, +}; + +test(testCase, async (t: Test) => { + // At development time one can specify this environment variable if there is + // a multi-party network already running, which is doable with something like + // this on the terminal: + // docker run --rm --privileged --publish 2222:22 --publish 3000:3000 --publish 8545:8545 --publish 8546:8546 --publish 9001:9001 --publish 9081:9081 --publish 9082:9082 --publish 9083:9083 --publish 9090:9090 --publish 18545:18545 --publish 20000:20000 --publish 20001:20001 --publish 20002:20002 --publish 20003:20003 --publish 20004:20004 --publish 20005:20005 --publish 25000:25000 petermetz/cactus-besu-multi-party-all-in-one:0.1.2 + // + // The upside of this approach is that a new container is not launched from + // scratch for every test execution which enables faster iteration. + const preWarmedLedger = process.env.CACTUS_TEST_PRE_WARMED_LEDGER === "true"; + + let keys: any; + if (preWarmedLedger) { + keys = keysStatic; + } else { + const ledger = new BesuMpTestLedger({ + logLevel, + imageName: containerImageName, + imageTag: containerImageTag, + emitContainerLogs: false, + }); + test.onFinish(() => ledger.stop()); + await ledger.start(); + keys = await ledger.getKeys(); + } + + const rpcApiHttpHostMember1 = keys.besu.member1.url; + const rpcApiHttpHostMember2 = keys.besu.member2.url; + const rpcApiHttpHostMember3 = keys.besu.member3.url; + + const rpcApiWsHostMember1 = keys.besu.member1.wsUrl; + const rpcApiWsHostMember2 = keys.besu.member2.wsUrl; + const rpcApiWsHostMember3 = keys.besu.member3.wsUrl; + + const web3Member1 = new Web3(rpcApiHttpHostMember1); + const web3Member2 = new Web3(rpcApiHttpHostMember2); + const web3Member3 = new Web3(rpcApiHttpHostMember3); + + const pluginRegistry1 = new PluginRegistry(); + const pluginRegistry2 = new PluginRegistry(); + const pluginRegistry3 = new PluginRegistry(); + + const pluginFactoryLedgerConnector = new PluginFactoryLedgerConnector({ + pluginImportType: PluginImportType.Local, + }); + + const connectorInstanceId1 = "besu1_" + uuidv4(); + const connectorInstanceId2 = "besu2_" + uuidv4(); + const connectorInstanceId3 = "besu3_" + uuidv4(); + + const connector1 = await pluginFactoryLedgerConnector.create({ + instanceId: connectorInstanceId1, + pluginRegistry: pluginRegistry1, + rpcApiHttpHost: rpcApiHttpHostMember1, + rpcApiWsHost: rpcApiWsHostMember1, + logLevel, + }); + t.ok(connector1, "connector1 truthy OK"); + test.onFinish(() => connector1.shutdown()); + pluginRegistry1.add(connector1); + + const connector2 = await pluginFactoryLedgerConnector.create({ + instanceId: connectorInstanceId2, + pluginRegistry: pluginRegistry2, + rpcApiHttpHost: rpcApiHttpHostMember2, + rpcApiWsHost: rpcApiWsHostMember2, + logLevel, + }); + t.ok(connector2, "connector2 truthy OK"); + test.onFinish(() => connector2.shutdown()); + pluginRegistry2.add(connector2); + + const connector3 = await pluginFactoryLedgerConnector.create({ + instanceId: connectorInstanceId3, + pluginRegistry: pluginRegistry3, + rpcApiHttpHost: rpcApiHttpHostMember3, + rpcApiWsHost: rpcApiWsHostMember3, + logLevel, + }); + t.ok(connector3, "connector3 truthy OK"); + test.onFinish(() => connector3.shutdown()); + pluginRegistry3.add(connector3); + + await connector1.onPluginInit(); + await connector2.onPluginInit(); + await connector3.onPluginInit(); + + const chainIdMember1 = await web3Member1.eth.getChainId(); + t.comment(`chainIdMember1=${chainIdMember1}`); + const chainIdMember2 = await web3Member2.eth.getChainId(); + t.comment(`chainIdMember2=${chainIdMember2}`); + const chainIdMember3 = await web3Member3.eth.getChainId(); + t.comment(`chainIdMember3=${chainIdMember3}`); + + const web3QuorumMember1 = Web3JsQuorum(web3Member1); + t.ok(web3QuorumMember1, "web3QuorumMember1 truthy OK"); + + const web3QuorumMember2 = Web3JsQuorum(web3Member2); + t.ok(web3QuorumMember2, "web3QuorumMember2 truthy OK"); + + const web3QuorumMember3 = Web3JsQuorum(web3Member3); + t.ok(web3QuorumMember3, "web3QuorumMember3 truthy OK"); + + const deployRes = await connector1.deployContractNoKeychain({ + bytecode: HelloWorldContractJson.bytecode, + contractAbi: HelloWorldContractJson.abi, + contractName: HelloWorldContractJson.contractName, + constructorArgs: [], + privateTransactionConfig: { + privateFrom: keys.tessera.member1.publicKey, + privateFor: [ + keys.tessera.member1.publicKey, + keys.tessera.member2.publicKey, + ], + }, + web3SigningCredential: { + secret: keys.besu.member1.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + contractJSONString: JSON.stringify(HelloWorldContractJson), + gas: 3000000, + }); + + t.ok(deployRes, "deployRes truthy OK"); + t.ok(deployRes.transactionReceipt, "deployRes.transactionReceipt truthy OK"); + t.ok( + deployRes.transactionReceipt.contractAddress, + "deployRes.transactionReceipt.contractAddress truthy OK", + ); + t.ok( + deployRes.transactionReceipt.commitmentHash, + "deployRes.transactionReceipt.commitmentHash truthy OK", + ); + + // t.ok(deployRes.status, "deployRes.status truthy OK"); + // t.equal(deployRes.status, 200, "deployRes.status === 200 OK"); + // t.ok(deployRes.data, "deployRes.data truthy OK"); + // t.ok( + // deployRes.data.transactionReceipt, + // "deployRes.data.transactionReceipt truthy OK", + // ); + + // t.ok(privacyMarkerTxHash, "privacyMarkerTxHash truthy OK"); + + const contractDeployReceipt = + (await web3QuorumMember1.priv.waitForTransactionReceipt( + deployRes.transactionReceipt.commitmentHash, + )) as IPrivateTransactionReceipt; + + t.ok(contractDeployReceipt, "contractDeployReceipt truthy OK"); + const receipt = contractDeployReceipt as IPrivateTransactionReceipt; + + const { contractAddress } = receipt; + t.comment(`Private contract address: ${contractAddress}`); + t.ok(contractAddress, "contractAddress truthy OK"); + + // Check that the third node does not see the transaction of the contract + // deployment that was sent to node 1 and 2 only, not 3. + const txReceiptNever = await web3QuorumMember3.priv.waitForTransactionReceipt( + deployRes.transactionReceipt.commitmentHash, + ); + t.notok(txReceiptNever, "txReceiptNever falsy OK"); + + // Check that node 1 and 2 can indeed see the transaction for the contract + // deployment that was sent to them and them only (node 3 was left out) + + // Note that changing this to use web3QuorumMember3 breaks it and I'm suspecting + // that this is what's plaguing the tests that are based on the connector + // which is instantiated with a single web3+web3 Quorum client. + // What I will try next is to have 3 connectors each with a web3 Quorum client + // that points to one of the 3 nodes and see if that makes it work. + const txReceiptAlways1 = + await web3QuorumMember1.priv.waitForTransactionReceipt( + deployRes.transactionReceipt.commitmentHash, + ); + t.ok(txReceiptAlways1, "txReceiptAlways1 truthy OK"); + + const txReceiptAlways2 = + await web3QuorumMember2.priv.waitForTransactionReceipt( + deployRes.transactionReceipt.commitmentHash, + ); + t.ok(txReceiptAlways2, "txReceiptAlways2 truthy OK"); + + const contract = new web3Member1.eth.Contract( + HelloWorldContractJson.abi as never, + ); + + { + t.comment("Checking if member1 can call setName()"); + const data = contract.methods.setName("ProfessorCactus - #1").encodeABI(); + const functionParams = { + to: contractDeployReceipt.contractAddress, + data, + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + privateKey: keys.besu.member1.privateKey, + }; + const transactionHash = + await web3QuorumMember1.priv.generateAndSendRawTransaction( + functionParams, + ); + t.comment(`Transaction hash: ${transactionHash}`); + t.ok(transactionHash, "transactionHash truthy OK"); + + const result = + await web3QuorumMember1.priv.waitForTransactionReceipt(transactionHash); + t.comment(`Transaction receipt for set() call: ${JSON.stringify(result)}`); + t.ok(result, "set() result member 1 truthy OK"); + } + + { + t.comment("Checking if member1 can see new name via getName()"); + const data = contract.methods.getName().encodeABI(); + const fnParams = { + to: contractDeployReceipt.contractAddress, + data, + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + privateKey: keys.besu.member1.privateKey, + }; + + const privacyGroupId = + web3QuorumMember1.utils.generatePrivacyGroup(fnParams); + const callOutput = await web3QuorumMember1.priv.call(privacyGroupId, { + to: contractDeployReceipt.contractAddress, + data: contract.methods.getName().encodeABI(), + }); + t.comment(`getName Call output: ${JSON.stringify(callOutput)}`); + t.ok(callOutput, "callOutput truthy OK"); + const name = web3Member1.eth.abi.decodeParameter("string", callOutput); + t.equal(name, "ProfessorCactus - #1", "getName() member 1 equals #1"); + } + + { + // Member 3 cannot see into the privacy group of 1 and 2 so the getName + // will not return the value that was set earlier in that privacy group. + t.comment("Checking if member3 can see new name via getName()"); + const data = contract.methods.getName().encodeABI(); + const fnParams = { + to: contractDeployReceipt.contractAddress, + data, + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + privateKey: keys.besu.member3.privateKey, + }; + + const privacyGroupId = + web3QuorumMember3.utils.generatePrivacyGroup(fnParams); + const callOutput = await web3QuorumMember3.priv.call(privacyGroupId, { + to: contractDeployReceipt.contractAddress, + data, + }); + t.comment(`getName member3 output: ${JSON.stringify(callOutput)}`); + t.equal(callOutput, "0x", "member3 getName callOutput === 0x OK"); + } + + { + const data = contract.methods.setName("ProfessorCactus - #2").encodeABI(); + t.comment("Checking if member2 can call setName()"); + const functionParams = { + to: contractDeployReceipt.contractAddress, + data, + privateFrom: keys.tessera.member2.publicKey, + privateFor: [keys.tessera.member2.publicKey], + privateKey: keys.besu.member2.privateKey, + }; + const transactionHash = + await web3QuorumMember2.priv.generateAndSendRawTransaction( + functionParams, + ); + t.comment(`Transaction hash: ${transactionHash}`); + t.ok(transactionHash, "transactionHash truthy OK"); + + const result = + await web3QuorumMember2.priv.waitForTransactionReceipt(transactionHash); + t.comment(`Transaction receipt for set() call: ${JSON.stringify(result)}`); + t.ok(result, "set() result member 2 truthy OK"); + } + + { + const data = contract.methods.setName("ProfessorCactus - #3").encodeABI(); + t.comment("Checking if member3 can call setName()"); + const functionParams = { + to: contractDeployReceipt.contractAddress, + data, + privateFrom: keys.tessera.member3.publicKey, + privateKey: keys.besu.member3.privateKey, + privateFor: [keys.tessera.member2.publicKey], + }; + const transactionHash = + await web3QuorumMember3.priv.generateAndSendRawTransaction( + functionParams, + ); + t.comment(`setName tx hash for member 3: ${transactionHash}`); + t.ok(transactionHash, "setName tx hash for member 3 truthy OK"); + + const result = + await web3QuorumMember3.priv.waitForTransactionReceipt(transactionHash); + t.comment(`Transaction receipt for set() call: ${JSON.stringify(result)}`); + t.ok(result, "set() result for member 3 truthy OK"); + } + + { + t.comment("Checking that private contract cannot be called anonymously"); + const contractInvocationNoPrivTxConfig = connector1.invokeContract({ + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + contractAddress: contractDeployReceipt.contractAddress, + invocationType: EthContractInvocationType.Call, + gas: 3000000, + methodName: "getName", + params: [], + signingCredential: { + secret: "incorrect-secret", + type: Web3SigningCredentialType.PrivateKeyHex, + }, + }); + await t.rejects( + contractInvocationNoPrivTxConfig, + /Returned values aren't valid, did it run Out of Gas\? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced\./, + "private contract call fails without Besu member credentials OK", + ); + } + + { + t.comment("Ensuring member1 can call setName() via connector"); + const res = await connector1.invokeContract({ + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + contractAddress: contractDeployReceipt.contractAddress, + invocationType: EthContractInvocationType.Send, + gas: 3000000, + methodName: "setName", + params: ["Doctor Cactus"], + privateTransactionConfig: { + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + }, + signingCredential: { + secret: keys.besu.member1.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + }); + + t.equal(res.success, "0x1", "member1 setName callOutput === 0x1 OK"); + } + + { + t.comment( + "Ensuring member1 can call getName() and receive correct value after setName call", + ); + const res = await connector1.invokeContract({ + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + contractAddress: contractDeployReceipt.contractAddress, + invocationType: EthContractInvocationType.Call, + gas: 3000000, + methodName: "getName", + params: [], + privateTransactionConfig: { + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + }, + signingCredential: { + secret: keys.besu.member1.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + }); + + t.equals( + res.callOutput, + doctorCactusHex, + "member1 getName callOutput === DoctorCactus", + ); + } + + { + t.comment( + "Ensuring member2 can call getName() and receive correct value after setName call", + ); + const res = await connector2.invokeContract({ + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + contractAddress: contractDeployReceipt.contractAddress, + invocationType: EthContractInvocationType.Call, + gas: 3000000, + methodName: "getName", + params: [], + privateTransactionConfig: { + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + }, + signingCredential: { + secret: keys.besu.member1.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + }); + + t.equals( + res.callOutput, + doctorCactusHex, + "member2 getName callOutput === DoctorCactus", + ); + } + + { + t.comment("Checking if member3 can call getName() via connector"); + const res = await connector3.invokeContract({ + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + contractAddress: contractDeployReceipt.contractAddress, + invocationType: EthContractInvocationType.Call, + gas: 3000000, + methodName: "getName", + params: [], + privateTransactionConfig: { + privateFrom: keys.tessera.member1.publicKey, + privateFor: [keys.tessera.member2.publicKey], + }, + signingCredential: { + secret: keys.besu.member3.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + }); + + t.equal(res.callOutput, "0x", "member3 getName callOutput === 0x OK"); + } + + t.end(); +}); diff --git a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json.test.ts similarity index 100% rename from packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts rename to packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json.test.ts