Skip to content

Commit 9403e9c

Browse files
test: assert lockbox metadata instead of non-null assertions
1 parent b3dee4d commit 9403e9c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

typescript/sdk/src/token/deploy.hardhat-test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
import {
2525
Address,
2626
ProtocolType,
27+
assert,
2728
deepCopy,
2829
eqAddress,
2930
isZeroishAddress,
@@ -901,11 +902,15 @@ describe('TokenDeployer', async () => {
901902
// the router's token()/feeToken() returns the underlying wrapped ERC20.
902903
// The fee contract must be deployed with token() so the router's
903904
// "fee must match token" check passes. Resolution reads this on-chain.
905+
const { name, symbol, decimals } = config[chain];
906+
assert(name, 'expected a token name in the config');
907+
assert(symbol, 'expected a token symbol in the config');
908+
assert(decimals != null, 'expected token decimals in the config');
904909
const lockbox = await new XERC20LockboxTest__factory(signer).deploy(
905-
config[chain].name!,
906-
config[chain].symbol!,
910+
name,
911+
symbol,
907912
totalSupply,
908-
config[chain].decimals!,
913+
decimals,
909914
);
910915
const wrappedToken = await lockbox.ERC20();
911916

0 commit comments

Comments
 (0)