-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Currently, all cryptolinks in the sigchain are considered as additions to the sigchain. That is, there's no notion of revocation. As such, getAllCryptolinks() simply retrieves all claims from the sigchain that have a claimType of 'cryptolink'.
To introduce revocations, we'll need to restructure the Cryptolink ClaimData type a bit to include a flag or different type that signals the cryptolink is being revoked, instead of being added. Once this is introduced, we'll need to alter getAllCryptolinks() to only include the cryptolinks that have not been revoked (i.e. start from the most recent link in the chain).
A better solution would be to persist a map of LinkId (or whatever the unique identifier of a cryptolink is) to the sequence number of the Claim in the sigchain. If a cryptolink is revoked, we would simply remove its entry in this map. Thus, to getAllCryptolinks(), we would simply get all the sequence numbers from this map, and return an array of Claims from these sequence numbers.