fix: require thresholds to always be a set majority (#4314)
### Description - Thresholds must always be a set majority, enforced by a unit test - Updates thresholds for some chains that should've been updated as the set expanded ### 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 <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->flexible-voting-vault
parent
4a1972903e
commit
c4e7a4e5ee
@ -0,0 +1,17 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { defaultMultisigConfigs } from './multisigIsm.js'; |
||||
|
||||
describe('MultisigIsm', () => { |
||||
describe('defaultMultisigConfigs', () => { |
||||
it('has thresholds that require a set majority', async () => { |
||||
for (const [chain, config] of Object.entries(defaultMultisigConfigs)) { |
||||
const minimumThreshold = Math.floor(config.validators.length / 2) + 1; |
||||
expect(config.threshold).to.be.greaterThanOrEqual( |
||||
minimumThreshold, |
||||
`Threshold for ${chain} is too low, expected at least ${minimumThreshold}, got ${config.threshold}`, |
||||
); |
||||
} |
||||
}); |
||||
}); |
||||
}); |
Loading…
Reference in new issue