@ton/sandbox 0.21.0-debugger.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/blockchain/Blockchain.d.ts +1 -4
- package/dist/blockchain/Blockchain.js +0 -7
- package/dist/blockchain/SmartContract.d.ts +0 -2
- package/dist/blockchain/SmartContract.js +6 -52
- package/dist/executor/Executor.d.ts +0 -29
- package/dist/executor/Executor.js +1 -160
- package/dist/executor/emulator-emscripten.js +1 -1
- package/dist/executor/emulator-emscripten.wasm.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/package.json +7 -13
- package/dist/debugger/DebugInfoCache.d.ts +0 -5
- package/dist/debugger/DebugInfoCache.js +0 -49
- package/dist/debugger/Debuggee.d.ts +0 -108
- package/dist/debugger/Debuggee.js +0 -354
- package/dist/debugger/TVMDebugSession.d.ts +0 -26
- package/dist/debugger/TVMDebugSession.js +0 -267
- package/dist/debugger/debug.d.ts +0 -5
- package/dist/debugger/debug.js +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.21.0] - 2024-09-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `SandboxContract` now wraps methods starting with `is` (having the same semantics as `get`) as well as `send` and `get`
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
8
18
|
## [0.20.0] - 2024-05-31
|
|
9
19
|
|
|
10
20
|
### Added
|
|
@@ -45,7 +45,7 @@ export declare const SANDBOX_CONTRACT_SYMBOL: unique symbol;
|
|
|
45
45
|
* @template F Type parameter representing the original contract object.
|
|
46
46
|
*/
|
|
47
47
|
export type SandboxContract<F> = {
|
|
48
|
-
[P in keyof F]: P extends
|
|
48
|
+
[P in keyof F]: P extends `${'get' | 'is'}${string}` ? (F[P] extends (x: infer CP, ...args: infer P) => infer R ? (ExtendsContractProvider<CP> extends true ? (...args: P) => R : never) : never) : (P extends `send${string}` ? (F[P] extends (x: infer CP, ...args: infer P) => infer R ? (ExtendsContractProvider<CP> extends true ? (...args: P) => Promise<SendMessageResult & {
|
|
49
49
|
result: R extends Promise<infer PR> ? PR : R;
|
|
50
50
|
}> : never) : never) : F[P]);
|
|
51
51
|
};
|
|
@@ -98,7 +98,6 @@ export declare class Blockchain {
|
|
|
98
98
|
protected lock: AsyncLock;
|
|
99
99
|
protected contractFetches: Map<string, Promise<SmartContract>>;
|
|
100
100
|
protected nextCreateWalletIndex: number;
|
|
101
|
-
protected shouldDebug: boolean;
|
|
102
101
|
readonly executor: IExecutor;
|
|
103
102
|
/**
|
|
104
103
|
* Saves snapshot of current blockchain.
|
|
@@ -116,8 +115,6 @@ export declare class Blockchain {
|
|
|
116
115
|
* @param snapshot Snapshot of blockchain
|
|
117
116
|
*/
|
|
118
117
|
loadFrom(snapshot: BlockchainSnapshot): Promise<void>;
|
|
119
|
-
get debug(): boolean;
|
|
120
|
-
set debug(value: boolean);
|
|
121
118
|
/**
|
|
122
119
|
* @returns Current time in blockchain
|
|
123
120
|
*/
|
|
@@ -81,12 +81,6 @@ class Blockchain {
|
|
|
81
81
|
this.globalLibs = snapshot.libs;
|
|
82
82
|
this.nextCreateWalletIndex = snapshot.nextCreateWalletIndex;
|
|
83
83
|
}
|
|
84
|
-
get debug() {
|
|
85
|
-
return this.shouldDebug;
|
|
86
|
-
}
|
|
87
|
-
set debug(value) {
|
|
88
|
-
this.shouldDebug = value;
|
|
89
|
-
}
|
|
90
84
|
/**
|
|
91
85
|
* @returns Current time in blockchain
|
|
92
86
|
*/
|
|
@@ -118,7 +112,6 @@ class Blockchain {
|
|
|
118
112
|
this.lock = new AsyncLock_1.AsyncLock();
|
|
119
113
|
this.contractFetches = new Map();
|
|
120
114
|
this.nextCreateWalletIndex = 0;
|
|
121
|
-
this.shouldDebug = false;
|
|
122
115
|
this.networkConfig = blockchainConfigToBase64(opts.config);
|
|
123
116
|
this.executor = opts.executor;
|
|
124
117
|
this.storage = opts.storage;
|
|
@@ -98,6 +98,4 @@ export declare class SmartContract {
|
|
|
98
98
|
get verbosity(): LogsVerbosity;
|
|
99
99
|
set verbosity(value: LogsVerbosity);
|
|
100
100
|
setVerbosity(verbosity: Partial<LogsVerbosity> | Verbosity | undefined): void;
|
|
101
|
-
get debug(): boolean;
|
|
102
|
-
setDebug(debug: boolean | undefined): void;
|
|
103
101
|
}
|
|
@@ -10,13 +10,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _SmartContract_account, _SmartContract_parsedAccount, _SmartContract_lastTxTime, _SmartContract_verbosity
|
|
13
|
+
var _SmartContract_account, _SmartContract_parsedAccount, _SmartContract_lastTxTime, _SmartContract_verbosity;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SmartContract = exports.EmulationError = exports.TimeError = exports.GetMethodError = exports.createEmptyShardAccount = exports.createShardAccount = void 0;
|
|
16
16
|
const core_1 = require("@ton/core");
|
|
17
17
|
const selector_1 = require("../utils/selector");
|
|
18
|
-
const debug_1 = require("../debugger/debug");
|
|
19
|
-
const DebugInfoCache_1 = require("../debugger/DebugInfoCache");
|
|
20
18
|
function createShardAccount(args) {
|
|
21
19
|
let wc = args.workchain ?? 0;
|
|
22
20
|
let address = args.address ?? (0, core_1.contractAddress)(wc, { code: args.code, data: args.data });
|
|
@@ -130,7 +128,6 @@ class SmartContract {
|
|
|
130
128
|
_SmartContract_parsedAccount.set(this, void 0);
|
|
131
129
|
_SmartContract_lastTxTime.set(this, void 0);
|
|
132
130
|
_SmartContract_verbosity.set(this, void 0);
|
|
133
|
-
_SmartContract_debug.set(this, void 0);
|
|
134
131
|
this.address = shardAccount.account.addr;
|
|
135
132
|
__classPrivateFieldSet(this, _SmartContract_account, (0, core_1.beginCell)().store((0, core_1.storeShardAccount)(shardAccount)).endCell().toBoc().toString('base64'), "f");
|
|
136
133
|
__classPrivateFieldSet(this, _SmartContract_parsedAccount, shardAccount, "f");
|
|
@@ -213,34 +210,10 @@ class SmartContract {
|
|
|
213
210
|
now: this.blockchain.now,
|
|
214
211
|
...params,
|
|
215
212
|
};
|
|
216
|
-
|
|
213
|
+
return await this.runCommon(() => this.blockchain.executor.runTransaction({
|
|
217
214
|
...this.createCommonArgs(params),
|
|
218
215
|
message: (0, core_1.beginCell)().store((0, core_1.storeMessage)(message)).endCell(),
|
|
219
|
-
};
|
|
220
|
-
if (this.debug) {
|
|
221
|
-
const acc = this.account;
|
|
222
|
-
if (acc.account === undefined || acc.account === null) {
|
|
223
|
-
console.log('Debugging uninitialized accounts is unsupported in debugger beta');
|
|
224
|
-
return await this.runCommon(() => this.blockchain.executor.runTransaction(args));
|
|
225
|
-
}
|
|
226
|
-
if (acc.account.storage.state.type !== 'active') {
|
|
227
|
-
console.log('Debugging uninitialized accounts is unsupported in debugger beta');
|
|
228
|
-
return await this.runCommon(() => this.blockchain.executor.runTransaction(args));
|
|
229
|
-
}
|
|
230
|
-
const code = acc.account.storage.state.state.code;
|
|
231
|
-
if (code === undefined || code === null) {
|
|
232
|
-
console.log('Debugging uninitialized accounts is unsupported in debugger beta');
|
|
233
|
-
return await this.runCommon(() => this.blockchain.executor.runTransaction(args));
|
|
234
|
-
}
|
|
235
|
-
const sm = DebugInfoCache_1.defaultDebugInfoCache.get(code.hash().toString('base64'));
|
|
236
|
-
if (sm === undefined) {
|
|
237
|
-
return await this.runCommon(() => this.blockchain.executor.runTransaction(args));
|
|
238
|
-
}
|
|
239
|
-
return await this.runCommon(() => (0, debug_1.debugTransaction)(this.blockchain.executor, args, code, sm));
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
return await this.runCommon(() => this.blockchain.executor.runTransaction(args));
|
|
243
|
-
}
|
|
216
|
+
}));
|
|
244
217
|
}
|
|
245
218
|
async runTickTock(which, params) {
|
|
246
219
|
return await this.runCommon(() => this.blockchain.executor.runTickTock({
|
|
@@ -277,7 +250,7 @@ class SmartContract {
|
|
|
277
250
|
if (this.account.account?.storage.state.type !== 'active') {
|
|
278
251
|
throw new Error('Trying to run get method on non-active contract');
|
|
279
252
|
}
|
|
280
|
-
const
|
|
253
|
+
const res = await this.blockchain.executor.runGetMethod({
|
|
281
254
|
code: this.account.account?.storage.state.state.code,
|
|
282
255
|
data: this.account.account?.storage.state.state.data,
|
|
283
256
|
methodId: typeof method === 'string' ? (0, selector_1.getSelectorForMethod)(method) : method,
|
|
@@ -291,20 +264,7 @@ class SmartContract {
|
|
|
291
264
|
randomSeed: params?.randomSeed ?? Buffer.alloc(32),
|
|
292
265
|
gasLimit: params?.gasLimit ?? 10000000n,
|
|
293
266
|
debugEnabled: this.verbosity.debugLogs,
|
|
294
|
-
};
|
|
295
|
-
let res;
|
|
296
|
-
if (this.debug) {
|
|
297
|
-
const di = DebugInfoCache_1.defaultDebugInfoCache.get(args.code.hash().toString('base64'));
|
|
298
|
-
if (di === undefined) {
|
|
299
|
-
res = await this.blockchain.executor.runGetMethod(args);
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
res = await (0, debug_1.debugGetMethod)(this.blockchain.executor, args, di);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
res = await this.blockchain.executor.runGetMethod(args);
|
|
307
|
-
}
|
|
267
|
+
});
|
|
308
268
|
if (this.verbosity.print && this.verbosity.blockchainLogs && res.logs.length > 0) {
|
|
309
269
|
console.log(res.logs);
|
|
310
270
|
}
|
|
@@ -352,12 +312,6 @@ class SmartContract {
|
|
|
352
312
|
__classPrivateFieldSet(this, _SmartContract_verbosity, verbosity, "f");
|
|
353
313
|
}
|
|
354
314
|
}
|
|
355
|
-
get debug() {
|
|
356
|
-
return __classPrivateFieldGet(this, _SmartContract_debug, "f") ?? this.blockchain.debug;
|
|
357
|
-
}
|
|
358
|
-
setDebug(debug) {
|
|
359
|
-
__classPrivateFieldSet(this, _SmartContract_debug, debug, "f");
|
|
360
|
-
}
|
|
361
315
|
}
|
|
362
316
|
exports.SmartContract = SmartContract;
|
|
363
|
-
_SmartContract_account = new WeakMap(), _SmartContract_parsedAccount = new WeakMap(), _SmartContract_lastTxTime = new WeakMap(), _SmartContract_verbosity = new WeakMap()
|
|
317
|
+
_SmartContract_account = new WeakMap(), _SmartContract_parsedAccount = new WeakMap(), _SmartContract_lastTxTime = new WeakMap(), _SmartContract_verbosity = new WeakMap();
|
|
@@ -82,9 +82,7 @@ export declare class Executor implements IExecutor {
|
|
|
82
82
|
private heap;
|
|
83
83
|
private emulator?;
|
|
84
84
|
private debugLogs;
|
|
85
|
-
debugLogFunc: (s: string) => void;
|
|
86
85
|
private constructor();
|
|
87
|
-
private handleLog;
|
|
88
86
|
static create(): Promise<Executor>;
|
|
89
87
|
runGetMethod(args: GetMethodArgs): Promise<GetMethodResult>;
|
|
90
88
|
private runCommon;
|
|
@@ -94,31 +92,4 @@ export declare class Executor implements IExecutor {
|
|
|
94
92
|
private getEmulatorPointer;
|
|
95
93
|
invoke(method: string, args: (number | string)[]): number;
|
|
96
94
|
private extractString;
|
|
97
|
-
sbsGetMethodSetup(args: GetMethodArgs): number;
|
|
98
|
-
destroyTvmEmulator(ptr: number): void;
|
|
99
|
-
sbsGetMethodStep(ptr: number): boolean;
|
|
100
|
-
sbsGetMethodStack(ptr: number): TupleItem[];
|
|
101
|
-
sbsGetMethodC7(ptr: number): TupleItem;
|
|
102
|
-
sbsGetMethodGetContParam(ptr: number): number;
|
|
103
|
-
sbsGetMethodSetContParam(ptr: number, param: number): number;
|
|
104
|
-
sbsGetMethodCodePos(ptr: number): {
|
|
105
|
-
hash: string;
|
|
106
|
-
offset: number;
|
|
107
|
-
};
|
|
108
|
-
sbsGetMethodResult(ptr: number): GetMethodResult;
|
|
109
|
-
sbsTransactionSetup(args: RunTransactionArgs): {
|
|
110
|
-
res: number;
|
|
111
|
-
emptr: number;
|
|
112
|
-
};
|
|
113
|
-
destroyEmulator(ptr: number): void;
|
|
114
|
-
sbsTransactionStep(ptr: number): boolean;
|
|
115
|
-
sbsTransactionCodePos(ptr: number): {
|
|
116
|
-
hash: string;
|
|
117
|
-
offset: number;
|
|
118
|
-
};
|
|
119
|
-
sbsTransactionStack(ptr: number): TupleItem[];
|
|
120
|
-
sbsTransactionC7(ptr: number): TupleItem;
|
|
121
|
-
sbsTransactionGetContParam(ptr: number): number;
|
|
122
|
-
sbsTransactionSetContParam(ptr: number, param: number): number;
|
|
123
|
-
sbsTransactionResult(ptr: number): EmulationResult;
|
|
124
95
|
}
|
|
@@ -69,18 +69,13 @@ class Heap {
|
|
|
69
69
|
class Executor {
|
|
70
70
|
constructor(module) {
|
|
71
71
|
this.debugLogs = [];
|
|
72
|
-
this.debugLogFunc = () => { };
|
|
73
72
|
this.module = module;
|
|
74
73
|
this.heap = new Heap(module);
|
|
75
74
|
}
|
|
76
|
-
handleLog(text) {
|
|
77
|
-
this.debugLogs.push(text);
|
|
78
|
-
this.debugLogFunc(text);
|
|
79
|
-
}
|
|
80
75
|
static async create() {
|
|
81
76
|
const ex = new Executor(await EmulatorModule({
|
|
82
77
|
wasmBinary: (0, base64_1.base64Decode)(require('./emulator-emscripten.wasm.js').EmulatorEmscriptenWasm),
|
|
83
|
-
printErr: (text) => ex.
|
|
78
|
+
printErr: (text) => ex.debugLogs.push(text),
|
|
84
79
|
}));
|
|
85
80
|
return ex;
|
|
86
81
|
}
|
|
@@ -209,159 +204,5 @@ class Executor {
|
|
|
209
204
|
this.module._free(ptr);
|
|
210
205
|
return str;
|
|
211
206
|
}
|
|
212
|
-
sbsGetMethodSetup(args) {
|
|
213
|
-
const params = {
|
|
214
|
-
code: args.code.toBoc().toString('base64'),
|
|
215
|
-
data: args.data.toBoc().toString('base64'),
|
|
216
|
-
verbosity: verbosityToNum[args.verbosity],
|
|
217
|
-
libs: args.libs?.toBoc().toString('base64') ?? '',
|
|
218
|
-
address: args.address.toString(),
|
|
219
|
-
unixtime: args.unixTime,
|
|
220
|
-
balance: args.balance.toString(),
|
|
221
|
-
rand_seed: args.randomSeed.toString('hex'),
|
|
222
|
-
gas_limit: args.gasLimit.toString(),
|
|
223
|
-
method_id: args.methodId,
|
|
224
|
-
debug_enabled: args.debugEnabled,
|
|
225
|
-
};
|
|
226
|
-
let stack = (0, core_1.serializeTuple)(args.stack);
|
|
227
|
-
this.debugLogs = [];
|
|
228
|
-
const res = this.invoke('_setup_sbs_get_method', [
|
|
229
|
-
JSON.stringify(params),
|
|
230
|
-
stack.toBoc().toString('base64'),
|
|
231
|
-
args.config,
|
|
232
|
-
]);
|
|
233
|
-
return res;
|
|
234
|
-
}
|
|
235
|
-
destroyTvmEmulator(ptr) {
|
|
236
|
-
this.invoke('_destroy_tvm_emulator', [ptr]);
|
|
237
|
-
}
|
|
238
|
-
sbsGetMethodStep(ptr) {
|
|
239
|
-
const res = this.invoke('_sbs_step', [
|
|
240
|
-
ptr,
|
|
241
|
-
]);
|
|
242
|
-
return res !== 0;
|
|
243
|
-
}
|
|
244
|
-
sbsGetMethodStack(ptr) {
|
|
245
|
-
const resp = this.extractString(this.invoke('_sbs_get_stack', [
|
|
246
|
-
ptr
|
|
247
|
-
]));
|
|
248
|
-
return (0, core_1.parseTuple)(core_1.Cell.fromBase64(resp));
|
|
249
|
-
}
|
|
250
|
-
sbsGetMethodC7(ptr) {
|
|
251
|
-
const resp = this.extractString(this.invoke('_sbs_get_c7', [
|
|
252
|
-
ptr
|
|
253
|
-
]));
|
|
254
|
-
return (0, core_1.parseTuple)((0, core_1.beginCell)().storeUint(1, 24).storeRef(core_1.Cell.EMPTY).storeSlice(core_1.Cell.fromBase64(resp).beginParse()).endCell())[0];
|
|
255
|
-
}
|
|
256
|
-
sbsGetMethodGetContParam(ptr) {
|
|
257
|
-
return this.invoke('_sbs_get_cont_param', [
|
|
258
|
-
ptr
|
|
259
|
-
]);
|
|
260
|
-
}
|
|
261
|
-
sbsGetMethodSetContParam(ptr, param) {
|
|
262
|
-
return this.invoke('_sbs_set_cont_param', [
|
|
263
|
-
ptr,
|
|
264
|
-
param
|
|
265
|
-
]);
|
|
266
|
-
}
|
|
267
|
-
sbsGetMethodCodePos(ptr) {
|
|
268
|
-
const resp = this.extractString(this.invoke('_sbs_get_code_pos', [
|
|
269
|
-
ptr
|
|
270
|
-
]));
|
|
271
|
-
const parts = resp.split(':');
|
|
272
|
-
return {
|
|
273
|
-
hash: parts[0],
|
|
274
|
-
offset: parseInt(parts[1]),
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
sbsGetMethodResult(ptr) {
|
|
278
|
-
const resp = JSON.parse(this.extractString(this.invoke('_sbs_get_method_result', [
|
|
279
|
-
ptr
|
|
280
|
-
])));
|
|
281
|
-
const debugLogs = this.debugLogs.join('\n');
|
|
282
|
-
return {
|
|
283
|
-
output: resp,
|
|
284
|
-
logs: 'BLOCKCHAIN LOGS ARE NOT AVAILABLE IN DEBUGGER BETA',
|
|
285
|
-
debugLogs,
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
sbsTransactionSetup(args) {
|
|
289
|
-
const emptr = this.invoke('_create_emulator', [
|
|
290
|
-
args.config,
|
|
291
|
-
verbosityToNum[args.verbosity],
|
|
292
|
-
]);
|
|
293
|
-
const params = runCommonArgsToInternalParams(args);
|
|
294
|
-
this.debugLogs = [];
|
|
295
|
-
const res = this.invoke('_emulate_sbs', [
|
|
296
|
-
emptr,
|
|
297
|
-
args.libs?.toBoc().toString('base64') ?? 0,
|
|
298
|
-
args.shardAccount,
|
|
299
|
-
args.message.toBoc().toString('base64'),
|
|
300
|
-
JSON.stringify(params),
|
|
301
|
-
]);
|
|
302
|
-
return { res, emptr };
|
|
303
|
-
}
|
|
304
|
-
destroyEmulator(ptr) {
|
|
305
|
-
this.invoke('_destroy_emulator', [ptr]);
|
|
306
|
-
}
|
|
307
|
-
sbsTransactionStep(ptr) {
|
|
308
|
-
const res = this.invoke('_em_sbs_step', [ptr]);
|
|
309
|
-
return res !== 0;
|
|
310
|
-
}
|
|
311
|
-
sbsTransactionCodePos(ptr) {
|
|
312
|
-
const resp = this.extractString(this.invoke('_em_sbs_code_pos', [ptr]));
|
|
313
|
-
const parts = resp.split(':');
|
|
314
|
-
return {
|
|
315
|
-
hash: parts[0],
|
|
316
|
-
offset: parseInt(parts[1]),
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
sbsTransactionStack(ptr) {
|
|
320
|
-
const resp = this.extractString(this.invoke('_em_sbs_stack', [
|
|
321
|
-
ptr
|
|
322
|
-
]));
|
|
323
|
-
return (0, core_1.parseTuple)(core_1.Cell.fromBase64(resp));
|
|
324
|
-
}
|
|
325
|
-
sbsTransactionC7(ptr) {
|
|
326
|
-
const resp = this.extractString(this.invoke('_em_sbs_c7', [
|
|
327
|
-
ptr
|
|
328
|
-
]));
|
|
329
|
-
return (0, core_1.parseTuple)((0, core_1.beginCell)().storeUint(1, 24).storeRef(core_1.Cell.EMPTY).storeSlice(core_1.Cell.fromBase64(resp).beginParse()).endCell())[0];
|
|
330
|
-
}
|
|
331
|
-
sbsTransactionGetContParam(ptr) {
|
|
332
|
-
return this.invoke('_em_sbs_get_cont_param', [
|
|
333
|
-
ptr
|
|
334
|
-
]);
|
|
335
|
-
}
|
|
336
|
-
sbsTransactionSetContParam(ptr, param) {
|
|
337
|
-
return this.invoke('_em_sbs_set_cont_param', [
|
|
338
|
-
ptr,
|
|
339
|
-
param
|
|
340
|
-
]);
|
|
341
|
-
}
|
|
342
|
-
sbsTransactionResult(ptr) {
|
|
343
|
-
const result = JSON.parse(this.extractString(this.invoke('_em_sbs_result', [
|
|
344
|
-
ptr
|
|
345
|
-
])));
|
|
346
|
-
const debugLogs = this.debugLogs.join('\n');
|
|
347
|
-
return {
|
|
348
|
-
result: result.success ? {
|
|
349
|
-
success: true,
|
|
350
|
-
transaction: result.transaction,
|
|
351
|
-
shardAccount: result.shard_account,
|
|
352
|
-
vmLog: result.vm_log,
|
|
353
|
-
actions: result.actions,
|
|
354
|
-
} : {
|
|
355
|
-
success: false,
|
|
356
|
-
error: result.error,
|
|
357
|
-
vmResults: 'vm_log' in result ? {
|
|
358
|
-
vmLog: result.vm_log,
|
|
359
|
-
vmExitCode: result.vm_exit_code,
|
|
360
|
-
} : undefined,
|
|
361
|
-
},
|
|
362
|
-
logs: 'BLOCKCHAIN LOGS ARE NOT AVAILABLE IN DEBUGGER BETA',
|
|
363
|
-
debugLogs,
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
207
|
}
|
|
367
208
|
exports.Executor = Executor;
|