From 8aaa886dc8b301eddbca2e5abebe0881af885b21 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 1 Apr 2021 21:48:15 +0300 Subject: [PATCH] Remove withdraw console.log (#5004) * Remove withdraw console.log * var naming * 64 default in a batch * Reset to 128 --- packages/page-parachains/src/Crowdloan/Refund.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/page-parachains/src/Crowdloan/Refund.tsx b/packages/page-parachains/src/Crowdloan/Refund.tsx index 12769d5be1..5f415e4091 100644 --- a/packages/page-parachains/src/Crowdloan/Refund.tsx +++ b/packages/page-parachains/src/Crowdloan/Refund.tsx @@ -20,13 +20,13 @@ interface Props { paraId: ParaId; } -function createExtrinsics (api: ApiPromise, addresses: string[], paraId: ParaId, maxPayouts: number): SubmittableExtrinsic<'promise'>[] { +function createExtrinsics (api: ApiPromise, addresses: string[], paraId: ParaId, batchSize: number): SubmittableExtrinsic<'promise'>[] { return addresses .reduce((batches: SubmittableExtrinsic<'promise'>[][], address): SubmittableExtrinsic<'promise'>[][] => { const tx = api.tx.crowdloan.withdraw(address, paraId); const batch = batches[batches.length - 1]; - if (batch.length >= maxPayouts) { + if (batch.length >= batchSize) { batches.push([tx]); } else { batch.push(tx); @@ -93,11 +93,9 @@ function Refund ({ allAccounts, className, myAccounts, paraId }: Props): React.R ? allAccounts : myAccounts; - console.log('batchSize=', batchSize); - setExtrinsics(() => batchSize && addresses.length - ? createExtrinsics(api, allAccounts, paraId, batchSize) + ? createExtrinsics(api, addresses, paraId, batchSize) : null ); }, [api, allAccounts, batchSize, myAccounts, paraId, withdrawType]);