Skip to content

Commit

Permalink
fix(demo-react): eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-khramov committed Sep 21, 2023
1 parent f4f2025 commit a80719e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/demo-react/components/contractTesting/Stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const StakeForm = ({
void providerWeb3
?.getBalance(account || '')
.then((data) => setWalletBalance(formatBalance(data, 5)), console.log);
}, [account]);
}, [account, providerWeb3]);

return (
<BlueWrapper>
Expand Down
3 changes: 0 additions & 3 deletions apps/demo-react/components/contractTesting/Wrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import {
InputGroup,
} from '@lidofinance/lido-ui';
import { SWRResponse } from '@lido-sdk/react';
import { parseEther } from 'ethers/lib/utils.js';

import { WstethAbi } from '@lido-sdk/contracts';
import { BigNumber } from 'ethers';
import { Web3Provider } from '@ethersproject/providers';
import { formatBalance, getTxUrl } from '../../util/contractTestingUtils';
import { BlueWrapper } from '../info';
import { STETH_SUBMIT_GAS_LIMIT_DEFAULT } from '../../hooks/useStethSubmitGasLimit';
import { useWstethBySteth } from '../../hooks/useWstethBySteth';
import { InputDecoratorMaxButton } from '../input-decorator-max-button';
import {
unwrapProcessing,
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react/components/contractTesting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import {
useWSTETHContractWeb3,
} from '@lido-sdk/react';
import { useWeb3 } from 'reef-knot/web3-react';
import { parseEther } from '@ethersproject/units';
import StakeForm from './Stake';
import WrapForm from './Wrap';
import WithdrawalsForm from './Withdrawals';
import { useStethSubmitGasLimit } from '../../hooks/useStethSubmitGasLimit';
import { useTxCostInUsd } from '../../hooks/txCost';
import { useWrapGasLimit } from '../../hooks/useWrapGasLimit';
import { useWstethBySteth } from '../../hooks/useWstethBySteth';
import { parseEther } from '@ethersproject/units';

const ContractTesting = () => {
const stethContractRpc = useSTETHContractRPC();
Expand Down
13 changes: 8 additions & 5 deletions apps/demo-react/hooks/useClaimSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ export const useClaimSelection = (

const claimableIdToIndex = useMemo(() => {
return (
claimableRequests?.reduce((mapParam, cur, i) => {
const map = mapParam;
map[cur.stringId] = i;
return map;
}, {} as { [key: string]: number }) ?? {}
claimableRequests?.reduce(
(mapParam, cur, i) => {
const map = mapParam;
map[cur.stringId] = i;
return map;
},
{} as { [key: string]: number },
) ?? {}
);
}, [claimableRequests]);

Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react/hooks/useSplitRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ export const useSplitRequest = (inputValue: string, selectedToken: TOKENS) => {
requestCount: requestCount + (hasRest ? 1 : 0),
areRequestsValid: requests.length > 0,
};
}, [inputValue, maxAmount, maxRequestCount, selectedToken]);
}, [inputValue, maxAmount, maxRequestCount]);
};
1 change: 0 additions & 1 deletion apps/demo-react/hooks/useWithdrawalRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const useWithdrawalRequest = ({
gatherPermitSignature,
getRequestMethod,
isApprovalFlow,
isBunker,
needsApprove,
setIsTxPending,
token,
Expand Down
13 changes: 6 additions & 7 deletions apps/demo-react/hooks/useWithdrawalsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const useWithdrawalRequestMethods = () => {
await transaction?.wait();
updateData();
},
[account, chainId, contractWeb3, updateData],
[contractWeb3, updateData],
);

const permitWsteth = useCallback(
Expand Down Expand Up @@ -194,7 +194,7 @@ export const useWithdrawalRequestMethods = () => {
await transaction?.wait();
updateData();
},
[account, chainId, contractWeb3, updateData],
[contractWeb3, updateData],
);

const steth = useCallback(
Expand Down Expand Up @@ -227,7 +227,7 @@ export const useWithdrawalRequestMethods = () => {
}
updateData();
},
[account, chainId, contractWeb3, providerWeb3, updateData],
[account, contractWeb3, updateData],
);

const wstETH = useCallback(
Expand Down Expand Up @@ -258,7 +258,7 @@ export const useWithdrawalRequestMethods = () => {
}
updateData();
},
[account, chainId, contractWeb3, providerWeb3, updateData],
[account, contractWeb3, updateData],
);

return useCallback(
Expand Down Expand Up @@ -287,9 +287,8 @@ export const useWithdrawalRequests = () => {
contractWeb3.getWithdrawalRequests(acc),
contractWeb3.getLastCheckpointIndex(),
]);
const requestStatuses = await contractWeb3?.getWithdrawalStatus(
requestIds,
);
const requestStatuses =
await contractWeb3?.getWithdrawalStatus(requestIds);

const claimableRequests: RequestStatus[] = [];
const pendingRequests: RequestStatusPending[] = [];
Expand Down
6 changes: 4 additions & 2 deletions apps/demo-react/hooks/useWstethBySteth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import debounce from 'lodash/debounce';
export const useWstethBySteth = (
stEth: BigNumber | undefined,
): BigNumber | undefined => {
const [wstethBalance, setWstethBalance] = useState<BigNumber>(BigNumber.from(0));
const [wstethBalance, setWstethBalance] = useState<BigNumber>(
BigNumber.from(0),
);

const wstethContractRPC = useWSTETHContractRPC();

Expand All @@ -21,7 +23,7 @@ export const useWstethBySteth = (
setWstethBalance(wsteth);
}
}, 500),
[wstethContractRPC],
[wstethBalance, wstethContractRPC],
);

useEffect(() => {
Expand Down

0 comments on commit a80719e

Please sign in to comment.