keep-core
keep-core copied to clipboard
Random beacon: Unit tests for group operators list
The v2 beacon client stores the final group operators list using the persistence layer (ThresholdSigner.groupOperators). We need to add unit tests that will check:
- If the list is properly formed in case there are misbehaviors during DKG
- If the list hash computed off-chain matches the hash computed by the on-chain contract
Some clarifications after talking to @lukasz-zimnoch
If the list is properly formed in case there are misbehaviors during DKG
We already have unit tests that check this https://github.com/keep-network/keep-core/blob/main/pkg/beacon/dkg/dkg_test.go#L163 Also, when the integration tests run the address is the same for the all operators https://github.com/keep-network/keep-core/blob/main/pkg/internal/dkgtest/dkgtest.go#L92 so we can't check the different addresses.
If the list hash computed off-chain matches the hash computed by the on-chain contract
We need to write a test that does the same hashing as we have on-chain. But we will be able to compare them only "manually", ex copy the hash that produced on-chain part and compare it against the off-chain result.