Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit 5401fc9

Browse files
committed
fix types
1 parent 5129df0 commit 5401fc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/execution.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ const actions = [
3636
describe("execution", () => {
3737
it("should encode and decode MINT action correctly", () => {
3838
const action = actions[0];
39-
const encoded = encodeAction(action);
39+
const encoded = encodeAction(action as any);
4040
const decoded = decodeAction(encoded);
4141

4242
expect(decoded.type).toBe(ActionType.MINT);
43-
expect(decoded.data.hubToAddress).toBe(action.data.hubToAddress);
43+
expect("hubToAddress" in decoded.data && decoded.data.hubToAddress).toBe(action.data.hubToAddress);
4444
expect(decoded.data.hubTokenId).toBe(action.data.hubTokenId);
4545
expect(decoded.data.amount).toBe(action.data.amount);
4646
});
@@ -50,7 +50,7 @@ describe("execution", () => {
5050
const encoded = encodeAction(action as any);
5151
const decoded = decodeAction(encoded);
5252
expect(decoded.type).toBe(ActionType.BURN);
53-
expect(decoded.data.hubFromAddress).toBe(action.data.hubFromAddress);
53+
expect("hubFromAddress" in decoded.data && decoded.data.hubFromAddress).toBe(action.data.hubFromAddress);
5454
expect(decoded.data.hubTokenId).toBe(action.data.hubTokenId);
5555
expect(decoded.data.amount).toBe(action.data.amount);
5656
});
@@ -60,8 +60,8 @@ describe("execution", () => {
6060
const encoded = encodeAction(action as any);
6161
const decoded = decodeAction(encoded);
6262
expect(decoded.type).toBe(ActionType.TRANSFER);
63-
expect(decoded.data.hubFromAddress).toBe(action.data.hubFromAddress);
64-
expect(decoded.data.hubToAddress).toBe(action.data.hubToAddress);
63+
expect("hubFromAddress" in decoded.data && decoded.data.hubFromAddress).toBe(action.data.hubFromAddress);
64+
expect("hubToAddress" in decoded.data && decoded.data.hubToAddress).toBe(action.data.hubToAddress);
6565
expect(decoded.data.hubTokenId).toBe(action.data.hubTokenId);
6666
expect(decoded.data.amount).toBe(action.data.amount);
6767
});

0 commit comments

Comments
 (0)