Skip to content

Commit

Permalink
prettier fix for query_runner
Browse files Browse the repository at this point in the history
  • Loading branch information
lyaunzbe committed Mar 31, 2021
1 parent 5752486 commit 7b5e278
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions staking-api/src/query_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ export class QueryRunner {
}

public async getStakingPoolEpochRewardsAsync(poolId: string): Promise<PoolEpochRewards[]> {
const rawPoolEpochRewards: RawPoolEpochRewards[] = await (
await getDbAsync()
).query(queries.poolEpochRewardsOldQuery, [poolId]);
const rawPoolEpochRewards: RawPoolEpochRewards[] = await (await getDbAsync()).query(
queries.poolEpochRewardsOldQuery,
[poolId],
);
const poolEpochRewards = stakingUtils.getPoolEpochRewardsFromRaw(rawPoolEpochRewards);
return poolEpochRewards;
}
Expand All @@ -131,9 +132,10 @@ export class QueryRunner {
const rawAllTimePoolRewards = (await (await getDbAsync()).query(queries.allTimePoolRewardsQuery, [
poolId,
])) as RawAllTimePoolRewards[];
const rawTotalPoolProtocolFeesGenerated = (await (
await getDbAsync()
).query(queries.poolTotalProtocolFeesGeneratedQuery, [poolId])) as RawPoolTotalProtocolFeesGenerated[];
const rawTotalPoolProtocolFeesGenerated = (await (await getDbAsync()).query(
queries.poolTotalProtocolFeesGeneratedQuery,
[poolId],
)) as RawPoolTotalProtocolFeesGenerated[];

const rawAllTimePoolRewardsHead = _.head(rawAllTimePoolRewards);
const rawTotalPoolProtocolFeesGeneratedHead = _.head(rawTotalPoolProtocolFeesGenerated);
Expand All @@ -160,9 +162,10 @@ export class QueryRunner {
const pool = await this.getStakingPoolAsync(poolId);
const rawCurrentEpochPoolStats = await (await getDbAsync()).query(queries.currentEpochPoolStatsQuery, [poolId]);
const rawNextEpochPoolStats = await (await getDbAsync()).query(queries.nextEpochPoolStatsQuery, [poolId]);
const rawPoolSevenDayProtocolFeesGenerated = await (
await getDbAsync()
).query(queries.poolSevenDayProtocolFeesGeneratedQuery, [poolId]);
const rawPoolSevenDayProtocolFeesGenerated = await (await getDbAsync()).query(
queries.poolSevenDayProtocolFeesGeneratedQuery,
[poolId],
);
const rawAvgReward = await (await getDbAsync()).query(queries.poolAvgRewardsQuery, [poolId]);

const currentEpochPoolStats = stakingUtils.getEpochPoolStatsFromRaw(rawCurrentEpochPoolStats[0]);
Expand Down

0 comments on commit 7b5e278

Please sign in to comment.