From 61172f76a947495a120902d0b2892d1bfe008693 Mon Sep 17 00:00:00 2001 From: gandlaf21 Date: Tue, 16 May 2023 09:55:25 +0200 Subject: [PATCH] resolve --- src/CashuWallet.ts | 49 +--------------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/src/CashuWallet.ts b/src/CashuWallet.ts index 6bd6fc8b..c0c0a09a 100644 --- a/src/CashuWallet.ts +++ b/src/CashuWallet.ts @@ -173,7 +173,7 @@ class CashuWallet { * @param tokenEntry a single entry of a cashu token * @returns New token entry with newly created proofs, proofs that had errors, and newKeys if they have changed */ - private async receiveTokenEntry(tokenEntry: TokenEntry): Promise { + async receiveTokenEntry(tokenEntry: TokenEntry): Promise { const proofsWithError: Array = []; const proofs: Array = []; let newKeys: MintKeys | undefined; @@ -275,53 +275,6 @@ class CashuWallet { newKeys: await this.changedKeys(promises) }; } -<<<<<<< HEAD -<<<<<<< HEAD - - async receiveTokenEntry(tokenEntry: TokenEntry): Promise { - const proofsWithError: Array = []; - const proofs: Array = []; - let newKeys: MintKeys | undefined; - try { - const amount = tokenEntry.proofs.reduce((total, curr) => total + curr.amount, 0); - const { payload, amount1BlindedMessages, amount2BlindedMessages } = this.createSplitPayload( - 0, - amount, - tokenEntry.proofs - ); - const { fst, snd } = await CashuMint.split(tokenEntry.mint, payload); - const proofs1 = dhke.constructProofs( - fst, - amount1BlindedMessages.rs, - amount1BlindedMessages.secrets, - await this.getKeys(fst, tokenEntry.mint) - ); - const proofs2 = dhke.constructProofs( - snd, - amount2BlindedMessages.rs, - amount2BlindedMessages.secrets, - await this.getKeys(snd, tokenEntry.mint) - ); - proofs.push(...proofs1, ...proofs2); - newKeys = - tokenEntry.mint === this.mint.mintUrl - ? await this.changedKeys([...(fst || []), ...(snd || [])]) - : undefined; - } catch (error) { - console.error(error); - proofsWithError.push(...tokenEntry.proofs); - } - return { - proofs, - proofsWithError: proofsWithError.length ? proofsWithError : undefined, - newKeys - }; - } -======= - ->>>>>>> ts docs -======= ->>>>>>> format private async initKeys() { if (!this.keysetId || !Object.keys(this.keys).length) {