Skip to content

Commit

Permalink
Use stricter date-string validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed Mar 16, 2024
1 parent 0eee775 commit 434622f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions CGPs/cgp-0045.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
cgp: 45
title: cREAL Activation
date-created: 13-10-2021
date-created: 2021-10-13
author: '@luisgj (Bitso), @martinvol (cLabs)'
status: EXECUTED
governance-proposal-id: 50
Expand All @@ -13,15 +13,15 @@ discussions-to: https://forum.celo.org/t/cbrl-stable-asset/1281

CGP 45 - cREAL Activation

This proposal is the third and final governance proposal needed launch cREAL. It was preceeded by [CGP-42](https://github.com/celo-org/governance/blob/main/CGPs/cgp-0042.md) and [CGP-46](https://github.com/celo-org/governance/blob/main/CGPs/cgp-0046.md).
This proposal is the third and final governance proposal needed launch cREAL. It was preceded by [CGP-42](https://github.com/celo-org/governance/blob/main/CGPs/cgp-0042.md) and [CGP-46](https://github.com/celo-org/governance/blob/main/CGPs/cgp-0046.md).


### Status

This proposal should not be executed until at least one oracle report for cREAL has been submitted on-chain. At this point, cREAL should already be deployed and initialized, but frozen and un-usable.


Please note `cREAL` was formelly called `cBRL`.
Please note `cREAL` was formerly called `cBRL`.

## Proposed Changes

Expand Down
2 changes: 1 addition & 1 deletion CGPs/cgp-0057.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author: 'Martin Volpe (@martinvol, volpe@clabs.co)'
status: EXECUTED
discussions-to: https://forum.celo.org/t/decentralized-oracles/3610
governance-proposal-id: 69
date-executed: 2022-9-11
date-executed: 2022-09-11
---
## Overview

Expand Down
2 changes: 1 addition & 1 deletion CGPs/cgp-0073.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
cgp: 73
title: Establish and Fund Bug Bounty Program on Immunefi
date-created: 2023-3-5
date-created: 2023-03-05
author: '@vissequ, @keccakdog'
status: DRAFT
discussions-to: https://forum.celo.org/t/proposal-establish-and-fund-a-bug-bounty-program-for-celo-on-immunefi/5060
Expand Down
2 changes: 1 addition & 1 deletion CGPs/cgp-0119.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author: 'Upright Ventures (@upright)'
status: DRAFT
discussions-to: https://forum.celo.org/t/celo-camp-2024-grant-the-minipay-launchpad-and-startup-pathway-program-final/7210/1
governance-proposal-id: 119
date-executed: TBA
date-executed:
---

## Overview
Expand Down
4 changes: 2 additions & 2 deletions CGPs/cgp-0123.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
cgp: 123
title: MU05 - Add native USDC pools to Mento v2
date-created: 2024-03-007
date-created: 2024-03-07
author: "Nelson Taveras <nelson.taveras@mentolabs.xyz>, Philip Rätsch <philip.raetsch@mentolabs.xyz>"
status: DRAFT
discussions-to: https://forum.celo.org/t/proposal-mento-upgrade-mu05-native-usdc-integration/7545
governance-proposal-id: 163
date-executed: "TBA"
date-executed:
---

## Overview
Expand Down
8 changes: 5 additions & 3 deletions scripts/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ const ProposalMetadataStatus = {
/**
* The schema as used in the CGP front matter
*/
const DateString = z.string().regex(/^\d{4}-\d{2}-\d{2}$/)

export const ProposalMetadataSchema = z.object({
cgp: z.number().min(1),
title: z.string().min(1),
author: z.string().min(1),
status: z.nativeEnum(ProposalMetadataStatus),
"date-created": z.string().optional().or(z.null()),
"date-created": DateString.optional().or(z.null()),
"discussions-to": z.string().url().optional().or(z.null()),
"governance-proposal-id": z.number().optional().or(z.null()),
"date-executed": z.string().optional().or(z.null()),
"governance-proposal-id": z.number().min(1).optional().or(z.null()),
"date-executed": DateString.optional().or(z.null()),
});

function validateFrontMatter(data, filename) {
Expand Down

0 comments on commit 434622f

Please sign in to comment.