Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan DesRosier committed Feb 17, 2022
1 parent 5b75598 commit 6efd57f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
26 changes: 14 additions & 12 deletions src/calculate/calculateNormalizedUserBalancesFromTotalSupply.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { BigNumber } from "@ethersproject/bignumber"
import { NormalizedUserBalance, UserBalance } from "../types"
import { BigNumber } from '@ethersproject/bignumber';

import { NormalizedUserBalance, UserBalance } from '../types';

function calculateNormalizedUserBalancesFromTotalSupply(
userBalances: UserBalance[],
totalSupply: BigNumber,
): NormalizedUserBalance[] {
totalSupply: BigNumber
): NormalizedUserBalance[] {
return userBalances.map(userBalance => {
return {
address: userBalance.address,
normalizedBalance: userBalance.balance.mul('1000000000000000000').div(totalSupply),
}
})
}

return {
address: userBalance.address,
normalizedBalance: userBalance.balance
.mul('1000000000000000000')
.div(totalSupply),
};
});
}

export default calculateNormalizedUserBalancesFromTotalSupply;
export default calculateNormalizedUserBalancesFromTotalSupply;
1 change: 1 addition & 0 deletions src/compute/computeWinningPicks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BigNumber } from 'ethers';

import { Draw, DrawResults, PrizeDistribution } from '../types';
import computeUserWinningPicksForRandomNumber from './computeUserWinningPicksForRandomNumber';

Expand Down
8 changes: 4 additions & 4 deletions src/utils/filterUndefinedValues.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function filterUndefinedValues<T>(ts: (T | undefined)[]): T[] {
return ts.filter((t: T | undefined): t is T => Boolean(t))
}
export default filterUndefinedValues;
return ts.filter((t: T | undefined): t is T => Boolean(t));
}

export default filterUndefinedValues;
1 change: 1 addition & 0 deletions src/winningPicks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BigNumber } from 'ethers';

import computeWinningPicks from './compute/computeWinningPicks';
import encodeWinningPicks from './encodeWinningPicks';
import { Claim, Draw, PrizeDistribution } from './types';
Expand Down
2 changes: 1 addition & 1 deletion test/winningPicks.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defaultAbiCoder } from '@ethersproject/abi';
import { BigNumber } from '@ethersproject/bignumber';
import { parseEther } from '@ethersproject/units';
import { Draw, PrizeDistribution } from '../src';

import { Draw, PrizeDistribution } from '../src';
import { formatTierPercentage } from '../src/utils';
import winningPicks from '../src/winningPicks';

Expand Down

0 comments on commit 6efd57f

Please sign in to comment.