DAC: new endpoint to get binary certificate in DAC CLI
Context
Currently the get_certificate command exposed in command_handlers has defined its own encoding for Certificate_repr.t. This is because:
-
Certificate_repr.encodingisJson_onlyand here we need binary encoding - This command will be used by Kernel SDK which needs the
root_hashfield to be 33 bytes long (first byte must be 0 then 32 bytes of data)
The 33 bytes long encoding for root_hash is not possible without Plugin resolution. Hence, in this MR you will find
- New
GET /v0/serialized_certificatewhich returns the correctly encoded in Binary certificate - New type
serialized_certificateinsideCertificate_repr.V0.Protocol_dependantmodule, to make obvious all these operations are linked to the protocol. - Encoding for the previously new type
- helper function to correctly serialize such a
serialized_certificatetype. - Reworked
wait_for_certificatefunction, which now calls new endpointGET /serialized_certificateto return a correctly binary encoded certificate.
Closes #4514 (closed)
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Gauthier