From 0a969f22b3ab4f00b000435894f20c0033082739 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Mon, 6 Jan 2025 15:39:41 +0200 Subject: [PATCH] Clear JS executor proto models --- msa/js-executor/api/jsExecutor.models.ts | 2 -- msa/js-executor/api/jsInvokeMessageProcessor.ts | 8 ++------ msa/js-executor/api/utils.ts | 7 ------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/msa/js-executor/api/jsExecutor.models.ts b/msa/js-executor/api/jsExecutor.models.ts index 3f14079139..182ec5cf23 100644 --- a/msa/js-executor/api/jsExecutor.models.ts +++ b/msa/js-executor/api/jsExecutor.models.ts @@ -16,8 +16,6 @@ export interface TbMessage { - scriptIdMSB: string; // deprecated - scriptIdLSB: string; // deprecated scriptHash: string; } diff --git a/msa/js-executor/api/jsInvokeMessageProcessor.ts b/msa/js-executor/api/jsInvokeMessageProcessor.ts index a361dedf67..f55a1ba468 100644 --- a/msa/js-executor/api/jsInvokeMessageProcessor.ts +++ b/msa/js-executor/api/jsInvokeMessageProcessor.ts @@ -18,7 +18,7 @@ import config from 'config'; import { _logger } from '../config/logger'; import { JsExecutor, TbScript } from './jsExecutor'; import { performance } from 'perf_hooks'; -import { isString, parseJsErrorDetails, toUUIDString, UUIDFromBuffer, UUIDToBits } from './utils'; +import { isString, parseJsErrorDetails, UUIDFromBuffer, UUIDToBits } from './utils'; import { IQueue } from '../queue/queue.models'; import { JsCompileRequest, @@ -310,8 +310,6 @@ export class JsInvokeMessageProcessor { errorCode: errorCode, success: success, errorDetails: parseJsErrorDetails(err), - scriptIdMSB: "0", - scriptIdLSB: "0", scriptHash: scriptId }; } @@ -328,14 +326,12 @@ export class JsInvokeMessageProcessor { private static createReleaseResponse(scriptId: string, success: boolean): JsReleaseResponse { return { success: success, - scriptIdMSB: "0", - scriptIdLSB: "0", scriptHash: scriptId, }; } private static getScriptId(request: TbMessage): string { - return request.scriptHash ? request.scriptHash : toUUIDString(request.scriptIdMSB, request.scriptIdLSB); + return request.scriptHash; } private incrementUseScriptId(scriptId: string) { diff --git a/msa/js-executor/api/utils.ts b/msa/js-executor/api/utils.ts index 37e6b8224a..f044d40f58 100644 --- a/msa/js-executor/api/utils.ts +++ b/msa/js-executor/api/utils.ts @@ -17,13 +17,6 @@ import Long from 'long'; import uuidParse from 'uuid-parse'; -export function toUUIDString(mostSigBits: string, leastSigBits: string): string { - const msbBytes = Long.fromValue(mostSigBits, false).toBytes(false); - const lsbBytes = Long.fromValue(leastSigBits, false).toBytes(false); - const uuidBytes = msbBytes.concat(lsbBytes); - return uuidParse.unparse(uuidBytes as any); -} - export function UUIDFromBuffer(buf: Buffer): string { return uuidParse.unparse(buf); }