Skip to content

Commit

Permalink
Merge pull request #424 from 1Hive/fix-pool-form-conviction-growth-no…
Browse files Browse the repository at this point in the history
…t-converted

Bug: fix pool form conviction growth not converted to days
  • Loading branch information
Corantin authored Sep 21, 2024
2 parents 55d3e76 + b2eed02 commit aae6deb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions apps/web/components/Forms/PoolEditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { FormRadioButton } from "./FormRadioButton";
import { FormSelect } from "./FormSelect";
import { Button } from "../Button";
import { EthAddress } from "../EthAddress";
import { InfoBox } from "../InfoBox";
import { chainConfigMap } from "@/configs/chains";
import { usePubSubContext } from "@/contexts/pubsub.context";
import { useChainFromPath } from "@/hooks/useChainFromPath";
Expand Down Expand Up @@ -55,7 +54,6 @@ export default function PoolEditForm({
chainId,
initValues,
proposalType,
proposalOnDispute: isProposalOnDispute,
setModalOpen,
}: Props) {
const {
Expand All @@ -66,7 +64,7 @@ export default function PoolEditForm({
defaultValues: {
spendingLimit: initValues.spendingLimit,
minimumConviction: initValues.minimumConviction,
convictionGrowth: initValues.convictionGrowth,
convictionGrowth: Math.round(+initValues.convictionGrowth / 3600 / 24), // convert seconds to days
minThresholdPoints: initValues.minThresholdPoints,
// arb settings
defaultResolution: initValues.defaultResolution,
Expand Down
6 changes: 3 additions & 3 deletions apps/web/components/PoolHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function PoolHeader({
spendingLimitPct * MAX_RATIO_CONSTANT,
);

const convictionGrowth = calculateConvictionGrowthInSeconds(
const convictionGrowthSec = calculateConvictionGrowthInSeconds(
strategy.config.decay,
blockTime,
);
Expand All @@ -133,7 +133,7 @@ export default function PoolHeader({
(proposal) => ProposalStatus[proposal.proposalStatus] === "disputed",
);

const { value, unit } = convertSecondsToReadableTime(convictionGrowth);
const { value, unit } = convertSecondsToReadableTime(convictionGrowthSec);

const poolConfig = [
{
Expand Down Expand Up @@ -297,7 +297,7 @@ export default function PoolHeader({
proposalOnDispute={proposalOnDispute}
initValues={{
minimumConviction: minimumConviction.toFixed(2),
convictionGrowth: convictionGrowth.toFixed(2),
convictionGrowth: convictionGrowthSec.toFixed(2),
minThresholdPoints: minThresholdPoints,
spendingLimit: spendingLimit.toFixed(2),
defaultResolution: defaultResolution,
Expand Down

0 comments on commit aae6deb

Please sign in to comment.