From 8821dd925e9fc20e52ad640f7f2a67a12c6d9158 Mon Sep 17 00:00:00 2001 From: Mateusz Sikora Date: Tue, 31 Dec 2024 12:11:00 +0100 Subject: [PATCH] bump pvm --- package-lock.json | 8 ++++---- package.json | 2 +- src/packages/web-worker/command-handlers/step.ts | 2 +- src/packages/web-worker/wasmAsShell.ts | 4 ++-- src/packages/web-worker/wasmBindgenInit.ts | 4 ++-- src/packages/web-worker/wasmBindgenShell.ts | 6 +++--- src/packages/web-worker/wasmGoShell.ts | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 667d950..afdb3e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@reduxjs/toolkit": "^2.2.8", "@tanstack/react-virtual": "^3.10.9", "@typeberry/block": "^0.0.1-1a02906", - "@typeberry/pvm-debugger-adapter": "0.1.0-3c527b0", + "@typeberry/pvm-debugger-adapter": "0.1.0-5b611f4", "@typeberry/spectool-wasm": "0.18.0", "@uiw/react-codemirror": "^4.23.6", "class-variance-authority": "^0.7.0", @@ -2805,9 +2805,9 @@ "license": "MPL-2.0" }, "node_modules/@typeberry/pvm-debugger-adapter": { - "version": "0.1.0-3c527b0", - "resolved": "https://registry.npmjs.org/@typeberry/pvm-debugger-adapter/-/pvm-debugger-adapter-0.1.0-3c527b0.tgz", - "integrity": "sha512-Rh4KFJT4mtkP0dpoADrFYwjvEFtbySqZHWmbspexcP8gSJQ74O8BRcY+4ITIWTbTQ4AJQ4uo/84qacyuBpOqGg==", + "version": "0.1.0-5b611f4", + "resolved": "https://registry.npmjs.org/@typeberry/pvm-debugger-adapter/-/pvm-debugger-adapter-0.1.0-5b611f4.tgz", + "integrity": "sha512-UXO3TJC4p/QP6/8NaRh3m4t7K5qejojwVZwoXGyGXhRJi23gUVoxnFKKY4fh9zq8L20l0R99lvOEFSpzA7htKg==", "license": "MPL-2.0" }, "node_modules/@typeberry/spectool-wasm": { diff --git a/package.json b/package.json index ed6e658..d9987f7 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@reduxjs/toolkit": "^2.2.8", "@tanstack/react-virtual": "^3.10.9", "@typeberry/block": "^0.0.1-1a02906", - "@typeberry/pvm-debugger-adapter": "0.1.0-3c527b0", + "@typeberry/pvm-debugger-adapter": "0.1.0-5b611f4", "@typeberry/spectool-wasm": "0.18.0", "@uiw/react-codemirror": "^4.23.6", "class-variance-authority": "^0.7.0", diff --git a/src/packages/web-worker/command-handlers/step.ts b/src/packages/web-worker/command-handlers/step.ts index 1508e53..19003bd 100644 --- a/src/packages/web-worker/command-handlers/step.ts +++ b/src/packages/web-worker/command-handlers/step.ts @@ -17,7 +17,7 @@ const step = ({ pvm, program, stepsToPerform }: StepParams) => { throw new Error("PVM is uninitialized."); } - const isFinished = stepsToPerform > 1 ? !pvm.run(stepsToPerform) : !pvm.nextStep(); + const isFinished = stepsToPerform > 1 ? !pvm.nSteps(stepsToPerform) : !pvm.nextStep(); const state = getState(pvm); const result = nextInstruction(state.pc ?? 0, program) as unknown as CurrentInstruction; diff --git a/src/packages/web-worker/wasmAsShell.ts b/src/packages/web-worker/wasmAsShell.ts index ddc3a50..d61af88 100644 --- a/src/packages/web-worker/wasmAsShell.ts +++ b/src/packages/web-worker/wasmAsShell.ts @@ -14,7 +14,7 @@ export async function createAssemblyScriptWasmPvmShell(module: WebAssembly.Modul resetGeneric, resetGenericWithMemory, nextStep, - run, + nSteps, getProgramCounter, setNextProgramCounter, getStatus, @@ -32,7 +32,7 @@ export async function createAssemblyScriptWasmPvmShell(module: WebAssembly.Modul resetGeneric, resetGenericWithMemory, nextStep, - run, + nSteps, getProgramCounter, setNextProgramCounter, setGasLeft, diff --git a/src/packages/web-worker/wasmBindgenInit.ts b/src/packages/web-worker/wasmBindgenInit.ts index d8afaee..05bfbd8 100644 --- a/src/packages/web-worker/wasmBindgenInit.ts +++ b/src/packages/web-worker/wasmBindgenInit.ts @@ -92,8 +92,8 @@ export function nextStep() { * @param {number} steps * @returns {boolean} */ -export function run(steps) { - const ret = wasm.run(steps); +export function nSteps(steps) { + const ret = wasm.nSteps(steps); return ret !== 0; } diff --git a/src/packages/web-worker/wasmBindgenShell.ts b/src/packages/web-worker/wasmBindgenShell.ts index 77e2f20..257b4a8 100644 --- a/src/packages/web-worker/wasmBindgenShell.ts +++ b/src/packages/web-worker/wasmBindgenShell.ts @@ -16,7 +16,7 @@ export interface WasmPvmShellInterface { gas: bigint, ): void; nextStep(): boolean; - run(steps: number): boolean; + nSteps(steps: number): boolean; getExitArg(): number; getStatus(): Status; getRegisters(): Uint8Array; @@ -31,7 +31,7 @@ export function createWasmPvmShell(): WasmPvmShellInterface { resetGeneric, resetGenericWithMemory, nextStep, - run, + nSteps, getProgramCounter, setNextProgramCounter, getExitArg, @@ -48,7 +48,7 @@ export function createWasmPvmShell(): WasmPvmShellInterface { resetGeneric, resetGenericWithMemory, nextStep, - run, + nSteps, getProgramCounter, setNextProgramCounter, getStatus, diff --git a/src/packages/web-worker/wasmGoShell.ts b/src/packages/web-worker/wasmGoShell.ts index da52a0c..d04487c 100644 --- a/src/packages/web-worker/wasmGoShell.ts +++ b/src/packages/web-worker/wasmGoShell.ts @@ -9,7 +9,7 @@ export function createGoWasmPvmShell(): WasmPvmShellInterface { __wbg_set_wasm, resetGeneric: reset, nextStep, - run: (steps: number) => { + nSteps: (steps: number) => { for (let i = 0; i < steps; i++) { if (!nextStep()) { return false;