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

Make ShieldData self contained #61

Merged
merged 3 commits into from Nov 3, 2023
Merged

Conversation

panleone
Copy link
Member

@panleone panleone commented Nov 2, 2023

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 it
  • save and load are no longer async
  • On MPW we don't have to save separately ShieldData and extfvk

@panleone panleone requested a review from Duddino November 2, 2023 21:21
@panleone panleone added the enhancement New feature or request label Nov 2, 2023
@panleone panleone self-assigned this Nov 2, 2023
this.isTestNet,
);
if (address != shieldData.defaultAddress) {
load(shieldData) {
Copy link
Member

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

@panleone
Copy link
Member Author

panleone commented Nov 3, 2023

done

Comment on lines 207 to 209
* Creates a PIVXShield object from a ShieldData
* @param {ShieldData} shieldData - shield data
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@Duddino Duddino merged commit caebc23 into PIVX-Labs:master Nov 3, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants