Implement per-entry protocol detection and process each contiguous segment with the matching resolver. When a version change is detected, finalize the current resolver’s output and continue resolving the next segment with the new version’s resolver.
Something like this:
- Introduce a helper in
src/method.ts to compute protocol version for a single DIDLogEntry.
- Update
resolveDIDFromLog to iterate over log entries, splitting the log whenever parameters.method changes.
- For each segment, call the appropriate resolver (
v0_5.resolveDIDFromLog or v1.resolveDIDFromLog) and keep track of the most recent doc, meta and did.
- After processing all segments, return the result from the last resolver invocation.
- Add tests demonstrating that a log beginning with
did:webvh:0.5 entries followed by did:webvh:1.0 entries resolves correctly.
- Document this new behavior in
README.md.
Implement per-entry protocol detection and process each contiguous segment with the matching resolver. When a version change is detected, finalize the current resolver’s output and continue resolving the next segment with the new version’s resolver.
Something like this:
src/method.tsto compute protocol version for a singleDIDLogEntry.resolveDIDFromLogto iterate over log entries, splitting the log wheneverparameters.methodchanges.v0_5.resolveDIDFromLogorv1.resolveDIDFromLog) and keep track of the most recentdoc,metaanddid.did:webvh:0.5entries followed bydid:webvh:1.0entries resolves correctly.README.md.