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
Make ShieldData self contained #61
Conversation
js/pivx_shield.js
Outdated
this.isTestNet, | ||
); | ||
if (address != shieldData.defaultAddress) { | ||
load(shieldData) { |
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.
I would make load
static and make it return a PIVXShield instance instead of adding other things to the create function
done |
js/pivx_shield.js
Outdated
* Creates a PIVXShield object from a ShieldData | ||
* @param {ShieldData} shieldData - shield data | ||
*/ |
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.
* Creates a PIVXShield object from a ShieldData | |
* @param {ShieldData} shieldData - shield data | |
*/ | |
* Creates a PIVXShield object from a ShieldData | |
* @param {string} shieldData - shield data | |
*/ |
Change this to string and add JSON.parse
inside the function. We are not making shieldData transparent to the user, so I would avoid passing the object directly.
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.
done
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.
utACK
save and load the extended full viewing key in place of a useless default address in this way:
ShieldData
is self contained and we can create a full view instance only from itsave
andload
are no longer asyncShieldData
andextfvk