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

Commit da2c21a

Browse files
authored
Merge pull request #14 from relayprotocol/fix-test-types
fix types + add build step to ci
2 parents 1f68744 + 5401fc9 commit da2c21a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Test
22

33
on:
44
pull_request:
5+
push:
6+
branches:
7+
- "main"
58

69
jobs:
710
run-tests:
@@ -33,4 +36,7 @@ jobs:
3336
run: yarn install --frozen-lockfile
3437

3538
- name: Run tests
36-
run: yarn test
39+
run: yarn test
40+
41+
- name: Build
42+
run: yarn build

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)