test: append-more-multisigmIsm-test (#4769)

### Description
Append more test for `multisigIsm.ts`
<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing
Add 2 test cases:
- has a valid number of validators for each threshold
- has valid EVM addresses for each validator
<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
pull/4781/head
Tien Dao 3 weeks ago committed by GitHub
parent f438d442a5
commit 83a1567a0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      typescript/sdk/src/consts/multisigIsm.test.ts

@ -1,5 +1,7 @@
import { expect } from 'chai';
import { isAddress } from '@hyperlane-xyz/utils';
import { defaultMultisigConfigs } from './multisigIsm.js';
describe('MultisigIsm', () => {
@ -13,5 +15,25 @@ describe('MultisigIsm', () => {
);
}
});
it('has a valid number of validators for each threshold', async () => {
for (const [chain, config] of Object.entries(defaultMultisigConfigs)) {
expect(config.validators.length).to.be.greaterThanOrEqual(
config.threshold,
`Number of validators for ${chain} is less than the threshold, expected at least ${config.threshold}, got ${config.validators.length}`,
);
}
});
it('has valid EVM addresses for each validator', async () => {
for (const [chain, config] of Object.entries(defaultMultisigConfigs)) {
for (const validator of config.validators) {
expect(isAddress(validator)).to.equal(
true,
`Validator address ${validator} for ${chain} is not a valid EVM address`,
);
}
}
});
});
});

Loading…
Cancel
Save