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

Shield Activity #416

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

panleone
Copy link
Member

@panleone panleone commented Oct 4, 2024

Abstract

Implements shield activity, i.e. shield transactions regarding the wallet are decrypted and loaded in the dashboard activity.

3 new transactions types have been added:

  • Shielding, which is a self (t -> s) transaction;
  • De-Shielding, which is a self (s->t) transaction;
  • Shield sent to self, which is a self (s->s) transaction.

shield_activity

Transactions received and sent to external wallets are marked as before, with the addition of shield addresses:

  • Sent to (transparent or shield address);
  • Received with (transparent or shield address)

I suggest to review the PR commit by commit, is easier than looking at the overall diff. Also to test the PR you have to manually build and use the following version of the pivx-shield library: PR 81.


Testing

To test this PR, it's suggested to attempt these user flows, or variations of these:

  • Create and sync a shield wallet;
  • Create the 3 new types of transaction;
  • Send/Receive shielded pivs from an external wallet;
  • Close and re-open the wallet: the shield activity should be unchanged;
  • Resync the wallet from zero: the shield activity should be unchanged.

@panleone panleone self-assigned this Oct 4, 2024
Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for cheery-moxie-4f1121 ready!

Name Link
🔨 Latest commit 6e90c82
🔍 Latest deploy log https://app.netlify.com/sites/cheery-moxie-4f1121/deploys/671f6baac1596a0008d773fd
😎 Deploy Preview https://deploy-preview-416--cheery-moxie-4f1121.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@panleone panleone mentioned this pull request Oct 4, 2024
5 tasks
@JSKitty JSKitty added the Enhancement New feature or request label Oct 5, 2024
@Duddino
Copy link
Member

Duddino commented Oct 5, 2024

diff --git a/package.json b/package.json
index 547b11a..4b044ca 100644
--- a/package.json
+++ b/package.json
@@ -89,9 +89,9 @@
         "jquery": "^3.6.3",
         "pinia": "^2.1.7",
         "pivx-promos": "^0.2.0",
-        "pivx-shield": "^1.1.6",
-        "pivx-shield-rust": "^1.1.6",
-        "pivx-shield-rust-multicore": "^1.1.10",
+        "pivx-shield": "^1.2.0-0",
+        "pivx-shield-rust": "^1.2.0-0",
+        "pivx-shield-rust-multicore": "^1.2.0-1",
         "qr-scanner": "^1.4.2",
         "qrcode-generator": "^1.4.4",
         "vue": "^3.3.4",

I published a beta version with pivx-shield#81, apply this patch and npm i to use

* @param {number} amount - The net amount of transparent PIVs in a transaction
* @param {number} shieldAmount - The net amount of shielded PIVs in a transaction
*/
function txSelfMap(amount, shieldAmount) {
Copy link
Member

Choose a reason for hiding this comment

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

Follow the design colors/icons

scripts/wallet.js Outdated Show resolved Hide resolved
@panleone panleone requested a review from Duddino October 11, 2024 08:35
@panleone
Copy link
Member Author

panleone commented Oct 11, 2024

Reviews applied:

  • Moved the reverse and swap endianess to utils.js
  • Fixed the bug where some txs were markes as "Sent to shield address", even if only the change was shielded
  • Made wallets automatically resync when they use the new shielding version for the first time

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
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants