mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Request accounts in parallel
This commit is contained in:
parent
ca103bfedb
commit
7acc0e4ef8
@ -102,20 +102,21 @@ export class Faucet {
|
|||||||
public async loadAccounts(): Promise<ReadonlyArray<MinimalAccount>> {
|
public async loadAccounts(): Promise<ReadonlyArray<MinimalAccount>> {
|
||||||
const addresses = [this.holderAddress, ...this.distributorAddresses];
|
const addresses = [this.holderAddress, ...this.distributorAddresses];
|
||||||
|
|
||||||
const out: MinimalAccount[] = [];
|
return Promise.all(
|
||||||
for (const address of addresses) {
|
addresses.map(
|
||||||
const response = await this.readOnlyClient.getAccount(address);
|
async (address): Promise<MinimalAccount> => {
|
||||||
if (response) {
|
const response = await this.readOnlyClient.getAccount(address);
|
||||||
out.push(response);
|
if (response) {
|
||||||
} else {
|
return response;
|
||||||
out.push({
|
} else {
|
||||||
address: address,
|
return {
|
||||||
balance: [],
|
address: address,
|
||||||
});
|
balance: [],
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
},
|
||||||
return out;
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async refill(): Promise<void> {
|
public async refill(): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user