Skip to content

Commit

Permalink
bump pvm
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszsikora committed Dec 31, 2024
1 parent 50bc6b1 commit 8821dd9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/packages/web-worker/command-handlers/step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/packages/web-worker/wasmAsShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function createAssemblyScriptWasmPvmShell(module: WebAssembly.Modul
resetGeneric,
resetGenericWithMemory,
nextStep,
run,
nSteps,
getProgramCounter,
setNextProgramCounter,
getStatus,
Expand All @@ -32,7 +32,7 @@ export async function createAssemblyScriptWasmPvmShell(module: WebAssembly.Modul
resetGeneric,
resetGenericWithMemory,
nextStep,
run,
nSteps,
getProgramCounter,
setNextProgramCounter,
setGasLeft,
Expand Down
4 changes: 2 additions & 2 deletions src/packages/web-worker/wasmBindgenInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/packages/web-worker/wasmBindgenShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +31,7 @@ export function createWasmPvmShell(): WasmPvmShellInterface {
resetGeneric,
resetGenericWithMemory,
nextStep,
run,
nSteps,
getProgramCounter,
setNextProgramCounter,
getExitArg,
Expand All @@ -48,7 +48,7 @@ export function createWasmPvmShell(): WasmPvmShellInterface {
resetGeneric,
resetGenericWithMemory,
nextStep,
run,
nSteps,
getProgramCounter,
setNextProgramCounter,
getStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/packages/web-worker/wasmGoShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8821dd9

Please sign in to comment.