fix: not saving planchet as kyc required

This commit is contained in:
Sebastian 2023-02-10 12:53:02 -03:00
parent 3ade15e5e5
commit 599c6fa954
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -549,7 +549,7 @@ async function processPlanchetExchangeBatchRequest(
};
}
async function handleKycRequired(resp: HttpResponse, startIdx: number) {
async function handleKycRequired(resp: HttpResponse, startIdx: number): Promise<void> {
logger.info("withdrawal requires KYC");
const respJson = await resp.json();
const uuidResp = codecForWalletKycUuid().decode(respJson);
@ -557,7 +557,7 @@ async function processPlanchetExchangeBatchRequest(
await ws.db
.mktx((x) => [x.planchets, x.withdrawalGroups])
.runReadWrite(async (tx) => {
for (let i = 0; i < startIdx; i++) {
for (let i = startIdx; i < coinIdxs.length; i++) {
let planchet = await tx.planchets.indexes.byGroupAndIndex.get([
withdrawalGroup.withdrawalGroupId,
coinIdxs[i],
@ -583,7 +583,7 @@ async function processPlanchetExchangeBatchRequest(
return;
}
async function storeCoinError(e: any, coinIdx: number) {
async function storeCoinError(e: any, coinIdx: number): Promise<void> {
const errDetail = getErrorDetailFromException(e);
logger.trace("withdrawal request failed", e);
logger.trace(String(e));