Skip to content

Commit

Permalink
fix: APP-3038 - update return type of proposal approver, grab address…
Browse files Browse the repository at this point in the history
… directly (#331)

* fix: update return type of proposal approver, grab address directly

* fix: failing tests

* fix: invalid satsuma endpoint

* fix: change subgraph to live

* fix: error in mock testing

---------

Co-authored-by: Jose Manuel Mariñas Bascoy <[email protected]>
  • Loading branch information
thekidnamedkd and josemarinas authored Apr 9, 2024
1 parent e132db3 commit 225e74b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ TEMPLATE:
-->

## [UPCOMING]
## [1.23.1]

### Fixed
- Reorder id creation to match subgraph

## [1.23.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion 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.0",
"version": "1.23.1",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/multisig/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type SubgraphMultisigProposalBase = SubgraphProposalBase & {
plugin: SubgraphMultisigVotingSettings;
minApprovals: number;
approvalReached: boolean;
approvers: { id: string }[];
approvers: { id: string, approver: { address: string} }[];
// TODO change on subgraph fix
// approvers: SubgraphMultisigApproversListItem[];
};
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/multisig/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function toMultisigProposal(
),
status: computeProposalStatus(proposal),
approvals: proposal.approvers.map(
(approver) => approver.id.slice(0, 42),
(a) => a.approver.address,
),
};
}
Expand All @@ -93,7 +93,7 @@ export function toMultisigProposalListItem(
summary: metadata.summary,
},
approvals: proposal.approvers.map(
(approver) => approver.id.slice(0, 42),
(a) => a.approver.address,
),
actions: proposal.actions.map(
(action: SubgraphAction): DaoAction => {
Expand Down
2 changes: 1 addition & 1 deletion modules/client/test/integration/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ContextParams } from "@aragon/sdk-client-common";

const IPFS_API_KEY = process?.env?.IPFS_API_KEY || "";
const SATSUMA_ENDPOINT =
"https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-goerli/version/v1.3.0/api";
"https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-goerli/api";

export const web3endpoints = {
working: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ describe("Client Multisig", () => {
executionDate: Math.round(Date.now() / 1000).toString(),
executionBlockNumber: "50",
executionTxHash: TEST_TX_HASH,
approvers: [{ id: ADDRESS_ONE }, { id: ADDRESS_TWO }],
approvers: [{ id: `${ADDRESS_ONE}_${ADDRESS_ONE}`, approver{address: ADDRESS_ONE} }, { id: `${ADDRESS_TWO}_${ADDRESS_ONE}`, approver{address: ADDRESS_TWO}}],
minApprovals: 5,
plugin: {
onlyListed: true,
Expand Down Expand Up @@ -675,7 +675,7 @@ describe("Client Multisig", () => {
parseInt(subgraphProposal.executionBlockNumber),
);
expect(proposal.approvals).toMatchObject(
subgraphProposal.approvers.map((approver) => approver.id),
subgraphProposal.approvers.map((approver) => approver.approver.address),
);
expect(proposal.settings.minApprovals).toBe(
subgraphProposal.plugin.minApprovals,
Expand Down Expand Up @@ -737,7 +737,7 @@ describe("Client Multisig", () => {
mockedClient.request.mockResolvedValueOnce({
multisigProposals: [{
...SUBGRAPH_PROPOSAL_BASE,
approvers: [{ id: ADDRESS_ONE }, { id: ADDRESS_TWO }],
approvers: [{ id: `${ADDRESS_ONE}_${ADDRESS_ONE}`, approver: { address: ADDRESS_ONE } }, { id: `${ADDRESS_TWO}_${ADDRESS_ONE}`, approver: { address: ADDRESS_TWO } }],
plugin: {
onlyListed: true,
},
Expand Down

0 comments on commit 225e74b

Please sign in to comment.