Skip to content

Commit

Permalink
refactor: use named function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 5, 2024
1 parent 2527c83 commit e19029c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions subgraphs/isolated-pools/src/operations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ export const createMarketPositionBadDebt = (
marketPositionBadDebt.save();
};

export const createRewardDistributor = (
export function createRewardDistributor(
rewardsDistributorAddress: Address,
comptrollerAddress: Address,
): RewardsDistributor => {
): RewardsDistributor {
const rewardDistributorContract = RewardDistributorContract.bind(rewardsDistributorAddress);
const rewardToken = rewardDistributorContract.rewardToken();
const id = getRewardsDistributorId(rewardsDistributorAddress);
Expand All @@ -330,4 +330,4 @@ export const createRewardDistributor = (
}
}
return rewardsDistributor;
};
}
6 changes: 3 additions & 3 deletions subgraphs/isolated-pools/src/operations/getOrCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ export const getOrCreateMarketPosition = (
return { entity: marketPosition, created };
};

export const getOrCreateRewardSpeed = (
export function getOrCreateRewardSpeed(
rewardsDistributorAddress: Address,
marketAddress: Address,
): RewardSpeed => {
): RewardSpeed {
const id = getRewardSpeedId(rewardsDistributorAddress, marketAddress);
let rewardSpeed = RewardSpeed.load(id);
if (!rewardSpeed) {
Expand All @@ -119,7 +119,7 @@ export const getOrCreateRewardSpeed = (
rewardSpeed.save();
}
return rewardSpeed as RewardSpeed;
};
}

export const getOrCreateRewardDistributor = (
rewardsDistributorAddress: Address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import exponentToBigInt from './exponentToBigInt';
import valueOrNotAvailableIntIfReverted from './valueOrNotAvailableIntIfReverted';

// Used for all vBEP20 contracts
const getTokenPriceInCents = (
function getTokenPriceInCents(
poolAddress: Address,
tokenAddress: Address,
underlyingDecimals: i32,
): BigInt => {
): BigInt {
const pool = getPool(poolAddress);
// will return NOT_AVAILABLE if the price cannot be fetched
let underlyingPrice = NOT_AVAILABLE_BIG_INT;
Expand All @@ -31,6 +31,6 @@ const getTokenPriceInCents = (
underlyingPrice;
}
return underlyingPrice;
};
}

export default getTokenPriceInCents;

0 comments on commit e19029c

Please sign in to comment.