From 5660c4e07865849dd988d95c64d41eee5479e587 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Tue, 16 Jul 2024 07:30:04 -0700 Subject: [PATCH] test(connector-fabric): fix rename type to responseType getBlockV1() The system chaincode query method's returns were not decoded correctly because the test request assembling code was not updated to call the responseType as such (old name was type) Signed-off-by: Peter Somogyvari --- .../fabric-v2-2-x/query-system-chain-methods.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/query-system-chain-methods.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/query-system-chain-methods.test.ts index da7f03ee7c..3906526818 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/query-system-chain-methods.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/query-system-chain-methods.test.ts @@ -222,19 +222,19 @@ describe("Query system chain methods and endpoints tests", () => { * Can be reused throughout the tests. * * @param query how to find requested block - * @param type response type requested + * @param responseType response type requested * * @returns block object / block buffer */ async function getBlock( query: GetBlockRequestV1Query, - type: GetBlockResponseTypeV1 = GetBlockResponseTypeV1.Full, + responseType: GetBlockResponseTypeV1 = GetBlockResponseTypeV1.Full, ): Promise { const getBlockReq = { channelName: ledgerChannelName, gatewayOptions, query, - type, + responseType, }; const getBlockResponse = await apiClient.getBlockV1(getBlockReq); @@ -248,7 +248,7 @@ describe("Query system chain methods and endpoints tests", () => { expect(getBlockResponse.status).toEqual(200); expect(getBlockResponse.data).toBeTruthy(); - switch (type) { + switch (responseType) { case GetBlockResponseTypeV1.Full: if (!("decodedBlock" in getBlockResponse.data)) { throw new Error( @@ -283,7 +283,7 @@ describe("Query system chain methods and endpoints tests", () => { return getBlockResponse.data.cactiFullEvents; default: // Will not compile if any type was not handled by above switch. - const unknownType: never = type; + const unknownType: never = responseType; const validTypes = Object.keys(GetBlockResponseTypeV1).join(";"); const errorMessage = `Unknown get block response type '${unknownType}'. Accepted types for GetBlockResponseTypeV1 are: [${validTypes}]`; throw new Error(errorMessage);