-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversion of Name to Id #85
Conversation
Merging with UpStream Master
@astroseger You can also start the changes in the CLI based on the Registry Function prototype changes. Mostly the following changes are required:
|
|
@astroseger I dont like to keep Build folder in the git. It should be part of git ignore, mostly it might have missed. Will remove it. Thanks! Will add the function to update orgName as we dont have any method to modify the same. Will do it. Thanks! |
@ksridharbabuus |
will do the change |
@astroseger Changes to Registry are done. |
But why bytes? I've already change snet-cli to deal with orgName type=string.... |
Actually it is not very important... But I think string makes more sense for orgName to avoid encoding and decoding to and from utf-8. |
@astroseger I prefer to use bytes compared to string in Solidity. I agree there might be additional function call in f/w to decode the value. Let us keep it as bytes. |
@astroseger In case if it takes longer time for the CLI changes (String to bytes) then I can convert to String in the Registry Contract. Let me know. Thanks! |
@ksridharbabuus disadvantage of keeping it in "bytes" is following: we have to agree in which encoding we store organizationName. And we need to consistently follow this agreement in all apps. If we keep it in "string" then this "agreement" is already fixed in solidity, and we don't need to deal with it. So it is a little bit more clean. But of course difference is not so important. @vforvalerio87 @tiero What do you think? (from other side I chose bytes for metadataURI, because in the future it might be something more complicated than simple utf-8 encoded string. For example it could be http URI + binary hash) |
@astroseger I dont want restrict to UTF8 for the Orgname to enable other languages as well. If we are fine only to have UTF8 then I can convert to string. |
@astroseger anyway for globalization we need to change in lots of other places. Let me change it string then. |
@@ -1,5 +1,7 @@ | |||
"use strict"; | |||
var Registry = artifacts.require("./Registry.sol"); | |||
let { HELPERS } = require("./util/Util.js"); | |||
let { bytesToString} = HELPERS; |
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.
You don't need bytesToString anymore.. But it is a minor comment anyway...
Converting name index to Id index for better uniqueness of the Organizations, services and type repos. Added Organization Name and updated few methods to refer by Id instead of Name.