Skip to content

Commit

Permalink
Remove unused assets state references
Browse files Browse the repository at this point in the history
These were overlooked during the process of segregating prices from the assets slice
  • Loading branch information
hyphenized committed Jul 27, 2023
1 parent 8678d0e commit 234d1c3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions background/redux-slices/earn-utils/getPoolAPR.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BigNumber } from "ethers"
import { AnyAsset } from "../../assets"
import { HexString } from "../../types"
import { AssetsState } from "../assets"
import { getContract, getCurrentTimestamp } from "../utils/contract-utils"
import VAULT_ABI from "../../lib/vault"
import { DOGGO } from "../../constants"
Expand Down Expand Up @@ -66,7 +65,6 @@ const getPoolAPR = async ({
decimals: number
contractAddress: HexString
}
assets: AssetsState
prices: PricesState
vaultAddress: HexString
}): Promise<{
Expand Down
5 changes: 1 addition & 4 deletions background/redux-slices/earn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
getProvider,
getSignerAddress,
} from "./utils/contract-utils"
import { AssetsState } from "./assets"
import { enrichAssetAmountWithMainCurrencyValues } from "./utils/asset-utils"
import { ETHEREUM } from "../constants"
import { EVMNetwork } from "../networks"
Expand Down Expand Up @@ -415,9 +414,8 @@ export const updateVaults = createBackgroundAsyncThunk(
"earn/updateLockedValues",
async (vaultsToUpdate: AvailableVault[], { getState, dispatch }) => {
const currentState = getState()
const { assets, prices } = currentState as {
const { prices } = currentState as {
earn: EarnState
assets: AssetsState
prices: PricesState
}
const provider = getProvider()
Expand Down Expand Up @@ -445,7 +443,6 @@ export const updateVaults = createBackgroundAsyncThunk(

const vaultAPR = await getPoolAPR({
asset: vault.asset,
assets,
prices,
vaultAddress: vault.vaultAddress,
})
Expand Down
5 changes: 1 addition & 4 deletions background/tests/earn/earn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { BigNumber } from "ethers"
import * as getTokenPrice from "../../redux-slices/earn-utils/getTokenPrice"
import { getDoggoPrice, getPoolAPR } from "../../redux-slices/earn-utils"
import { assets, prices } from "./assets.mock"
import { prices } from "./assets.mock"
import * as contractUtils from "../../redux-slices/utils/contract-utils"

const mainCurrencySymbol = "USD"
Expand Down Expand Up @@ -87,7 +87,6 @@ describe("Earn", () => {

const APR = await getPoolAPR({
asset,
assets,
prices,
vaultAddress: "0x0",
})
Expand All @@ -114,7 +113,6 @@ describe("Earn", () => {

const APR = await getPoolAPR({
asset,
assets,
prices,
vaultAddress: "0x0",
})
Expand Down Expand Up @@ -146,7 +144,6 @@ describe("Earn", () => {

const APR = await getPoolAPR({
asset,
assets,
prices,
vaultAddress: "0x0",
})
Expand Down
3 changes: 2 additions & 1 deletion ui/hooks/nft-hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
getPricesState,
selectFilteredTotalFloorPrice,
selectMainCurrencySymbol,
} from "@tallyho/tally-background/redux-slices/selectors"
Expand Down Expand Up @@ -30,7 +31,7 @@ export const useTotalNFTsFloorPrice = (): {
} => {
const mainCurrencySymbol = useBackgroundSelector(selectMainCurrencySymbol)
const totalFloorPrice = useBackgroundSelector(selectFilteredTotalFloorPrice)
const allPrices = useBackgroundSelector((state) => state.prices)
const allPrices = useBackgroundSelector(getPricesState)

const ETHPricePoint = selectAssetPricePoint(
allPrices,
Expand Down

0 comments on commit 234d1c3

Please sign in to comment.