Skip to content

Commit

Permalink
fix: payloads format data
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Dec 26, 2023
1 parent cab5617 commit cde45c4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/proposals/utils/formatPayloadData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,16 @@ export function formatPayloadData({
withoutProposalData?: boolean;
}) {
const now = dayjs().unix();
const isProposalNotExecuted = withoutProposalData
? true
: !isProposalExecuted;

const isPayloadOnInitialState =
payload.queuedAt <= 0 &&
isProposalNotExecuted &&
(withoutProposalData ? true : !isProposalExecuted) &&
payload.cancelledAt <= 0 &&
payload.state !== PayloadState.Expired;

const isPayloadTimeLocked =
payload.queuedAt <= 0 &&
isProposalNotExecuted &&
(withoutProposalData ? true : isProposalExecuted) &&
payload.cancelledAt <= 0 &&
payload.state !== PayloadState.Expired;

Expand All @@ -46,7 +43,7 @@ export function formatPayloadData({
: payload.queuedAt + payload.delay;

const isPayloadReadyForExecution =
!isProposalNotExecuted &&
(withoutProposalData ? true : isProposalExecuted) &&
payload.queuedAt > 0 &&
now > payload.queuedAt + payload.delay &&
payload.cancelledAt <= 0 &&
Expand Down

1 comment on commit cde45c4

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.