diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-07 13:37:32 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-07 13:37:32 +0530 |
commit | fb2e2f89935240666de66e4b2c11125cb3b2943d (patch) | |
tree | 7b7e148e6cce7bf7639a5e35102f5269f5920ab5 /src/operations/pending.ts | |
parent | 1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca (diff) | |
download | wallet-core-fb2e2f89935240666de66e4b2c11125cb3b2943d.tar.xz |
more lint fixes
Diffstat (limited to 'src/operations/pending.ts')
-rw-r--r-- | src/operations/pending.ts | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/operations/pending.ts b/src/operations/pending.ts index cee929aa2..3e548a27f 100644 --- a/src/operations/pending.ts +++ b/src/operations/pending.ts @@ -37,7 +37,7 @@ import { } from "../util/time"; import { TransactionHandle } from "../util/query"; import { InternalWalletState } from "./state"; -import { getBalances, getBalancesInsideTransaction } from "./balance"; +import { getBalancesInsideTransaction } from "./balance"; import { ReserveType } from "../types/history"; function updateRetryDelay( @@ -286,13 +286,23 @@ async function gatherProposalPending( if (onlyDue) { return; } - resp.pendingOperations.push({ - type: PendingOperationType.ProposalChoice, - givesLifeness: false, - merchantBaseUrl: proposal.download!!.contractData.merchantBaseUrl, - proposalId: proposal.proposalId, - proposalTimestamp: proposal.timestamp, - }); + const dl = proposal.download; + if (!dl) { + resp.pendingOperations.push({ + type: PendingOperationType.Bug, + message: "proposal is in invalid state", + details: {}, + givesLifeness: false, + }); + } else { + resp.pendingOperations.push({ + type: PendingOperationType.ProposalChoice, + givesLifeness: false, + merchantBaseUrl: dl.contractData.merchantBaseUrl, + proposalId: proposal.proposalId, + proposalTimestamp: proposal.timestamp, + }); + } } else if (proposal.proposalStatus == ProposalStatus.DOWNLOADING) { resp.nextRetryDelay = updateRetryDelay( resp.nextRetryDelay, |