Skip to content

Commit 6fdb00b

Browse files
committed
run prettier try2
1 parent 3ff5a42 commit 6fdb00b

39 files changed

+213
-213
lines changed

subgraphs/m0-power/src/common/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const BIGINT_THOUSAND = BigInt.fromI32(1000);
4242
export const BIGINT_TEN_TO_EIGHTEENTH = BigInt.fromString("10").pow(18);
4343
export const BIGINT_MINUS_ONE = BigInt.fromI32(-1);
4444
export const BIGINT_MAX = BigInt.fromString(
45-
"115792089237316195423570985008687907853269984665640564039457584007913129639935",
45+
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
4646
);
4747

4848
export const INT_NEGATIVE_ONE = -1 as i32;
@@ -70,7 +70,7 @@ export const SECONDS_PER_HOUR_BI = BigInt.fromI32(SECONDS_PER_HOUR);
7070
export const MS_PER_DAY = new BigDecimal(BigInt.fromI32(24 * 60 * 60 * 1000));
7171
export const DAYS_PER_YEAR = new BigDecimal(BigInt.fromI32(365));
7272
export const MS_PER_YEAR = DAYS_PER_YEAR.times(
73-
new BigDecimal(BigInt.fromI32(24 * 60 * 60 * 1000)),
73+
new BigDecimal(BigInt.fromI32(24 * 60 * 60 * 1000))
7474
);
7575

7676
////////////////

subgraphs/m0-power/src/common/initializers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function initializeSDKFromEvent(event: ethereum.Event): SDK {
1313
constants.Protocol.ID,
1414
constants.Protocol.NAME,
1515
constants.Protocol.SLUG,
16-
Versions,
16+
Versions
1717
);
1818
const tokenPricer = new Pricer();
1919
const tokenInitializer = new TokenInit();
@@ -22,7 +22,7 @@ export function initializeSDKFromEvent(event: ethereum.Event): SDK {
2222
protocolConfig,
2323
tokenPricer,
2424
tokenInitializer,
25-
event,
25+
event
2626
);
2727

2828
return sdk;
@@ -35,7 +35,7 @@ export function getOrCreatePool(poolAddress: Address, sdk: SDK): Pool {
3535
const minterContract = Minter.bind(poolAddress);
3636
const outputTokenAddress = readValue<Address>(
3737
minterContract.try_mToken(),
38-
constants.NULL.TYPE_ADDRESS,
38+
constants.NULL.TYPE_ADDRESS
3939
);
4040

4141
const outputToken = sdk.Tokens.getOrCreateToken(outputTokenAddress);
@@ -44,7 +44,7 @@ export function getOrCreatePool(poolAddress: Address, sdk: SDK): Pool {
4444
outputToken.name,
4545
outputToken.symbol,
4646
[Address.fromString(constants.USDC_ADDRESS)],
47-
outputToken,
47+
outputToken
4848
);
4949
}
5050

@@ -60,7 +60,7 @@ export function updatePoolOutputTokenSupply(pool: Pool): void {
6060

6161
const outputTokenSupply = readValue<BigInt>(
6262
contract.try_totalSupply(),
63-
constants.BIGINT_ZERO,
63+
constants.BIGINT_ZERO
6464
);
6565

6666
pool.setOutputTokenSupply(outputTokenSupply);

subgraphs/m0-power/src/common/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Address, BigDecimal, BigInt, ethereum } from "@graphprotocol/graph-ts";
99

1010
export function readValue<T>(
1111
callResult: ethereum.CallResult<T>,
12-
defaultValue: T,
12+
defaultValue: T
1313
): T {
1414
return callResult.reverted ? defaultValue : callResult.value;
1515
}
@@ -46,7 +46,7 @@ export class TokenInit implements TokenInitializer {
4646
const symbol = readValue<string>(contract.try_symbol(), default_symbol);
4747
const decimals = readValue<BigInt>(
4848
contract.try_decimals(),
49-
BigInt.fromI32(default_decimals),
49+
BigInt.fromI32(default_decimals)
5050
).toI32();
5151

5252
return new TokenParams(name, symbol, decimals);

subgraphs/m0-power/src/prices/calculations/CalculationsCurve.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CalculationsCurve as CalculationsCurveContract } from "../../../generat
66

