-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ref-imp): #781 - make long form use jcs SIP2 #864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, would prefer to see better type checking, but its not a reason to hold up the PR.
@@ -7,6 +7,7 @@ import Operation from './Operation'; | |||
import OperationModel from './models/OperationModel'; | |||
import OperationType from '../../enums/OperationType'; | |||
import SidetreeError from '../../../common/SidetreeError'; | |||
import JsonCanonicalizer from './util/JsonCanonicalizer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: sort, or perhaps once and for all: https://eslint.org/docs/rules/sort-imports
// thus an operation with invalid `delta` needs to be processed as an operation with unavailable `delta`, | ||
// so here we let `delta` be `undefined`. | ||
} | ||
encodedDelta = Encoder.encode(JsonCanonicalizer.canonicalizeAsBuffer(operationObject.delta)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity: I suppose this is temporary right? As in this encoded string is not going to be useable for the other code path, the property is probably entirely unnecessary after SIP2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is just here because createOperation still needs it for now.
const actual = Multihash.canonicalizeThenHashThenEncode(suffixData); | ||
const expected = fs.readFileSync('tests/fixtures/uniqueSuffix/resultingSuffix.txt', 'utf8'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: I can see the argument for external files. Though I'd suggest to encapsulate/hide info when possible, in this case I suggest to have both JSON inline instead of external file 'coz those data are not used anywhere.
No description provided.