Skip to content

Commit 373fb30

Browse files
authored
Update typeberry/lib (#482)
1 parent e05e113 commit 373fb30

35 files changed

+193
-45
lines changed

package-lock.json

Lines changed: 129 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@radix-ui/react-tooltip": "^1.1.7",
3636
"@reduxjs/toolkit": "^2.9.0",
3737
"@tanstack/react-virtual": "^3.10.9",
38-
"@typeberry/lib": "^0.5.0-6a64d40",
38+
"@typeberry/lib": "^0.5.8",
3939
"@typeberry/spectool-wasm": "0.23.0",
4040
"@uiw/react-codemirror": "^4.25.1",
4141
"baseline-browser-mapping": "^2.9.19",
@@ -68,6 +68,7 @@
6868
"devDependencies": {
6969
"@eslint/js": "^9.39.0",
7070
"@playwright/test": "^1.57.0",
71+
"@swc/core": "^1.13.5",
7172
"@tailwindcss/postcss": "^4.1.18",
7273
"@testing-library/dom": "^10.4.1",
7374
"@testing-library/jest-dom": "^6.8.0",
@@ -95,8 +96,7 @@
9596
"vite": "^7.3.1",
9697
"vite-plugin-top-level-await": "^1.4.4",
9798
"vite-plugin-wasm": "^3.5.0",
98-
"vitest": "^4.0.14",
99-
"@swc/core": "^1.13.5"
99+
"vitest": "^4.0.14"
100100
},
101101
"lint-staged": {
102102
"**/*.{ts,tsx}": [

src/components/DebuggerSettings/Content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Separator } from "../ui/separator";
1818
import { WithHelp } from "../WithHelp/WithHelp";
1919
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
2020
import { cn } from "@/lib/utils";
21-
import { bytes } from "@typeberry/lib";
21+
import * as bytes from "@typeberry/lib/bytes";
2222
import { Button } from "@/components/ui/button";
2323
import { SpiConfigDialog } from "./SpiConfigDialog";
2424
import { TraceConfigDialog } from "./TraceConfigDialog";

src/components/DebuggerSettings/SpiConfigDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState, useEffect } from "react";
44
import { EntrypointSelector, Entrypoint } from "../ProgramLoader/EntrypointSelector";
55
import { loadSpiConfig, saveSpiConfig } from "../ProgramLoader/spiConfig";
66
import { encodeRefineParams, encodeAccumulateParams, encodeIsAuthorizedParams } from "../ProgramLoader/spiEncoding";
7-
import { bytes } from "@typeberry/lib";
7+
import * as bytes from "@typeberry/lib/bytes";
88
import { Separator } from "../ui/separator";
99
import { useAppSelector } from "@/store/hooks";
1010

src/components/HostCallDialog/handlers/FetchHostCall.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { useEffect, useState } from "react";
22
import { Input } from "@/components/ui/input";
33
import { HostCallHandler, HostCallHandlerProps } from "./types";
4-
import { jam_host_calls, pvm_host_calls, bytes, block } from "@typeberry/lib";
4+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
5+
import * as pvm_host_calls from "@typeberry/lib/pvm-host-calls";
6+
import * as bytes from "@typeberry/lib/bytes";
7+
import * as block from "@typeberry/lib/block";
58
import { MockMemory, MockGasCounter, regsToBytes, bytesToRegs } from "./hostCallUtils";
69
import { HostCallActionButtons } from "./HostCallActionButtons";
710
import { DEFAULT_GAS, DEFAULT_REGS } from "@/types/pvm";
@@ -124,12 +127,8 @@ const FetchHostCallComponent: React.FC<HostCallHandlerProps> = ({
124127
allWorkItems: () => (fetchKind === FetchKind.AllWorkItems ? dataBlob : null),
125128
oneWorkItem: () => (fetchKind === FetchKind.OneWorkItem ? dataBlob : null),
126129
workItemPayload: () => (fetchKind === FetchKind.WorkItemPayload ? dataBlob : null),
127-
allOperands: () => null, // deprecated
128130
allTransfersAndOperands: () => (fetchKind === FetchKind.AllTransfersAndOperands ? dataBlob : null),
129-
oneOperand: () => null, // deprecated
130131
oneTransferOrOperand: () => (fetchKind === FetchKind.OneTransferOrOperand ? dataBlob : null),
131-
allTransfers: () => null, // deprecated
132-
oneTransfer: () => null, // deprecated
133132
};
134133

135134
// Create mock memory and registers

src/components/HostCallDialog/handlers/GasHostCall.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useState, useEffect, useMemo, useRef } from "react";
22
import { HostCallHandler, HostCallHandlerProps } from "./types";
3-
import { jam_host_calls, block } from "@typeberry/lib";
3+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
4+
import * as block from "@typeberry/lib/block";
45
import { HostCallContext } from "./hostCallUtils";
56
import { HostCallActionButtons } from "./HostCallActionButtons";
67
import { DEFAULT_REGS } from "@/types/pvm";

src/components/HostCallDialog/handlers/InfoHostCall.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { useState, useEffect, useMemo } from "react";
22
import { Input } from "@/components/ui/input";
33
import { HostCallHandler, HostCallHandlerProps } from "./types";
4-
import { jam_host_calls, block, state, bytes, numbers } from "@typeberry/lib";
4+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
5+
import * as block from "@typeberry/lib/block";
6+
import * as state from "@typeberry/lib/state";
7+
import * as bytes from "@typeberry/lib/bytes";
8+
import * as numbers from "@typeberry/lib/numbers";
59
import { HostCallContext } from "./hostCallUtils";
610
import { HostCallActionButtons } from "./HostCallActionButtons";
711
import { DEFAULT_REGS } from "@/types/pvm";

src/components/HostCallDialog/handlers/ProvideHostCall.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { useState, useEffect, useMemo, useRef } from "react";
22
import { HostCallHandler, HostCallHandlerProps } from "./types";
3-
import { jam_host_calls, block, utils } from "@typeberry/lib";
3+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
4+
import * as block from "@typeberry/lib/block";
5+
import * as utils from "@typeberry/lib/utils";
46
import { HostCallContext, hexToAscii, OK } from "./hostCallUtils";
57
import { HostCallActionButtons } from "./HostCallActionButtons";
68
import { DEFAULT_REGS } from "@/types/pvm";

src/components/HostCallDialog/handlers/ReadHostCall.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { useState, useEffect, useMemo, useRef } from "react";
22
import { Input } from "@/components/ui/input";
33
import { Switch } from "@/components/ui/switch";
44
import { HostCallHandler, HostCallHandlerProps } from "./types";
5-
import { jam_host_calls, bytes, block, numbers } from "@typeberry/lib";
5+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
6+
import * as bytes from "@typeberry/lib/bytes";
7+
import * as block from "@typeberry/lib/block";
8+
import * as numbers from "@typeberry/lib/numbers";
69
import { HostCallContext, hexToAscii } from "./hostCallUtils";
710
import { storageManager } from "./storageManager";
811
import { HostCallActionButtons } from "./HostCallActionButtons";

src/components/HostCallDialog/handlers/TransferHostCall.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { useState, useEffect, useMemo, useRef } from "react";
22
import { HostCallHandler, HostCallHandlerProps } from "./types";
3-
import { jam_host_calls, block, utils, bytes } from "@typeberry/lib";
3+
import * as jam_host_calls from "@typeberry/lib/jam-host-calls";
4+
import * as block from "@typeberry/lib/block";
5+
import * as utils from "@typeberry/lib/utils";
6+
import * as bytes from "@typeberry/lib/bytes";
47
import { HostCallContext, hexToAscii, OK } from "./hostCallUtils";
58
import { HostCallActionButtons } from "./HostCallActionButtons";
69
import { DEFAULT_REGS } from "@/types/pvm";

0 commit comments

Comments
 (0)