Skip to content

Commit

Permalink
Rename selectMappedOperatorsAndAdditionalData
Browse files Browse the repository at this point in the history
Additional Data doesn't really say anything about what's that data and what it
contains so I've decided to remove that subpart from the selector's name.

`selectMappedOperatorsAndAdditionalData` -> `selectMappedOperators`
  • Loading branch information
michalsmiarowski committed Oct 21, 2022
1 parent d063aeb commit 0f73828
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
isSameETHAddress,
AddressZero,
} from "../../../web3/utils"
import { selectMappedOperatorsAndAdditionalData } from "../../../store/account/selectors"
import { selectMappedOperators } from "../../../store/account/selectors"
import { useAppSelector } from "../../../hooks/store"

export interface MapOperatorToStakingProviderModalProps {
Expand All @@ -52,7 +52,7 @@ const MapOperatorToStakingProviderModal: FC<
mappedOperatorRandomBeacon,
isOperatorMappedOnlyInRandomBeacon,
isOperatorMappedOnlyInTbtc,
} = useAppSelector(selectMappedOperatorsAndAdditionalData)
} = useAppSelector(selectMappedOperators)

const onSubmit = async ({
operator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useWeb3React } from "@web3-react/core"
import { OperatorMappedSuccessTx } from "../../components/Modal/MapOperatorToStakingProviderSuccessModal"
import { mapOperatorToStakingProviderModalClosed } from "../../store/modal"
import { useAppDispatch, useAppSelector } from "../store"
import { selectMappedOperatorsAndAdditionalData } from "../../store/account"
import { selectMappedOperators } from "../../store/account"

export const useRegisterMultipleOperatorsTransaction = () => {
const {
Expand All @@ -16,7 +16,7 @@ export const useRegisterMultipleOperatorsTransaction = () => {
isOperatorMappedInBothApps,
isOperatorMappedOnlyInRandomBeacon,
isOperatorMappedOnlyInTbtc,
} = useAppSelector((state) => selectMappedOperatorsAndAdditionalData(state))
} = useAppSelector((state) => selectMappedOperators(state))
const { account } = useWeb3React()
const { openModal, closeModal } = useModal()
const dispatch = useAppDispatch()
Expand Down
6 changes: 2 additions & 4 deletions src/pages/Staking/OperatorAddressMappingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import { FC } from "react"
import { ModalType } from "../../enums"
import { useAppSelector } from "../../hooks/store"
import { useModal } from "../../hooks/useModal"
import { selectMappedOperatorsAndAdditionalData } from "../../store/account/selectors"
import { selectMappedOperators } from "../../store/account/selectors"

const OperatorAddressMappingCard: FC = () => {
const { openModal } = useModal()

const { isOneOfTheAppsNotMapped } = useAppSelector(
selectMappedOperatorsAndAdditionalData
)
const { isOneOfTheAppsNotMapped } = useAppSelector(selectMappedOperators)

const onStartMappingClick = () => {
openModal(ModalType.MapOperatorToStakingProvider)
Expand Down
2 changes: 1 addition & 1 deletion src/store/account/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccountState } from "./slice"

export const selectAccountState = (state: RootState) => state.account

export const selectMappedOperatorsAndAdditionalData = createSelector(
export const selectMappedOperators = createSelector(
[selectAccountState],
(accountState: AccountState) => {
const { randomBeacon, tbtc } = accountState.operatorMapping.data
Expand Down

0 comments on commit 0f73828

Please sign in to comment.