Clear JS executor proto models
This commit is contained in:
parent
d35bdcc981
commit
0a969f22b3
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
|
|
||||||
export interface TbMessage {
|
export interface TbMessage {
|
||||||
scriptIdMSB: string; // deprecated
|
|
||||||
scriptIdLSB: string; // deprecated
|
|
||||||
scriptHash: string;
|
scriptHash: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import config from 'config';
|
|||||||
import { _logger } from '../config/logger';
|
import { _logger } from '../config/logger';
|
||||||
import { JsExecutor, TbScript } from './jsExecutor';
|
import { JsExecutor, TbScript } from './jsExecutor';
|
||||||
import { performance } from 'perf_hooks';
|
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 { IQueue } from '../queue/queue.models';
|
||||||
import {
|
import {
|
||||||
JsCompileRequest,
|
JsCompileRequest,
|
||||||
@ -310,8 +310,6 @@ export class JsInvokeMessageProcessor {
|
|||||||
errorCode: errorCode,
|
errorCode: errorCode,
|
||||||
success: success,
|
success: success,
|
||||||
errorDetails: parseJsErrorDetails(err),
|
errorDetails: parseJsErrorDetails(err),
|
||||||
scriptIdMSB: "0",
|
|
||||||
scriptIdLSB: "0",
|
|
||||||
scriptHash: scriptId
|
scriptHash: scriptId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -328,14 +326,12 @@ export class JsInvokeMessageProcessor {
|
|||||||
private static createReleaseResponse(scriptId: string, success: boolean): JsReleaseResponse {
|
private static createReleaseResponse(scriptId: string, success: boolean): JsReleaseResponse {
|
||||||
return {
|
return {
|
||||||
success: success,
|
success: success,
|
||||||
scriptIdMSB: "0",
|
|
||||||
scriptIdLSB: "0",
|
|
||||||
scriptHash: scriptId,
|
scriptHash: scriptId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getScriptId(request: TbMessage): string {
|
private static getScriptId(request: TbMessage): string {
|
||||||
return request.scriptHash ? request.scriptHash : toUUIDString(request.scriptIdMSB, request.scriptIdLSB);
|
return request.scriptHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
private incrementUseScriptId(scriptId: string) {
|
private incrementUseScriptId(scriptId: string) {
|
||||||
|
|||||||
@ -17,13 +17,6 @@
|
|||||||
import Long from 'long';
|
import Long from 'long';
|
||||||
import uuidParse from 'uuid-parse';
|
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 {
|
export function UUIDFromBuffer(buf: Buffer): string {
|
||||||
return uuidParse.unparse(buf);
|
return uuidParse.unparse(buf);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user