Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only retrun active members on Multisig query #340

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/client-common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
}];
}
5 changes: 5 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.25.0",
"version": "1.25.1",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client.esm.js",
Expand Down
5 changes: 2 additions & 3 deletions modules/client/src/multisig/internal/client/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
ProposalCreationStepValue,
ProposalQueryParams,
ProposalSortBy,
SubgraphMembers,
} from "../../../client-common";
import { Multisig__factory } from "@aragon/osx-ethers";
import {
Expand Down Expand Up @@ -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<T>({
query,
params,
name,
});
return multisigApprovers.map((member) => member.address);
return multisigApprovers.filter((member: any) => member.isActive).map((member: any) => member.address);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ query MultisigMembers($where: MultisigApprover_filter!, $block: Block_height, $l
orderDirection: $direction
) {
address
isActive
}
}
`;
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-sepolia/api";
"https://subgraph.satsuma-prod.com/0141525010d2/aragon/osx-sepolia/api";

export const web3endpoints = {
working: [
Expand Down
4 changes: 2 additions & 2 deletions modules/client/test/integration/core-modules/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}],
};

Expand Down Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion modules/client/test/integration/core-modules/ipfs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ describe("Client Multisig", () => {

mockedClient.request.mockResolvedValueOnce({
multisigApprovers: members.map((member) => {
return { address: member };
return { address: member, isActive: true };
}),
});

Expand Down
Loading