Skip to content

Commit

Permalink
Clear JS executor proto models
Browse files Browse the repository at this point in the history
  • Loading branch information
vvlladd28 committed Jan 6, 2025
1 parent d35bdcc commit 0a969f2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions msa/js-executor/api/jsExecutor.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@


export interface TbMessage {
scriptIdMSB: string; // deprecated
scriptIdLSB: string; // deprecated
scriptHash: string;
}

Expand Down
8 changes: 2 additions & 6 deletions msa/js-executor/api/jsInvokeMessageProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -310,8 +310,6 @@ export class JsInvokeMessageProcessor {
errorCode: errorCode,
success: success,
errorDetails: parseJsErrorDetails(err),
scriptIdMSB: "0",
scriptIdLSB: "0",
scriptHash: scriptId
};
}
Expand All @@ -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) {
Expand Down
7 changes: 0 additions & 7 deletions msa/js-executor/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0a969f2

Please sign in to comment.