Skip to content

Commit

Permalink
Verify target chain and token configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Jul 31, 2024
1 parent dde8a15 commit 5aa0b26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"codegen": "zx scripts/generate/index.mjs",
"build:ts": "npm run codegen -- --language=ts && cd generated/typescript && npm i && npm run build",
"test:ts": "npm run build:ts && cd generated/typescript && npm run test"
"test:ts": "rm -rf generated && npm run build:ts && cd generated/typescript && npm run test"
},
"author": "",
"license": "ISC",
Expand Down
15 changes: 14 additions & 1 deletion template/ts/files/tests/helixconf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe.each(HelixChain.chains())(`$_data.name`, ({ tokens, code, rpcs, couples
if (code === "taiko" || code === "bera") {
// Oops
} else {
test("Should configure the correct decimals", async () => {
test.skip("Should configure the correct decimals", async () => {
if (token.type === "native") {
expect(token.decimals).toBe(18);
} else {
Expand All @@ -195,4 +195,17 @@ describe.each(HelixChain.chains())(`$_data.name`, ({ tokens, code, rpcs, couples
});
}
});

describe.each(couples)(`Couple $chain.code::$protocol.name::$symbol.to`, (couple) => {
test("Target chain should be configured", () => {
expect(HelixChain.chains().findIndex((c) => c.code === couple.chain.code)).not.toBe(-1);
});

const targetChain = HelixChain.chains().find((c) => c.code === couple.chain.code);
if (targetChain) {
test("Target token should be configured", () => {
expect(targetChain.tokens.findIndex((t) => t.symbol === couple.symbol.to)).not.toBe(-1);
})
}
})
});

0 comments on commit 5aa0b26

Please sign in to comment.