Skip to content

Commit

Permalink
remove unneeded reserved field in token to send (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Jul 12, 2024
1 parent 54926a7 commit 9f57bd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/stores/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export const useWalletStore = defineStore("wallet", {
mintStore.removeProofs(proofsToSplit);
return { keepProofs, sendProofs };
},
splitToSend: async function (proofs: WalletProof[], amount: number, invlalidate: boolean = false) {
splitToSend: async function (proofs: WalletProof[], amount: number, invalidate: boolean = false) {
/*
splits proofs so the user can keep firstProofs, send scndProofs.
then sets scndProofs as reserved.
Expand Down Expand Up @@ -332,12 +332,19 @@ export const useWalletStore = defineStore("wallet", {
mintStore.addProofs(sendProofs);
} else if (totalAmount == amount) {
keepProofs = [];
sendProofs = proofsToSplit;
sendProofs = proofsToSplit.map((p) => {
return {
amount: p.amount,
secret: p.secret,
C: p.C,
id: p.id,
};
});
} else {
throw new Error("could not split proofs.");
}

if (invlalidate) {
if (invalidate) {
mintStore.removeProofs(sendProofs);
}

Expand Down

0 comments on commit 9f57bd4

Please sign in to comment.