From e201774e56642c2b6fc60477c08679777655400d Mon Sep 17 00:00:00 2001 From: Rekard0 <5880388+Rekard0@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:38:45 +0200 Subject: [PATCH] fix: only retrun active members on Multisig query (#340) * fix: only retrun active members on Multisig query * fix: update query * fix: replace remove subgraph api endpoint * feat: update changelog and package.json --- modules/client-common/src/utils.ts | 2 +- modules/client/CHANGELOG.md | 5 +++++ modules/client/package.json | 2 +- modules/client/src/multisig/internal/client/methods.ts | 5 ++--- .../client/src/multisig/internal/graphql-queries/members.ts | 1 + modules/client/test/integration/constants.ts | 2 +- modules/client/test/integration/core-modules/graphql.test.ts | 4 ++-- modules/client/test/integration/core-modules/ipfs.test.ts | 2 +- .../client/test/integration/multisig-client/methods.test.ts | 2 +- 9 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/client-common/src/utils.ts b/modules/client-common/src/utils.ts index bd5f0e31b..81c1b296e 100644 --- a/modules/client-common/src/utils.ts +++ b/modules/client-common/src/utils.ts @@ -517,6 +517,6 @@ export function getDefaultIpfsNodes(network: SupportedNetworks) { export function getDefaultGraphqlNodes(network: SupportedNetworks) { return [{ url: - `https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-${network}/version/v1.4.0/api`, + `https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-${network}/version/v1.4.0/api`, }]; } diff --git a/modules/client/CHANGELOG.md b/modules/client/CHANGELOG.md index 20feba622..46919a16f 100644 --- a/modules/client/CHANGELOG.md +++ b/modules/client/CHANGELOG.md @@ -19,6 +19,11 @@ TEMPLATE: ## [UPCOMING] +## [1.25.1] + +### Fixed +- Return only the active multisig members. + ## [1.25.0] - Add support for zkSync mainnet network diff --git a/modules/client/package.json b/modules/client/package.json index ade04a3a6..81576c5d7 100644 --- a/modules/client/package.json +++ b/modules/client/package.json @@ -1,7 +1,7 @@ { "name": "@aragon/sdk-client", "author": "Aragon Association", - "version": "1.25.0", + "version": "1.25.1", "license": "MIT", "main": "dist/index.js", "module": "dist/sdk-client.esm.js", diff --git a/modules/client/src/multisig/internal/client/methods.ts b/modules/client/src/multisig/internal/client/methods.ts index db0235ac5..f5d4857d5 100644 --- a/modules/client/src/multisig/internal/client/methods.ts +++ b/modules/client/src/multisig/internal/client/methods.ts @@ -25,7 +25,6 @@ import { ProposalCreationStepValue, ProposalQueryParams, ProposalSortBy, - SubgraphMembers, } from "../../../client-common"; import { Multisig__factory } from "@aragon/osx-ethers"; import { @@ -415,13 +414,13 @@ export class MultisigClientMethods extends ClientCore sortBy, }; const name = "Multisig members"; - type T = { multisigApprovers: SubgraphMembers }; + type T = { multisigApprovers: any }; const { multisigApprovers } = await this.graphql.request({ query, params, name, }); - return multisigApprovers.map((member) => member.address); + return multisigApprovers.filter((member: any) => member.isActive).map((member: any) => member.address); } /** diff --git a/modules/client/src/multisig/internal/graphql-queries/members.ts b/modules/client/src/multisig/internal/graphql-queries/members.ts index 8203358a5..e0be5c923 100644 --- a/modules/client/src/multisig/internal/graphql-queries/members.ts +++ b/modules/client/src/multisig/internal/graphql-queries/members.ts @@ -11,6 +11,7 @@ query MultisigMembers($where: MultisigApprover_filter!, $block: Block_height, $l orderDirection: $direction ) { address + isActive } } `; diff --git a/modules/client/test/integration/constants.ts b/modules/client/test/integration/constants.ts index 0e615628e..5059da82d 100644 --- a/modules/client/test/integration/constants.ts +++ b/modules/client/test/integration/constants.ts @@ -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-sepolia/api"; + "https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-sepolia/api"; export const web3endpoints = { working: [ diff --git a/modules/client/test/integration/core-modules/graphql.test.ts b/modules/client/test/integration/core-modules/graphql.test.ts index 1722ae2eb..ce085b389 100644 --- a/modules/client/test/integration/core-modules/graphql.test.ts +++ b/modules/client/test/integration/core-modules/graphql.test.ts @@ -34,7 +34,7 @@ const contextParamsMainnet: ContextParams = { ], graphqlNodes: [{ url: - "https://api.thegraph.com/subgraphs/name/aragon/aragon-zaragoza-goerli", + "https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-sepolia/version/1.4.3/api", }], }; @@ -66,7 +66,7 @@ describe("GraphQL core module", () => { { url: "https://the.wrong/url" }, { url: - "https://api.thegraph.com/subgraphs/name/aragon/aragon-zaragoza-goerli", + "https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-sepolia/version/1.4.3/api", }, { url: "https://the.wrong/url" }, { url: "https://the.wrong/url" }, diff --git a/modules/client/test/integration/core-modules/ipfs.test.ts b/modules/client/test/integration/core-modules/ipfs.test.ts index 072debd6d..fbbc166c4 100644 --- a/modules/client/test/integration/core-modules/ipfs.test.ts +++ b/modules/client/test/integration/core-modules/ipfs.test.ts @@ -36,7 +36,7 @@ const contextParamsMainnet: ContextParams = { ], graphqlNodes: [{ url: - "https://api.thegraph.com/subgraphs/name/aragon/aragon-zaragoza-goerli", + "https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-sepolia/version/1.4.3/api", }], }; diff --git a/modules/client/test/integration/multisig-client/methods.test.ts b/modules/client/test/integration/multisig-client/methods.test.ts index 730c56836..49d01c91b 100644 --- a/modules/client/test/integration/multisig-client/methods.test.ts +++ b/modules/client/test/integration/multisig-client/methods.test.ts @@ -558,7 +558,7 @@ describe("Client Multisig", () => { mockedClient.request.mockResolvedValueOnce({ multisigApprovers: members.map((member) => { - return { address: member }; + return { address: member, isActive: true }; }), });