Skip to content

Commit ee95d43

Browse files
authored
fix redundant async (#77)
Signed-off-by: Nguyen Le Vu Long <vulongvn98@gmail.com>
1 parent 19b4b0c commit ee95d43

7 files changed

Lines changed: 12 additions & 13 deletions

File tree

examples/build-tx-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ export async function _multiRoutingTxExample(
776776
});
777777
}
778778

779-
export async function _cancelV2TxExample(
779+
export function _cancelV2TxExample(
780780
lucid: Lucid,
781781
adapter: Adapter
782782
): Promise<TxComplete> {
@@ -1032,7 +1032,7 @@ export async function _zapOutStableExample(
10321032
});
10331033
}
10341034

1035-
export async function _bulkOrderStableExample(
1035+
export function _bulkOrderStableExample(
10361036
lucid: Lucid,
10371037
address: string,
10381038
availableUtxos: Utxo[]

src/dao.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Dao {
4141
* This method builds a transaction with metadata that requests fee changes for a pool.
4242
* The transaction must be signed by the pool manager address.
4343
*/
44-
async updatePoolFeeTx(
44+
updatePoolFeeTx(
4545
options: Omit<PoolFeeRequest, "version">
4646
): Promise<TxComplete> {
4747
const { managerAddress, poolLPAsset, newFeeA, newFeeB } = options;

src/dex-v2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ export class DexV2 {
743743
}
744744
}
745745

746-
async createBulkOrdersTx({
746+
createBulkOrdersTx({
747747
sender,
748748
orderOptions,
749749
expiredOptions,

src/syncer/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function start(): Promise<void> {
3333
}
3434
}
3535

36-
async function main(): Promise<void> {
36+
function main(): Promise<void> {
3737
return backOff(start, {
3838
retry(err, attempt): boolean {
3939
console.error(`Fail to run syncer, retry ${attempt}...`, err);

src/syncer/repository/postgres-repository.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class PostgresRepositoryWriter extends PostgresRepositoryWriterInTransact
342342
this.prismaClientTx = prismaClient;
343343
}
344344

345-
async transaction(
345+
transaction(
346346
fn: (repo: PostgresRepositoryWriterInTransaction) => Promise<void>,
347347
options: { timeout?: number; maxWait?: number },
348348
): Promise<void> {
@@ -352,4 +352,3 @@ export class PostgresRepositoryWriter extends PostgresRepositoryWriterInTransact
352352
);
353353
}
354354
}
355-

src/utils/job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function runRecurringJob({
3434
}
3535
}
3636

37-
async function sleep(durationInMs: number): Promise<unknown> {
37+
function sleep(durationInMs: number): Promise<unknown> {
3838
return new Promise((resolve) => {
3939
setTimeout(() => {
4040
resolve({ error: false, message: `Slept for ${durationInMs} ms` });

src/utils/lucid.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ import { NetworkId } from "../types/network";
1515
* @param address Your own address
1616
* @returns
1717
*/
18-
export async function getBackendBlockfrostLucidInstance(
18+
export function getBackendBlockfrostLucidInstance(
1919
networkId: NetworkId,
2020
projectId: string,
2121
blockfrostUrl: string,
2222
address: string,
23-
): Promise<Lucid> {
23+
): Lucid {
2424
const provider = new Blockfrost(blockfrostUrl, projectId);
2525
const lucid = new Lucid({
2626
provider: provider,
27-
network: networkId === NetworkId.MAINNET ? 'Mainnet' : 'Preprod',
27+
network: networkId === NetworkId.MAINNET ? "Mainnet" : "Preprod",
2828
});
2929
lucid.selectReadOnlyWallet({
3030
address: address,
@@ -39,11 +39,11 @@ export async function getBackendBlockfrostLucidInstance(
3939
* @param address Your own address
4040
* @returns
4141
*/
42-
export async function getBackendMaestroLucidInstance(
42+
export function getBackendMaestroLucidInstance(
4343
network: MaestroSupportedNetworks,
4444
apiKey: string,
4545
address: string,
46-
): Promise<Lucid> {
46+
): Lucid {
4747
const provider = new Maestro({
4848
network: network,
4949
apiKey: apiKey,

0 commit comments

Comments
 (0)