-
Notifications
You must be signed in to change notification settings - Fork 57
Fix NamespaceId and MosaicId hash algorithm resolution #355
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
Conversation
…icId.createFromNonce
default networkType removed; PR should be good to fix namespaceId hash and mosaicId hash generation on keccak using network type to resolve signature schema. |
* @param encoded | ||
* | ||
* @param {string} encoded Hexadecimal notation of namespace id | ||
* @param {NetworkType} networkType The network type for hash algorithm resolution |
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.
redundant
constructor(id: string | number[]) { | ||
constructor( | ||
id: string | number[], | ||
networkType?: NetworkType, |
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.
should remove the ?
I think
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.
no its intended ; using !
in else block.
When you instantiate a NamespaceId by number[] you don't need any NetworkType and would be wrong to default it then to something.
When you instantiate by string, you always need the networkType.
So finally NamespaceId name resolution depends on the hash algorithm/network type? I have this PR on hold: https://github.com/nemtech/nem2-sdk-java/pull/165 Should I pick it up? |
closed not merged. |
Added
networkType
parameter forNamespaceId
andMosaicId
constructorsFixed
mosaicId
andnamespaceId
static method now resolving hash algorithm fromnetworkType
parameters, defaulted to NetworkType.MIJIN_TESTChanged
IdGenerator
.