Closed Patrik-Stas closed 8 months ago
Attention: Patch coverage is 0%
with 189 lines
in your changes are missing coverage. Please review.
Project coverage is 0.05%. Comparing base (
413b183
) to head (d3a02ef
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Removes custom
DidDocumentBuilder
in favor of setters onDidDocument
itself.Rationale:
id
are optional, so the builder itself didn't do much in terms of assuringDidDocument
being valid. Rather then playing typical role of builder, assuring correctness of constructed datastructure,DidDocumentBuilder
was rather used in manner of signalling "mut DidDoc". You could had very well renameDidDocumentBuilder
toMutableDidDocument
and the code would had been still making sense. This made implementation somewhat awkward where DidDocument had to be converted toDidDocumentBuilder
in order to be edited (eg.DidPeerResolver
), then subsequently converted back toDidDoc
after edit.It's worth noting that the mutating method could in future performs runtime checks, such as whether a provided
DidUrl
reference (egpub fn add_authentication_ref(&mut self, reference: DidUrl)
) is referring to existingVerificationMethod
.Additionally:
DidPeer4ConstructionDidDoc