This PR makes the Committee structure the entry point in the SSV module.
Before, we had both Committee and Validator as distinct entry points. Now, Committee holds Validator objects and redirects messages and duty-start events to the appropriate validator object.
Extra changes
As refactoring, this PR also:
drops unused attributes of the Validator structure
refactors the previous ProcessMessage function existent in Committee and Validator to a unique one to avoid duplicated knowledge
Added tests
[x] Unknown duty type
[x] Unknown validator for committee
[x] Message validation: empty data
[x] Message validation: unknown MsgType
[!NOTE]
For the test case of a message with MessageID that doesn't belong to either the committee or to a validator, we already had the WrongMessageID test. Thus, we simply aligned the error string.
Overview
This PR makes the
Committee
structure the entry point in theSSV
module.Before, we had both
Committee
andValidator
as distinct entry points. Now,Committee
holdsValidator
objects and redirects messages and duty-start events to the appropriate validator object.Extra changes
As refactoring, this PR also:
Validator
structureProcessMessage
function existent inCommittee
andValidator
to a unique one to avoid duplicated knowledgeAdded tests
Closes https://github.com/ssvlabs/ssv-spec/issues/451