You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #generateOperation(), the previous property is set for all non-create operations. Based on the name, my first assumption was that it's just a pointer to the previous operation. From the implementation I suppose that it's a pointer to the "relevant" previous operation, i.e.
for update operations, it points to the last create/update/recover operation
for recover operations, it points to the last create/recover operation
(so that we can access the relevant private key in generateRequest). Is this understanding correct?
The logic that is implemented there is non-trivial and should either be refactored or explained with a comment IMHO. Also, wouldn't it make more sense to iterate through the array from the end and stop once the relevant operation is found?
In
#generateOperation()
, theprevious
property is set for all non-create operations. Based on the name, my first assumption was that it's just a pointer to the previous operation. From the implementation I suppose that it's a pointer to the "relevant" previous operation, i.e.(so that we can access the relevant private key in generateRequest). Is this understanding correct?
The logic that is implemented there is non-trivial and should either be refactored or explained with a comment IMHO. Also, wouldn't it make more sense to iterate through the array from the end and stop once the relevant operation is found?
ion-tools/src/did.js
Lines 38 to 42 in 02199dd
If my understanding is correct and you agree, I can open a PR to suggest an improved implementation.
The text was updated successfully, but these errors were encountered: