Skip to content

Commit 97b4925

Browse files
authored
Merge pull request #3599 from IntersectMBO/test
fix(#3591): remove canonicalization from the governance action metadata
2 parents 8f01b4e + d296ac4 commit 97b4925

File tree

20 files changed

+152
-61
lines changed

20 files changed

+152
-61
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ changes.
1818

1919
### Removed
2020

21+
- Remove additional canonicalization of the metadata [Issue 3591](https://github.com/IntersectMBO/govtool/issues/3591)
22+
2123
## [v2.0.20](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.20) 2025-04-16
2224

2325
### Added

β€Žgov-action-loader/README.mdβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Governance Action Loader
2+
3+
This directory contains the platform for submitting governance action data transactions on-chain, supporting both individual and bulk submission methods.
4+
5+
## πŸ“ Navigation
6+
7+
- [Frontend](./frontend/)
8+
- [Backend](./backend/)
9+
10+
## Frontend
11+
The Governance Action Loader frontend is a web application that communicates with the backend via a REST interface to facilitate the submission of on-chain governance data transactions.
12+
13+
## Backend
14+
The Governance Action Loader backend uses a predefined wallet to execute transactions for on-chain governance data.

β€Žgovtool/frontend/package-lock.jsonβ€Ž

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žgovtool/frontend/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hookform/resolvers": "^3.3.1",
3030
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.4.1",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "0.7.0-beta-25",
32+
"@intersect.mbo/pdf-ui": "0.7.0-beta-26",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@rollup/plugin-babel": "^6.0.4",

β€Žgovtool/frontend/yarn.lockβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,10 +1512,10 @@
15121512
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
15131513
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==
15141514

1515-
"@intersect.mbo/[email protected]25":
1516-
version "0.7.0-beta-25"
1517-
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.7.0-beta-25.tgz"
1518-
integrity sha512-TDeWjJVMvLOR6sgTT6bCoHspZbybiRH0C5OzDDaU1yLSFD7xKx1aW5eAVdG0uzxrO+C0X7ceBGFoN5ucHICdlg==
1515+
"@intersect.mbo/[email protected]26":
1516+
version "0.7.0-beta-26"
1517+
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.7.0-beta-26.tgz"
1518+
integrity sha512-05HR82ZKpJzitH7MgdNEdGr/Rc9A8PNPfPF5bX/z4We2y+iSi5kEoZdflpaUUWG3fFDwiaQCKe2xMiNwbGMOIQ==
15191519
dependencies:
15201520
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
15211521
"@fontsource/poppins" "^5.0.14"

β€Žgovtool/metadata-validation/Dockerfileβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ WORKDIR /dist
77

88
COPY package*.json ./
99

10-
RUN yarn
10+
RUN npm install
1111

1212
COPY . /dist
1313

14-
RUN yarn build
14+
RUN npm run build
1515

1616
ENV IPFS_GATEWAY=$IPFS_GATEWAY
1717
ENV IPFS_PROJECT_ID=$IPFS_PROJECT_ID
1818

19-
ENTRYPOINT ["/bin/sh", "-c", "yarn start:prod"]
19+
ENTRYPOINT ["/bin/sh", "-c", "npm run start:prod"]

β€Žgovtool/metadata-validation/src/app.service.tsβ€Ž

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Injectable, Logger } from '@nestjs/common';
22
import { catchError, finalize, firstValueFrom } from 'rxjs';
33
import { HttpService } from '@nestjs/axios';
44
import * as blake from 'blakejs';
5-
import * as jsonld from 'jsonld';
65

76
import { ValidateMetadataDTO } from '@dto';
87
import { LoggerMessage, MetadataValidationStatus } from '@enums';
@@ -81,29 +80,7 @@ export class AppService {
8180
const hashedMetadata = blake.blake2bHex(rawData, undefined, 32);
8281

8382
if (hashedMetadata !== hash) {
84-
// Optionally validate on a parsed metadata
85-
const hashedParsedMetadata = blake.blake2bHex(
86-
JSON.stringify(parsedData, null, 2),
87-
undefined,
88-
32,
89-
);
90-
if (hashedParsedMetadata !== hash) {
91-
// Optional support for the canonized data hash
92-
// Validate canonized data hash
93-
const canonizedMetadata = await jsonld.canonize(JSON.parse(rawData), {
94-
safe: false,
95-
});
96-
97-
const hashedCanonizedMetadata = blake.blake2bHex(
98-
canonizedMetadata,
99-
undefined,
100-
32,
101-
);
102-
103-
if (hashedCanonizedMetadata !== hash) {
104-
throw MetadataValidationStatus.INVALID_HASH;
105-
}
106-
}
83+
throw MetadataValidationStatus.INVALID_HASH;
10784
}
10885
} catch (error) {
10986
Logger.error(LoggerMessage.METADATA_VALIDATION_ERROR, error);

β€Žtests/govtool-frontend/playwright/.env.exampleβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
HOST_URL=http://localhost:3000
22

3-
DOCS_URL=https://docs.gov.tools
3+
DOCS_URL=https://docs.gov.tools/cardano-govtool
44

55
#Blockfrost
66
BLOCKFROST_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXX
@@ -12,7 +12,9 @@ KUBER_API_KEY=
1212
TX_TIMEOUT=240000 # milliseconds
1313

1414
# Metadata Bucket
15-
METADATA_BUCKET_URL=https://metadata-govtool.cardanoapi.io
15+
CARDANOAPI_METADATA_URL=https://metadata-govtool.cardanoapi.io
16+
17+
NETWORK=preview
1618

1719
FAUCET_ADDRESS=
1820
FAUCET_PAYMENT_PRIVATE=

β€Žtests/govtool-frontend/playwright/README.mdβ€Ž

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ npx playwright install
5151

5252
### HOST URL
5353

54-
| Environment | URL |
55-
| :---------- | :----------------------------------------------------------------------------------------------------------------------- |
56-
| Development | [https://p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr](https://p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr) |
57-
| QA | [https://govtool.cardanoapi.io](https://govtool.cardanoapi.io) |
58-
| Preview | [https://preview.gov.tools](https://preview.gov.tools) |
59-
| Pre-Prod | [https://pre-prod.gov.tools](https://pre-prod.gov.tools) |
60-
| Mainnet | [https://gov.tools](https://gov.tools) |
54+
| Environment | URL | Network |
55+
| :---------- | :----------------------------------------------------------------------------------------------------------------------- | :------ |
56+
| Development | [https://p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr](https://p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr) | Preview |
57+
| QA | [https://govtool.cardanoapi.io](https://govtool.cardanoapi.io) | Preview |
58+
| Preview | [https://preview.gov.tools](https://preview.gov.tools) | Preview |
59+
| Pre-Prod | [https://pre-prod.gov.tools](https://pre-prod.gov.tools) | Preprod |
60+
| Mainnet | [https://gov.tools](https://gov.tools) | Mainnet |
6161

6262
---
6363

@@ -66,16 +66,21 @@ npx playwright install
6666
### Blockfrost API Key
6767

6868
- To generate a Blockfrost API key (Project ID):
69-
1. Follow the instructions in the [Blockfrost documentation](https://blockfrost.dev/overview/getting-started).
69+
70+
1. Follow the instructions in the [Blockfrost documentation](https://blockfrost.dev/overview/getting-started) πŸ“š.
7071
2. The **Project ID** you create there serves as your **Blockfrost API Key**.
72+
3. Copy the **Project ID** and set it as `BLOCKFROST_API_KEY`.
73+
74+
πŸ” Note: Ensure you select the correct network for the **Project ID** that matches the host URL from the environment listed above.
7175

7276
### Kuber API Key
7377

7478
- To generate a Kuber API Key:
75-
1. Visit [Kuberide](https://kuberide.com/).
79+
1. Visit [Kuberide](https://kuberide.com/) 🌐.
7680
2. Log in using your Google or GitHub account.
77-
3. Navigate to **API Keys**.
78-
4. Click to **Generate API Key**.
81+
3. Navigate to **API Keys** βš™οΈ.
82+
4. Click to **Generate API Key** ✨.
83+
5. Copy the API key and set it as `KUBER_API_KEY`
7984

8085
---
8186

@@ -127,15 +132,26 @@ FAUCET_ADDRESS=<your-wallet-address>
127132

128133
### Step 3: Fund the Wallet
129134

130-
Ensure the wallet address has sufficient funds for your test runs. The required balance depends on the specific tests you plan to execute (refer to the test-specific test run details below).
135+
Ensure your wallet has enough funds for your test runs. The required balance depends on the specific tests you plan to execute (see test-specific details below).
136+
137+
To fund your wallet on the **Preview** or **Preprod** network:
138+
139+
1. Use the Cardano Testnet Faucet:
140+
[https://docs.cardano.org/cardano-testnets/tools/faucet](https://docs.cardano.org/cardano-testnets/tools/faucet) 🌐
141+
**Note**: There is a daily limit of **10,000 ADA** per wallet.
142+
143+
2. If the funded amount is insufficient, transfer additional ADA from another wallet. πŸ’Έ
144+
145+
To check your wallet balance:
131146

132-
To check the wallet balance, visit:
147+
Visit:
133148

134149
```
135150
https://${network}.cardanoscan.io/address/<your-wallet-address>
136151
```
137152

138-
Replace `${network}` with the appropriate Cardano network (e.g.`preprod`, or `preview`) and `<your-wallet-address>` with the generated address.
153+
- Replace `${network}` with the appropriate network (e.g., `preprod` or `preview`).
154+
- Replace `<your-wallet-address>` with your wallet address. πŸ”
139155

140156
**Example**:
141157

β€Žtests/govtool-frontend/playwright/generate_faucet_wallet.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ShelleyWallet } from "./lib/helpers/crypto";
1010
console.log("\nπŸŽ‰ Wallet generated successfully!");
1111
console.log("-----------------------------------");
1212
console.log("πŸ’Ό Wallet:", walletJson);
13-
console.log(`πŸ”‘ Payment Private Key: ${walletJson.payment.private}`);
13+
console.log(`\nπŸ”‘ Payment Private Key: ${walletJson.payment.private}`);
1414
console.log(`πŸ”— Stake Public Key Hash: ${walletJson.stake.pkh}`);
1515
console.log(`🏠 Wallet Address: ${walletJson.address}`);
1616
console.log("-----------------------------------");

0 commit comments

Comments
Β (0)