Skip to content

Commit

Permalink
chore: add metadataHash to response (#334)
Browse files Browse the repository at this point in the history
* chore: add metadataHash to response

* chore: add metadataHash to response
  • Loading branch information
josemarinas authored May 9, 2024
1 parent d73b903 commit afcf672
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions modules/client-common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ TEMPLATE:

## [UPCOMING]

- Added `metadataHash` field to proposal and dao objects.

## [1.15.0]
- Added `metadataHash` field to proposal and dao objects.

### Added

- `getDefaultIpfsNodes` function to get the default IPFS nodes for a network
Expand Down
2 changes: 1 addition & 1 deletion modules/client-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/sdk-client-common",
"author": "Aragon Association",
"version": "1.15.1",
"version": "1.15.2",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client-common.esm.js",
Expand Down
2 changes: 2 additions & 0 deletions modules/client-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export type ProposalBase = {
};
creatorAddress: string;
metadata: ProposalMetadata;
metadataHash: string;
startDate: Date;
endDate: Date;
creationDate: Date;
Expand All @@ -219,6 +220,7 @@ export type ProposalListItemBase = {
};
creatorAddress: string;
metadata: ProposalMetadataSummary;
metadataHash: string;
startDate: Date;
endDate: Date;
status: ProposalStatus;
Expand Down
3 changes: 3 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ TEMPLATE:
-->

## [UPCOMING]

- Added `metadataHash` field to proposal and dao objects.

## [1.23.2]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/sdk-client",
"author": "Aragon Association",
"version": "1.23.3",
"version": "1.23.4",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client.esm.js",
Expand Down Expand Up @@ -69,7 +69,7 @@
"dependencies": {
"@aragon/osx-commons-configs": "^0.4.0",
"@aragon/osx-ethers": "1.3.0",
"@aragon/sdk-client-common": "^1.15.1",
"@aragon/sdk-client-common": "^1.15.2",
"@aragon/sdk-ipfs": "^1.1.0",
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/bignumber": "^5.6.0",
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/addresslistVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function toAddresslistVotingProposal(
resources: metadata.resources,
media: metadata.media,
},
metadataHash: proposal.metadata,
startDate,
endDate,
creationDate,
Expand Down Expand Up @@ -118,6 +119,7 @@ export function toAddresslistVotingProposalListItem(
title: metadata.title,
summary: metadata.summary,
},
metadataHash: proposal.metadata,
startDate,
endDate,
status: computeProposalStatus(proposal),
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export function toDaoDetails(
avatar: metadata.avatar || undefined,
links: metadata.links,
},
metadataHash: dao.metadata,
creationDate: new Date(parseInt(dao.createdAt) * 1000),
// TODO update when new subgraph schema is deployed
// filter out plugins that are not applied
Expand Down Expand Up @@ -176,6 +177,7 @@ export function toDaoListItem(
description: metadata.description,
avatar: metadata.avatar || undefined,
},
metadataHash: dao.metadata,
plugins: dao.plugins.filter(
(plugin) =>
plugin.appliedPreparation && plugin.appliedVersion &&
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/multisig/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function toMultisigProposal(
resources: metadata.resources,
media: metadata.media,
},
metadataHash: proposal.metadata,
settings: {
onlyListed: proposal.plugin.onlyListed,
minApprovals: proposal.minApprovals,
Expand Down Expand Up @@ -92,6 +93,7 @@ export function toMultisigProposalListItem(
title: metadata.title,
summary: metadata.summary,
},
metadataHash: proposal.metadata,
approvals: proposal.approvals.map(
(a) => a.approver.address,
),
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/tokenVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function toTokenVotingProposal(
resources: metadata.resources,
media: metadata.media,
},
metadataHash: proposal.metadata,
startDate,
endDate,
creationDate,
Expand Down Expand Up @@ -156,6 +157,7 @@ export function toTokenVotingProposalListItem(
title: metadata.title,
summary: metadata.summary,
},
metadataHash: proposal.metadata,
totalVotingWeight: BigInt(proposal.totalVotingPower),
startDate,
endDate,
Expand Down
2 changes: 2 additions & 0 deletions modules/client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type DaoDetails = {
address: string;
ensDomain: string;
metadata: DaoMetadata;
metadataHash: string;
creationDate: Date;
plugins: InstalledPluginListItem[];
};
Expand All @@ -48,6 +49,7 @@ export type DaoListItem = {
description: string;
avatar?: string;
};
metadataHash: string;
plugins: InstalledPluginListItem[];
};

Expand Down

0 comments on commit afcf672

Please sign in to comment.