77
export function getCalculationsCurveContract(
88
contract: OracleContract,
9-
block: ethereum.Block | null = null,
9+
block: ethereum.Block | null = null
1010
): CalculationsCurveContract | null {
1111
if (
1212
(block && contract.startBlock.gt(block.number)) ||
@@ -19,7 +19,7 @@ export function getCalculationsCurveContract(
1919

2020
export function getTokenPriceUSDC(
2121
tokenAddr: Address,
22-
block: ethereum.Block | null = null,
22+
block: ethereum.Block | null = null
2323
): CustomPriceType {
2424
const config = utils.getConfig();
2525

@@ -28,20 +28,20 @@ export function getTokenPriceUSDC(
2828

2929
const calculationCurveContract = getCalculationsCurveContract(
3030
config.curveCalculations(),
31-
block,
31+
block
3232
);
3333
if (!calculationCurveContract) return new CustomPriceType();
3434

3535
const tokenPrice: BigDecimal = utils
3636
.readValue<BigInt>(
3737
calculationCurveContract.try_getCurvePriceUsdc(tokenAddr),
38-
constants.BIGINT_ZERO,
38+
constants.BIGINT_ZERO
3939
)
4040
.toBigDecimal();
4141

4242
return CustomPriceType.initialize(
4343
tokenPrice,
4444
constants.DEFAULT_USDC_DECIMALS,
45-
constants.OracleType.CURVE_CALCULATIONS,
45+
constants.OracleType.CURVE_CALCULATIONS
4646
);
4747
}

subgraphs/m0-power/src/prices/calculations/CalculationsSushiswap.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CalculationsSushiSwap as CalculationsSushiContract } from "../../../gen
66

77
export function getSushiSwapContract(
88
contract: OracleContract,
9-
block: ethereum.Block | null = null,
9+
block: ethereum.Block | null = null
1010
): CalculationsSushiContract | null {
1111
if (
1212
(block && contract.startBlock.gt(block.number)) ||
@@ -19,7 +19,7 @@ export function getSushiSwapContract(
1919

2020
export function getTokenPriceUSDC(
2121
tokenAddr: Address,
22-
block: ethereum.Block | null = null,
22+
block: ethereum.Block | null = null
2323
): CustomPriceType {
2424
const config = utils.getConfig();
2525

@@ -28,20 +28,20 @@ export function getTokenPriceUSDC(
2828

2929
const calculationSushiContract = getSushiSwapContract(
3030
config.sushiCalculations(),
31-
block,
31+
block
3232
);
3333
if (!calculationSushiContract) return new CustomPriceType();
3434

3535
const tokenPrice: BigDecimal = utils
3636
.readValue<BigInt>(
3737
calculationSushiContract.try_getPriceUsdc(tokenAddr),
38-
constants.BIGINT_ZERO,
38+
constants.BIGINT_ZERO
3939
)
4040
.toBigDecimal();
4141

4242
return CustomPriceType.initialize(
4343
tokenPrice,
4444
constants.DEFAULT_USDC_DECIMALS,
45-
constants.OracleType.SUSHI_CALCULATIONS,
45+
constants.OracleType.SUSHI_CALCULATIONS
4646
);
4747
}

subgraphs/m0-power/src/prices/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export namespace OracleType {
2020
}
2121

2222
export const CHAIN_LINK_USD_ADDRESS = Address.fromString(
23-
"0x0000000000000000000000000000000000000348",
23+
"0x0000000000000000000000000000000000000348"
2424
);
2525

2626
export const PRICE_LIB_VERSION = "1.3.4";

subgraphs/m0-power/src/prices/common/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class OracleContract {
1515

1616
constructor(
1717
contractAddress: string = constants.NULL.TYPE_STRING,
18-
startBlock: i32 = -1,
18+
startBlock: i32 = -1
1919
) {
2020
this._contractAddress = contractAddress;
2121
this._contractStartBlock = startBlock;
@@ -48,7 +48,7 @@ export class CustomPriceType {
4848
_usdPrice: BigDecimal,
4949
_decimals: i32 = 0,
5050
_oracleType: string = "",
51-
_liquidity: BigDecimal | null = null,
51+
_liquidity: BigDecimal | null = null
5252
): CustomPriceType {
5353
const result = new CustomPriceType();
5454
result._usdPrice = new Wrapped(_usdPrice);
@@ -65,7 +65,7 @@ export class CustomPriceType {
6565

6666
get usdPrice(): BigDecimal {
6767
return changetype<Wrapped<BigDecimal>>(this._usdPrice).inner.div(
68-
constants.BIGINT_TEN.pow(this.decimals as u8).toBigDecimal(),
68+
constants.BIGINT_TEN.pow(this.decimals as u8).toBigDecimal()
6969
);
7070
}
7171

@@ -142,6 +142,6 @@ export interface Configurations {
142142

143143
getOracleOverride(
144144
tokenAddr: Address | null,
145-
block: ethereum.Block | null,
145+
block: ethereum.Block | null
146146
): OracleConfig | null;
147147
}

subgraphs/m0-power/src/prices/common/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export function isNullAddress(tokenAddr: Address): boolean {
3131

3232
export function bigIntToBigDecimal(
3333
quantity: BigInt,
34-
decimals: i32 = constants.DEFAULT_DECIMALS.toI32(),
34+
decimals: i32 = constants.DEFAULT_DECIMALS.toI32()
3535
): BigDecimal {
3636
return quantity.divDecimal(
37-
constants.BIGINT_TEN.pow(decimals as u8).toBigDecimal(),
37+
constants.BIGINT_TEN.pow(decimals as u8).toBigDecimal()
3838
);
3939
}
4040

4141
export function readValue<T>(
4242
callResult: ethereum.CallResult<T>,
43-
defaultValue: T,
43+
defaultValue: T
4444
): T {
4545
return callResult.reverted ? defaultValue : callResult.value;
4646
}
@@ -57,7 +57,7 @@ export function getTokenDecimals(tokenAddr: Address): BigInt {
5757

5858
const decimals = readValue<BigInt>(
5959
tokenContract.try_decimals(),
60-
constants.DEFAULT_DECIMALS,
60+
constants.DEFAULT_DECIMALS
6161
);
6262

6363
return decimals;
@@ -68,7 +68,7 @@ export function getTokenSupply(tokenAddr: Address): BigInt {
6868

6969
const totalSupply = readValue<BigInt>(
7070
tokenContract.try_totalSupply(),
71-
constants.BIGINT_ONE,
71+
constants.BIGINT_ONE
7272
);
7373

7474
return totalSupply;
@@ -137,7 +137,7 @@ function pairwiseDiffOfPrices(prices: CustomPriceType[]): BigDecimal[] {
137137

138138
export function kClosestPrices(
139139
k: i32,
140-
prices: CustomPriceType[],
140+
prices: CustomPriceType[]
141141
): CustomPriceType[] {
142142
// sort by USD prices
143143
const pricesSorted = sortByPrices(prices);
@@ -176,6 +176,6 @@ export function averagePrice(prices: CustomPriceType[]): CustomPriceType {
176176

177177
return CustomPriceType.initialize(
178178
summationUSDPrice.div(new BigDecimal(BigInt.fromI32(prices.length as i32))),
179-
constants.DEFAULT_USDC_DECIMALS,
179+
constants.DEFAULT_USDC_DECIMALS
180180
);
181181
}

subgraphs/m0-power/src/prices/config/arbitrum.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export const NETWORK_STRING = "arbitrum-one";
1111

1212
export const YEARN_LENS_CONTRACT_ADDRESS = new OracleContract(
1313
"0x043518ab266485dc085a1db095b8d9c2fc78e9b9",
14-
2396321,
14+
2396321
1515
);
1616
export const AAVE_ORACLE_CONTRACT_ADDRESS = new OracleContract(
1717
"0xb56c2f0b653b2e0b10c9b928c8580ac5df02c7c7",
18-
7740843,
18+
7740843
1919
);
2020
export const SUSHISWAP_CALCULATIONS_ADDRESS = new OracleContract(
2121
"0x5ea7e501c9a23f4a76dc7d33a11d995b13a1dd25",
22-
2396120,
22+
2396120
2323
);
2424
export const CHAIN_LINK_CONTRACT_ADDRESS = new OracleContract();
2525

@@ -29,7 +29,7 @@ export const CHAIN_LINK_CONTRACT_ADDRESS = new OracleContract();
2929

3030
export const CURVE_CALCULATIONS_ADDRESS = new OracleContract(
3131
"0x3268c3bda100ef0ff3c2d044f23eab62c80d78d2",
32-
11707234,
32+
11707234
3333
);
3434

3535
export const CURVE_REGISTRY_ADDRESSES: OracleContract[] = [
@@ -67,13 +67,13 @@ export const HARDCODED_STABLES: Address[] = [];
6767
export const USDC_TOKEN_DECIMALS = BigInt.fromI32(6);
6868

6969
export const ETH_ADDRESS = Address.fromString(
70-
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
70+
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
7171
);
7272
export const WETH_ADDRESS = Address.fromString(
73-
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
73+
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
7474
);
7575
export const USDC_ADDRESS = Address.fromString(
76-
"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
76+
"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8"
7777
);
7878

7979
export class config implements Configurations {
@@ -139,7 +139,7 @@ export class config implements Configurations {
139139

140140
getOracleOverride(
141141
tokenAddr: Address | null,
142-
block: ethereum.Block | null,
142+
block: ethereum.Block | null
143143
): OracleConfig | null {
144144
return null;
145145
}

subgraphs/m0-power/src/prices/config/aurora.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ export const HARDCODED_STABLES: Address[] = [];
5454
export const USDC_TOKEN_DECIMALS = BigInt.fromI32(6);
5555

5656
export const ETH_ADDRESS = Address.fromString(
57-
"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79", // Aurora
57+
"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79" // Aurora
5858
);
5959
export const WETH_ADDRESS = Address.fromString(
60-
"0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb", // WETH
60+
"0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb" // WETH
6161
);
6262
export const USDC_ADDRESS = Address.fromString(
63-
"0xb12bfca5a55806aaf64e99521918a4bf0fc40802",
63+
"0xb12bfca5a55806aaf64e99521918a4bf0fc40802"
6464
);
6565

6666
export class config implements Configurations {
@@ -126,7 +126,7 @@ export class config implements Configurations {
126126

127127
getOracleOverride(
128128
tokenAddr: Address | null,
129-
block: ethereum.Block | null,
129+
block: ethereum.Block | null
130130
): OracleConfig | null {
131131
return null;
132132
}

0 commit comments

Comments
 (0)