Skip to content

Commit

Permalink
Merge pull request #1698 from IntersectMBO/develop
Browse files Browse the repository at this point in the history
GovTool v1.0.13 candidate v2
  • Loading branch information
MSzalowski authored Aug 8, 2024
2 parents e750390 + 6d18f40 commit 080cee6
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
SENTRY_IGNORE_API_RESOLUTION_ERROR: "1"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
PDF_API_URL: ${{ secrets.PDF_API_URL}}
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
SENTRY_IGNORE_API_RESOLUTION_ERROR: "1"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
PDF_API_URL: ${{ secrets.PDF_API_URL}}
steps:
- name: Checkout code
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ changes.
### Fixed

- Incorrect copy on DRep votes + other minor copy spelling mistakes
- Remove incorrect @value property to fix validating the metadata body [Issue 1687](https://github.com/IntersectMBO/govtool/issues/1687)
- Fix PDF not enabled in default deployments
- Fix displaying incorrect connected to Voltaire GovTool network

### Changed

Expand Down
12 changes: 6 additions & 6 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* @Ryun1 @MSzalowski

# Frontend assets templates
govtool/frontend/* @MSzalowski @Sworzen1 @JanJaroszczak
*.tsx @MSzalowski @Sworzen1 @JanJaroszczak
*.ts @MSzalowski @Sworzen1 @JanJaroszczak
*.css @MSzalowski @Sworzen1 @JanJaroszczak
govtool/frontend/* @MSzalowski @jdyczka
*.tsx @MSzalowski @jdyczka
*.ts @MSzalowski @jdyczka
*.css @MSzalowski @jdyczka

# Backend
govtool/backend/* @MSzalowski @jankun4
Expand All @@ -18,5 +18,5 @@ config/govtool/* @pla
infra/terraform/* @placek @adgud

# Testing
tests/* @IntersectMBO/govtool-test
gov-action-loader/* @IntersectMBO/govtool-test
tests/* @spannercode @mesudip @kneerose
gov-action-loader/* @spannercode @mesudip @kneerose
Empty file.
1 change: 0 additions & 1 deletion govtool/frontend/src/consts/CIP100Context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const CIP_100_CONTEXT = {
"@language": "en-us",
CIP100:
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
hashAlgorithm: "CIP100:hashAlgorithm",
Expand Down
1 change: 0 additions & 1 deletion govtool/frontend/src/consts/dRepActions/jsonContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const CIP_QQQ =
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-QQQ/README.md#";

export const DREP_CONTEXT = {
"@language": "en-us",
CIP100:
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
CIPQQQ: CIP_QQQ,
Expand Down
1 change: 0 additions & 1 deletion govtool/frontend/src/consts/governanceAction/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export const GOVERNANCE_ACTION_FIELDS: GovernanceActionFields = {
} as const;

export const GOVERNANCE_ACTION_CONTEXT = {
"@language": "en-us",
CIP100:
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
CIP108:
Expand Down
26 changes: 7 additions & 19 deletions govtool/frontend/src/context/governanceAction.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,17 @@ import {
} from "./governanceAction";

const resultMetadataBody = {
abstract: {
"@value": "Test",
},
motivation: {
"@value": "Test",
},
rationale: {
"@value": "Test",
},
abstract: "Test",
motivation: "Test",
rationale: "Test",
references: [
{
"@type": "Other",
label: {
"@value": "Test",
},
uri: {
"@value": "http://example.com",
},
label: "Test",
uri: "http://example.com",
},
],
title: {
"@value": "Test",
},
title: "Test",
};

describe("GovernanceActionProvider", () => {
Expand Down Expand Up @@ -92,7 +80,7 @@ describe("GovernanceActionProvider", () => {
const hash = await createHash(jsonld!);
expect(hash).toBeDefined();
expect(hash).toBe(
"b84e9890a34d6e59a983cf8f695214162893de5fc5310b12b75f4fe3dab0d7ab",
"bbdbbe163d1b8e4d6c10180df515cc7d58109412d90a42e898fc66850b3fc98c",
);
};
test();
Expand Down
12 changes: 4 additions & 8 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { Link } from "@mui/material";
import * as Sentry from "@sentry/react";
import { Trans } from "react-i18next";

import { PATHS, NETWORK_NAMES } from "@consts";
import { PATHS } from "@consts";
import { CardanoApiWallet, Protocol, VoterInfo } from "@models";
import type { StatusModalState } from "@organisms";
import {
Expand All @@ -64,11 +64,11 @@ import {
WALLET_LS_KEY,
} from "@utils";
import { getEpochParams } from "@services";
import { useGetNetworkMetrics, useTranslation } from "@hooks";
import { useTranslation } from "@hooks";
import { AutomatedVotingOptionDelegationId } from "@/types/automatedVotingOptions";

import { getUtxos } from "./getUtxos";
import { useModal, useSnackbar } from ".";
import { useAppContext, useModal, useSnackbar } from ".";
import {
PendingTransaction,
TransactionStateWithResource,
Expand Down Expand Up @@ -941,11 +941,7 @@ const CardanoProvider = (props: Props) => {
};

function useCardano() {
const { networkMetrics } = useGetNetworkMetrics();
const networkName =
NETWORK_NAMES[
(networkMetrics?.networkName as keyof typeof NETWORK_NAMES) || "preview"
];
const { networkName } = useAppContext();

const context = useContext(CardanoContext);
const { openModal, closeModal } = useModal<StatusModalState>();
Expand Down
1 change: 0 additions & 1 deletion govtool/frontend/src/utils/tests/canonizeJSON.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { canonizeJSON } from "..";

const exampleJson = {
"@context": {
"@language": "en-us",
CIP100:
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
CIP108:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { cipStandardSchema } from './cipStandardSchema';

const validCIP108Data = {
'@context': {
'@language': 'en',
CIP100:
'https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#',
CIP108:
Expand Down Expand Up @@ -38,7 +37,6 @@ const validCIP108Data = {

const validCIPQQQData = {
'@context': {
'@language': 'en',
CIP100:
'https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#',
CIPQQQ:
Expand Down
44 changes: 13 additions & 31 deletions govtool/metadata-validation/src/schemas/cipStandardSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,25 @@ export const cipStandardSchema: StandardSpecification = {
// Source of CIP-108: https://github.com/Ryun1/CIPs/blob/governance-metadata-actions/CIP-0108/README.md
[MetadataStandard.CIP108]: Joi.object({
'@context': Joi.object({
'@language': Joi.string().required(),
CIP100: Joi.string().valid(CIP100_URL).required(),
CIP108: Joi.string().valid(CIP108_URL).required(),
hashAlgorithm: Joi.string().valid('CIP100:hashAlgorithm').required(),
body: Joi.object(),
authors: Joi.object(),
}),
authors: Joi.array(),
hashAlgorithm: Joi.object({
'@value': Joi.string().valid('blake2b-256').required(),
}),
hashAlgorithm: Joi.string().valid('blake2b-256').required(),
body: Joi.object({
title: Joi.object({
'@value': Joi.string().max(80).required(),
}).required(),
abstract: Joi.object({
'@value': Joi.string().max(2500).required(),
}).required(),
motivation: Joi.object({ '@value': Joi.string().required() }).required(),
rationale: Joi.object({ '@value': Joi.string().required() }).required(),
title: Joi.string().max(80).required(),
abstract: Joi.string().max(2500).required(),
motivation: Joi.string().required(),
rationale: Joi.string().required(),
references: Joi.array()
.items(
Joi.object({
'@type': Joi.string().required(),
label: Joi.object({
'@value': Joi.string().required(),
}).required(),
uri: Joi.object({
'@value': Joi.string().required(),
}).required(),
label: Joi.string().required(),
uri: Joi.string().required(),
referenceHash: Joi.object({
hashDigest: Joi.string().required(),
hashAlgorithm: Joi.string().required(),
Expand All @@ -58,31 +47,24 @@ export const cipStandardSchema: StandardSpecification = {
}),
[MetadataStandard.CIPQQQ]: Joi.object({
'@context': Joi.object({
'@language': Joi.string().required(),
CIP100: Joi.string().valid(CIP100_URL).required(),
CIPQQQ: Joi.string().valid(CIPQQQ_URL).required(),
hashAlgorithm: Joi.string().valid('CIP100:hashAlgorithm').required(),
body: Joi.object(),
authors: Joi.object(),
}),
authors: Joi.array(),
hashAlgorithm: Joi.object({
'@value': Joi.string().valid('blake2b-256').required(),
}),
hashAlgorithm: Joi.string().valid('blake2b-256').required(),
body: Joi.object({
bio: Joi.object({ '@value': Joi.string().allow('') }).required(),
dRepName: Joi.object({ '@value': Joi.string().allow('') }).required(),
email: Joi.object({ '@value': Joi.string().allow('') }).required(),
bio: Joi.string().allow(''),
dRepName: Joi.string().allow(''),
email: Joi.string().allow('').required(),
references: Joi.array()
.items(
Joi.object({
'@type': Joi.string(),
label: Joi.object({
'@value': Joi.string().allow('').required(),
}).required(),
uri: Joi.object({
'@value': Joi.string().required(),
}).required(),
label: Joi.string().allow('').required(),
uri: Joi.string().required(),
referenceHash: Joi.object({
hashDigest: Joi.string().required(),
hashAlgorithm: Joi.string().required(),
Expand Down

0 comments on commit 080cee6

Please sign in to comment.