Skip to content

Commit da8ea28

Browse files
authored
Parsing HC Info Account (#36)
* parsing info account * fix external symbol * mock test fix * using correct spec for full * wrap hcinfo codec in class
1 parent b808d78 commit da8ea28

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@fluffylabs/shared-ui": "^0.1.3",
1818
"@tailwindcss/vite": "^4.1.12",
19-
"@typeberry/lib": "0.2.0",
19+
"@typeberry/lib": "^0.2.0-ca77d76",
2020
"lucide-react": "^0.552.0",
2121
"react": "^19.0.0",
2222
"react-dom": "^19.2.0",

src/components/KindFinder.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ vi.mock("@typeberry/lib", () => ({
101101
config: {
102102
tinyChainSpec: {},
103103
},
104+
jam_host_calls: {
105+
hostCallInfoAccount: { Codec: {} },
106+
},
104107
state: {
105108
ServiceAccountInfo: { Codec: {} },
106109
},

src/components/constants.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { block, codec, config, state, state_merkleization as stateSer } from "@typeberry/lib";
1+
import { block, codec, config, jam_host_calls as jam, state, state_merkleization as stateSer } from "@typeberry/lib";
22

33
type Clazz = {
44
// biome-ignore lint/suspicious/noExplicitAny: we can't properly name the type here.
@@ -99,26 +99,40 @@ export const kinds = [
9999
newKind("C14", stateSer.serialize.accumulationQueue, "Accumulation Queue"),
100100
newKind("C15", stateSer.serialize.accumulationQueue, "Recently Accumulated"),
101101
newKind("C16", stateSer.serialize.accumulationQueue, "Accumulation Output Log"),
102-
newKind("C255", state.ServiceAccountInfo, "Service Account Info"),
102+
newKind("C255", state.ServiceAccountInfo, "Service Account"),
103103
newKind(
104104
"Cl",
105105
class LookupHistoryItem extends Array {
106106
static Codec = codec.codec.sequenceVarLen(codec.codec.u32);
107107
},
108108
"Lookup History Item",
109109
),
110+
// host calls stuff
111+
newKind(
112+
"Host Call - Info: Account",
113+
class HostCallInfoAccount extends Object {
114+
static Codec = jam.hostCallInfoAccount;
115+
},
116+
),
110117
];
111118

112-
export const tinyChainSpec = {
119+
type Spec = {
120+
readonly name: string;
121+
readonly spec: config.ChainSpec;
122+
};
123+
124+
export const tinyChainSpec: Spec = {
113125
name: "Tiny",
114126
spec: config.tinyChainSpec,
115127
};
116-
export const ALL_CHAIN_SPECS = [
128+
const _ALL_CHAIN_SPECS: Spec[] = [
117129
tinyChainSpec,
118130
{
119131
name: "Full",
120-
spec: config.tinyChainSpec,
132+
spec: config.fullChainSpec,
121133
},
122-
];
134+
] as const;
135+
136+
export const ALL_CHAIN_SPECS: Spec[] = _ALL_CHAIN_SPECS;
123137

124138
export { headerKind, blockKind };

src/pages/Codec.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ vi.mock("@typeberry/lib", () => ({
132132
config: {
133133
tinyChainSpec: {},
134134
},
135+
jam_host_calls: {
136+
hostCallInfoAccount: { Codec: {} },
137+
},
135138
state: {
136139
ServiceAccountInfo: { Codec: {} },
137140
},

0 commit comments

Comments
 (0)