Skip to content

Commit

Permalink
feat: cleanup + remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Sep 26, 2024
1 parent a99aa84 commit a7769f4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// ]);
8 changes: 0 additions & 8 deletions projects/ui/src/components/Silo/Actions/Convert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,8 @@ const ConvertFormsWrapper = ({ fromToken }: ConvertProps) => {

const pipelineConvertSubmitHandler = usePipelineConvertSubmitHandler({
sdk,
fromToken,
farmerSilo,
middleware,
initialValues,
season,
});

const submitHandler: ConvertFormSubmitHandler = useCallback(
Expand Down Expand Up @@ -242,17 +239,12 @@ export default Convert;

function usePipelineConvertSubmitHandler({
sdk,
farmerSilo,
middleware,
fromToken,
initialValues,
}: {
sdk: BeanstalkSDK;
fromToken: ERC20Token;
farmerSilo: FarmerSilo;
middleware: ReturnType<typeof useFormMiddleware>;
initialValues: ConvertFormValues;
season: BigNumber;
}) {
const account = useAccount();
const [refetchFarmerSilo] = useFetchFarmerSilo();
Expand Down

0 comments on commit a7769f4

Please sign in to comment.