Skip to content

Commit

Permalink
fixed proposal ID error
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed May 11, 2024
1 parent 64d69cd commit 1a75ac2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/data/formulas/contract/neutron/cwdSubdaoTimelockSingle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const config: ContractFormula = {

export const proposal: ContractFormula<any, { id: string }> = {
compute: async ({ contractAddress, get, args: { id } }) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -51,7 +51,7 @@ export const listProposals: ContractFormula<

export const proposalExecutionError: ContractFormula<any, { id: string }> = {
compute: async ({ contractAddress, get, args: { id } }) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const proposalCreatedAt: ContractFormula<
getDateKeyFirstSet,
args: { id },
}) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -70,7 +70,7 @@ export const proposalCompletedAt: ContractFormula<
getDateKeyFirstSet,
args: { id },
}) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -98,7 +98,7 @@ export const proposal: ContractFormula<Proposal | undefined, { id: string }> = {
args: { id },
} = env

if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -319,7 +319,7 @@ export const completedProposalIdForCreatedProposalId: ContractFormula<
get,
args: { id },
}) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const preProposeApprovalIdForApproverProposalId: ContractFormula<
{ id: string }
> = {
compute: async ({ contractAddress, get, args: { id } }) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand All @@ -25,7 +25,7 @@ export const approverProposalIdForPreProposeApprovalId: ContractFormula<
{ id: string }
> = {
compute: async ({ contractAddress, get, args: { id } }) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const proposal: ContractFormula<
args: { id },
} = env

if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -321,7 +321,7 @@ export const proposalCreatedAt: ContractFormula<
getDateKeyFirstSet,
args: { id },
}) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const proposal: ContractFormula<
args: { id },
} = env

if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down Expand Up @@ -373,7 +373,7 @@ export const proposalCreatedAt: ContractFormula<
getDateKeyFirstSet,
args: { id },
}) => {
if (!id) {
if (!id || isNaN(Number(id)) || Number(id) < 0) {
throw new Error('missing `id`')
}

Expand Down

0 comments on commit 1a75ac2

Please sign in to comment.