From a7769f4f8a7ab17c432888f7db8a6c2cee2b8937 Mon Sep 17 00:00:00 2001 From: Spacebean Date: Thu, 26 Sep 2024 05:42:36 -0600 Subject: [PATCH] feat: cleanup + remove logs --- .../Actions/Convert/PipelineConvertForm.tsx | 62 ------------------- .../components/Silo/Actions/Convert/index.tsx | 8 --- 2 files changed, 70 deletions(-) diff --git a/projects/ui/src/components/Silo/Actions/Convert/PipelineConvertForm.tsx b/projects/ui/src/components/Silo/Actions/Convert/PipelineConvertForm.tsx index 9973fca3b..2a9a49559 100644 --- a/projects/ui/src/components/Silo/Actions/Convert/PipelineConvertForm.tsx +++ b/projects/ui/src/components/Silo/Actions/Convert/PipelineConvertForm.tsx @@ -495,65 +495,3 @@ export const PipelineConvertForm = ({ values, sdk, ...restProps }: Props) => { /> ); }; - -// useEffect(() => { -// if (!convertResults || !targetStemTip?.gt(0)) { -// // setConvertDetails(null); -// return; -// } - -// console.log('convertResults: ', { -// convertResults, -// targetStemTip: targetStemTip.toString(), -// }); - -// const toBDV = sdk.tokens.BEAN.fromBlockchain(convertResults.toBdv); -// const baseStalkAfter = targetToken.getStalk(toBDV); - -// const deltaStem = targetStemTip.sub(convertResults.toStem); -// const grownStalkAfter = STALK.fromBlockchain( -// deltaStem.mul(convertResults.toBdv) -// ); -// const grownStalkBefore = pickedDeposits.crates.reduce( -// (prev, curr) => prev.add(curr.stalk.grown), -// STALK.fromHuman('0') -// ); -// const totalStalkAfter = baseStalkAfter.add(grownStalkAfter); -// const deltaBaseStalk = baseStalkAfter.sub(pickedDeposits.stalk); -// const deltaGrownStalk = grownStalkAfter.sub(grownStalkBefore); -// /* -// (stem tip of out - toStem) * toBDV -// */ - -// const deltaStalk = deltaBaseStalk.add(deltaGrownStalk); - -// const currOwnershipPct = farmerSilo.stalk.active.div(silo.stalk.active); - -// const afterSeeds = targetToken.getSeeds(toBDV); -// const beforeSeeds = pickedDeposits.seeds; -// const deltaSeed = afterSeeds.sub(beforeSeeds); - -// const afterOwnership = totalStalkAfter -// .div(STALK.fromHuman(silo.stalk.active.toString())) -// .toHuman(); - -// const deltaOwnership = currOwnershipPct.minus(afterOwnership); - -// // setConvertDetails({ -// // deltaSeed, -// // deltaStalk, -// // deltaOwnership: deltaOwnership, -// // deltaStalkPerSeason: TokenValue.ZERO, -// // }); -// }, [ -// sdk, -// convertResults, -// getBDV, -// pickedDeposits, -// sourceToken, -// targetToken, -// STALK, -// silo, -// targetStemTip, -// farmerSilo.stalk.active, -// ]); diff --git a/projects/ui/src/components/Silo/Actions/Convert/index.tsx b/projects/ui/src/components/Silo/Actions/Convert/index.tsx index 880eadd48..dc75e7a4d 100644 --- a/projects/ui/src/components/Silo/Actions/Convert/index.tsx +++ b/projects/ui/src/components/Silo/Actions/Convert/index.tsx @@ -178,11 +178,8 @@ const ConvertFormsWrapper = ({ fromToken }: ConvertProps) => { const pipelineConvertSubmitHandler = usePipelineConvertSubmitHandler({ sdk, - fromToken, - farmerSilo, middleware, initialValues, - season, }); const submitHandler: ConvertFormSubmitHandler = useCallback( @@ -242,17 +239,12 @@ export default Convert; function usePipelineConvertSubmitHandler({ sdk, - farmerSilo, middleware, - fromToken, initialValues, }: { sdk: BeanstalkSDK; - fromToken: ERC20Token; - farmerSilo: FarmerSilo; middleware: ReturnType; initialValues: ConvertFormValues; - season: BigNumber; }) { const account = useAccount(); const [refetchFarmerSilo] = useFetchFarmerSilo();