Remove withdraw console.log (#5004)
* Remove withdraw console.log * var naming * 64 default in a batch * Reset to 128
This commit is contained in:
parent
82bf02ebda
commit
8aaa886dc8
@ -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]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user