Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqiang90 committed Jul 30, 2024
1 parent 9791576 commit 8121e48
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/node/src/indexer/apiPromise.connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ export class ApiPromiseConnection
fetchBlocksBatches: GetFetchFunc,
args: { chainTypes?: RegisteredTypes },
): Promise<ApiPromiseConnection> {
const api = await this.createApiPromise(endpoint, args);
return new ApiPromiseConnection(api, fetchBlocksBatches);
}

static async createApiPromise(
endpoint: string,
args: { chainTypes?: RegisteredTypes },
): Promise<ApiPromise> {
let provider: ProviderInterface;
let throwOnConnect = false;

Expand All @@ -92,7 +84,8 @@ export class ApiPromiseConnection
...args.chainTypes,
};

return ApiPromise.create(apiOption);
const api = await ApiPromise.create(apiOption);
return new ApiPromiseConnection(api, fetchBlocksBatches);
}

safeApi(height: number): ApiAt {
Expand Down

0 comments on commit 8121e48

Please sign in to comment.