Skip to content
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

Merged
merged 13 commits into from
Sep 23, 2020

Conversation

isaacJChen
Copy link
Contributor

No description provided.

OR13
OR13 previously approved these changes Sep 21, 2020
Copy link
Contributor

@OR13 OR13 left a 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.

@isaacJChen isaacJChen changed the title WIP: feat(ref-imp): #781 - make long form use jcs SIP2 feat(ref-imp): #781 - make long form use jcs SIP2 Sep 22, 2020
@@ -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';
Copy link
Collaborator

@thehenrytsai thehenrytsai Sep 22, 2020

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));
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Comment on lines +114 to +115
const actual = Multihash.canonicalizeThenHashThenEncode(suffixData);
const expected = fs.readFileSync('tests/fixtures/uniqueSuffix/resultingSuffix.txt', 'utf8');
Copy link
Collaborator

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.

@isaacJChen isaacJChen merged commit 5808eaf into master Sep 23, 2020
@thehenrytsai thehenrytsai deleted the ische/makeLongFormUseJCS branch July 16, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants