From 7b6cef8547939729956eb4d230f5dd30f204f991 Mon Sep 17 00:00:00 2001 From: Hazork Date: Sat, 20 Mar 2021 16:16:25 -0300 Subject: [PATCH] Forget to commit this file ;) --- app/src/trading/processor.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/trading/processor.ts b/app/src/trading/processor.ts index 987f349..fe336c7 100644 --- a/app/src/trading/processor.ts +++ b/app/src/trading/processor.ts @@ -18,15 +18,18 @@ export default class TradeProcessor { await this.pipeline.execute(createContext(offer, this)); } - async decline(offer: Offer) { - await offer.decline((err) => { + async decline(offer: OfferContext) { + this.account.storage.saveTransaction(offer, true) + await offer.offer.decline((err) => { if (err) throw err; }); } - async accept(offer: Offer) { - this.account.community.checkConfirmations(); - await offer.accept((err) => { + async accept(offer: OfferContext) { + const {community, storage} = this.account; + community.checkConfirmations(); + storage.saveTransaction(offer, true) + await offer.offer.accept((err) => { if (err) throw err; }); }