From 33c7123658522f902707c4ded4a3031cd27d968f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Manuel=20Mari=C3=B1as=20Bascoy?= Date: Wed, 17 Apr 2024 16:20:33 +0200 Subject: [PATCH 1/6] fix: multisig members not appearing in past proposals --- packages/subgraph/schema.graphql | 14 +++++++++++--- .../subgraph/src/packages/multisig/multisig.ts | 5 ++++- packages/subgraph/tests/multisig/multisig.test.ts | 11 +++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 5594dc5c9..1ae039a39 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -888,16 +888,24 @@ type MultisigPlugin implements IPlugin @entity { } type MultisigApprover @entity { + """ + Current Approver of the multisig + """ id: ID! # plugin_address + member_address address: String # address as string to facilitate filtering by address on the UI - proposals: [MultisigProposalApprover!]! @derivedFrom(field: "approver") plugin: MultisigPlugin! } type MultisigProposalApprover @entity(immutable: true) { - "ApproverProposal for Many-to-Many" + """ + An approver for a specific multisig proposal + Will typically also be the address of a MultisigApprover + But will also store historical approvers if the address + was later deleted. + """ id: ID! # approver + proposal - approver: MultisigApprover! + address: String! # address as string to facilitate filtering by address on the UI + plugin: MultisigPlugin! proposal: MultisigProposal! createdAt: BigInt! } diff --git a/packages/subgraph/src/packages/multisig/multisig.ts b/packages/subgraph/src/packages/multisig/multisig.ts index 04ca24484..d228ab7f5 100644 --- a/packages/subgraph/src/packages/multisig/multisig.ts +++ b/packages/subgraph/src/packages/multisig/multisig.ts @@ -17,6 +17,7 @@ import { import {generateMemberEntityId, generateVoterEntityId} from '../../utils/ids'; import { generateActionEntityId, + generateEntityIdFromAddress, generatePluginEntityId, generateProposalEntityId, } from '@aragon/osx-commons-subgraph'; @@ -102,6 +103,7 @@ export function _handleProposalCreated( export function handleApproved(event: Approved): void { let memberAddress = event.params.approver; let pluginAddress = event.address; + let pluginEntityId = generatePluginEntityId(pluginAddress); let memberEntityId = generateMemberEntityId(pluginAddress, memberAddress); let pluginProposalId = event.params.proposalId; let proposalEntityId = generateProposalEntityId( @@ -117,8 +119,9 @@ export function handleApproved(event: Approved): void { MultisigProposalApprover.load(approverProposalId); if (!approverProposalEntity) { approverProposalEntity = new MultisigProposalApprover(approverProposalId); - approverProposalEntity.approver = memberEntityId; approverProposalEntity.proposal = proposalEntityId; + approverProposalEntity.plugin = pluginEntityId; + approverProposalEntity.address = generateEntityIdFromAddress(memberAddress); } approverProposalEntity.createdAt = event.block.timestamp; approverProposalEntity.save(); diff --git a/packages/subgraph/tests/multisig/multisig.test.ts b/packages/subgraph/tests/multisig/multisig.test.ts index f60ff4bb7..4a584bfa2 100644 --- a/packages/subgraph/tests/multisig/multisig.test.ts +++ b/packages/subgraph/tests/multisig/multisig.test.ts @@ -229,8 +229,8 @@ test('Run Multisig (handleApproved) mappings with mock event', () => { assert.fieldEquals( 'MultisigProposalApprover', voterEntityId, - 'approver', - memberEntityId + 'address', + ADDRESS_ONE ); assert.fieldEquals( 'MultisigProposalApprover', @@ -245,6 +245,13 @@ test('Run Multisig (handleApproved) mappings with mock event', () => { event.block.timestamp.toString() ); + assert.fieldEquals( + 'MultisigProposalApprover', + voterEntityId, + 'plugin', + Address.fromString(CONTRACT_ADDRESS).toHexString() + ); + // check proposal assert.fieldEquals('MultisigProposal', proposal.id, 'approvals', ONE); assert.fieldEquals( From ad6f5ee326f02421ea68979fee24948bee1b3fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Manuel=20Mari=C3=B1as=20Bascoy?= Date: Mon, 22 Apr 2024 17:06:36 +0200 Subject: [PATCH 2/6] wip --- packages/subgraph/schema.graphql | 3 +++ packages/subgraph/src/packages/multisig/multisig.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 1ae039a39..0a07b0ab0 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -893,6 +893,7 @@ type MultisigApprover @entity { """ id: ID! # plugin_address + member_address address: String # address as string to facilitate filtering by address on the UI + proposals: [MultisigProposalApprover!]! @derivedFrom(field: "approver") plugin: MultisigPlugin! } @@ -907,6 +908,7 @@ type MultisigProposalApprover @entity(immutable: true) { address: String! # address as string to facilitate filtering by address on the UI plugin: MultisigPlugin! proposal: MultisigProposal! + approver: MultisigApprover! createdAt: BigInt! } @@ -934,4 +936,5 @@ type MultisigProposal implements IProposal @entity { executionBlockNumber: BigInt executionTxHash: Bytes approvers: [MultisigProposalApprover!]! @derivedFrom(field: "proposal") + } diff --git a/packages/subgraph/src/packages/multisig/multisig.ts b/packages/subgraph/src/packages/multisig/multisig.ts index d228ab7f5..ff989853a 100644 --- a/packages/subgraph/src/packages/multisig/multisig.ts +++ b/packages/subgraph/src/packages/multisig/multisig.ts @@ -119,6 +119,7 @@ export function handleApproved(event: Approved): void { MultisigProposalApprover.load(approverProposalId); if (!approverProposalEntity) { approverProposalEntity = new MultisigProposalApprover(approverProposalId); + approverProposalEntity.approver = memberEntityId; approverProposalEntity.proposal = proposalEntityId; approverProposalEntity.plugin = pluginEntityId; approverProposalEntity.address = generateEntityIdFromAddress(memberAddress); From 1fc632d8151190401b568bd5db91efa4b4908265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Manuel=20Mari=C3=B1as=20Bascoy?= Date: Wed, 24 Apr 2024 10:22:59 +0200 Subject: [PATCH 3/6] chore: update schema and methods --- packages/subgraph/schema.graphql | 16 ++-- .../src/packages/multisig/multisig.ts | 46 +++++----- .../subgraph/tests/multisig/multisig.test.ts | 84 +++++++++---------- 3 files changed, 71 insertions(+), 75 deletions(-) diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 0a07b0ab0..83dbf4319 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -892,12 +892,13 @@ type MultisigApprover @entity { Current Approver of the multisig """ id: ID! # plugin_address + member_address - address: String # address as string to facilitate filtering by address on the UI - proposals: [MultisigProposalApprover!]! @derivedFrom(field: "approver") + address: Bytes! + approvals: [MultisigProposalApproval!]! @derivedFrom(field: "approver") plugin: MultisigPlugin! + isActive: Boolean! } -type MultisigProposalApprover @entity(immutable: true) { +type MultisigProposalApproval @entity(immutable: true) { """ An approver for a specific multisig proposal Will typically also be the address of a MultisigApprover @@ -905,10 +906,8 @@ type MultisigProposalApprover @entity(immutable: true) { was later deleted. """ id: ID! # approver + proposal - address: String! # address as string to facilitate filtering by address on the UI - plugin: MultisigPlugin! - proposal: MultisigProposal! approver: MultisigApprover! + proposal: MultisigProposal! createdAt: BigInt! } @@ -928,13 +927,12 @@ type MultisigProposal implements IProposal @entity { creationBlockNumber: BigInt! snapshotBlock: BigInt! minApprovals: Int! - approvals: Int + approvalCount: Int approvalReached: Boolean! isSignaling: Boolean! executed: Boolean! executionDate: BigInt executionBlockNumber: BigInt executionTxHash: Bytes - approvers: [MultisigProposalApprover!]! @derivedFrom(field: "proposal") - + approvals: [MultisigProposalApproval!]! @derivedFrom(field: "proposal") } diff --git a/packages/subgraph/src/packages/multisig/multisig.ts b/packages/subgraph/src/packages/multisig/multisig.ts index ff989853a..8f3136251 100644 --- a/packages/subgraph/src/packages/multisig/multisig.ts +++ b/packages/subgraph/src/packages/multisig/multisig.ts @@ -3,7 +3,7 @@ import { MultisigPlugin, MultisigProposal, MultisigApprover, - MultisigProposalApprover, + MultisigProposalApproval, } from '../../../generated/schema'; import { ProposalCreated, @@ -61,7 +61,7 @@ export function _handleProposalCreated( if (!proposal.reverted) { proposalEntity.executed = proposal.value.value0; - proposalEntity.approvals = proposal.value.value1; + proposalEntity.approvalCount = proposal.value.value1; // ProposalParameters let parameters = proposal.value.value2; @@ -104,26 +104,22 @@ export function handleApproved(event: Approved): void { let memberAddress = event.params.approver; let pluginAddress = event.address; let pluginEntityId = generatePluginEntityId(pluginAddress); - let memberEntityId = generateMemberEntityId(pluginAddress, memberAddress); + let approverEntityId = generateMemberEntityId(pluginAddress, memberAddress); let pluginProposalId = event.params.proposalId; let proposalEntityId = generateProposalEntityId( event.address, pluginProposalId ); let approverProposalId = generateVoterEntityId( - memberEntityId, + approverEntityId, proposalEntityId ); - let approverProposalEntity = - MultisigProposalApprover.load(approverProposalId); - if (!approverProposalEntity) { - approverProposalEntity = new MultisigProposalApprover(approverProposalId); - approverProposalEntity.approver = memberEntityId; - approverProposalEntity.proposal = proposalEntityId; - approverProposalEntity.plugin = pluginEntityId; - approverProposalEntity.address = generateEntityIdFromAddress(memberAddress); - } + // No need for checking if approval exists + // a proposal cannot be approved twice by the same approver + let approverProposalEntity = new MultisigProposalApproval(approverProposalId); + approverProposalEntity.approver = approverEntityId; + approverProposalEntity.proposal = proposalEntityId; approverProposalEntity.createdAt = event.block.timestamp; approverProposalEntity.save(); @@ -135,7 +131,7 @@ export function handleApproved(event: Approved): void { if (!proposal.reverted) { let approvals = proposal.value.value1; - proposalEntity.approvals = approvals; + proposalEntity.approvalCount = approvals; // calculate if proposal is executable let minApprovalsStruct = proposal.value.value2; @@ -175,15 +171,17 @@ export function handleMembersAdded(event: MembersAdded): void { for (let index = 0; index < members.length; index++) { const memberAddress = members[index]; const pluginEntityId = generatePluginEntityId(event.address); - const memberEntityId = [pluginEntityId, memberAddress.toHexString()].join( - '_' + const approverEntityId = generateMemberEntityId( + event.address, + memberAddress ); - let approverEntity = MultisigApprover.load(memberEntityId); + let approverEntity = MultisigApprover.load(approverEntityId); if (!approverEntity) { - approverEntity = new MultisigApprover(memberEntityId); - approverEntity.address = memberAddress.toHexString(); + approverEntity = new MultisigApprover(approverEntityId); + approverEntity.address = memberAddress; approverEntity.plugin = pluginEntityId; + approverEntity.isActive = true; approverEntity.save(); } } @@ -194,13 +192,15 @@ export function handleMembersRemoved(event: MembersRemoved): void { for (let index = 0; index < members.length; index++) { const memberAddress = members[index]; const pluginEntityId = generatePluginEntityId(event.address); - const memberEntityId = [pluginEntityId, memberAddress.toHexString()].join( - '_' + const approverEntityId = generateMemberEntityId( + event.address, + memberAddress ); - const approverEntity = MultisigApprover.load(memberEntityId); + const approverEntity = MultisigApprover.load(approverEntityId); if (approverEntity) { - store.remove('MultisigApprover', memberEntityId); + approverEntity.isActive = false; + approverEntity.save(); } } } diff --git a/packages/subgraph/tests/multisig/multisig.test.ts b/packages/subgraph/tests/multisig/multisig.test.ts index 4a584bfa2..77f5d2b1a 100644 --- a/packages/subgraph/tests/multisig/multisig.test.ts +++ b/packages/subgraph/tests/multisig/multisig.test.ts @@ -1,4 +1,4 @@ -import {MultisigApprover} from '../../generated/schema'; +import {MultisigApprover, MultisigProposal} from '../../generated/schema'; import { handleMembersAdded, handleApproved, @@ -44,7 +44,7 @@ import { generateProposalEntityId, createDummyAction, } from '@aragon/osx-commons-subgraph'; -import {Address, BigInt} from '@graphprotocol/graph-ts'; +import {Address, BigInt, log} from '@graphprotocol/graph-ts'; import {assert, clearStore, test} from 'matchstick-as/assembly/index'; let actions = [createDummyAction(DAO_TOKEN_ADDRESS, '0', '0x00000000')]; @@ -156,7 +156,12 @@ test('Run Multisig (handleProposalCreated) mappings with mock event', () => { SNAPSHOT_BLOCK ); assert.fieldEquals('MultisigProposal', proposalEntityId, 'minApprovals', ONE); - assert.fieldEquals('MultisigProposal', proposalEntityId, 'approvals', ONE); + assert.fieldEquals( + 'MultisigProposal', + proposalEntityId, + 'approvalCount', + ONE + ); assert.fieldEquals('MultisigProposal', proposalEntityId, 'executed', 'false'); assert.fieldEquals( 'MultisigProposal', @@ -221,39 +226,32 @@ test('Run Multisig (handleApproved) mappings with mock event', () => { const voterEntityId = generateVoterEntityId(memberEntityId, proposal.id); // check proposalVoter assert.fieldEquals( - 'MultisigProposalApprover', + 'MultisigProposalApproval', voterEntityId, 'id', voterEntityId ); assert.fieldEquals( - 'MultisigProposalApprover', - voterEntityId, - 'address', - ADDRESS_ONE - ); - assert.fieldEquals( - 'MultisigProposalApprover', + 'MultisigProposalApproval', voterEntityId, - 'proposal', - proposal.id + 'createdAt', + event.block.timestamp.toString() ); assert.fieldEquals( - 'MultisigProposalApprover', + 'MultisigProposalApproval', voterEntityId, - 'createdAt', - event.block.timestamp.toString() + 'approver', + memberEntityId ); - assert.fieldEquals( - 'MultisigProposalApprover', + 'MultisigProposalApproval', voterEntityId, - 'plugin', - Address.fromString(CONTRACT_ADDRESS).toHexString() + 'proposal', + proposal.id ); // check proposal - assert.fieldEquals('MultisigProposal', proposal.id, 'approvals', ONE); + assert.fieldEquals('MultisigProposal', proposal.id, 'approvalCount', ONE); assert.fieldEquals( 'MultisigProposal', proposal.id, @@ -291,7 +289,7 @@ test('Run Multisig (handleApproved) mappings with mock event', () => { handleApproved(event2); // Check - assert.fieldEquals('MultisigProposal', proposal.id, 'approvals', TWO); + assert.fieldEquals('MultisigProposal', proposal.id, 'approvalCount', TWO); assert.fieldEquals( 'MultisigProposal', proposal.id, @@ -365,10 +363,10 @@ test('Run Multisig (handleMembersAdded) mappings with mock event', () => { handleMembersAdded(event); // checks - let memberId = - Address.fromString(CONTRACT_ADDRESS).toHexString() + - '_' + - userArray[0].toHexString(); + let memberId = generateMemberEntityId( + Address.fromString(CONTRACT_ADDRESS), + userArray[0] + ); assert.fieldEquals('MultisigApprover', memberId, 'id', memberId); assert.fieldEquals( @@ -383,6 +381,7 @@ test('Run Multisig (handleMembersAdded) mappings with mock event', () => { 'plugin', Address.fromString(CONTRACT_ADDRESS).toHexString() ); + assert.fieldEquals('MultisigApprover', memberId, 'isActive', 'true'); clearStore(); }); @@ -393,25 +392,23 @@ test('Run Multisig (handleMembersRemoved) mappings with mock event', () => { Address.fromString(ADDRESS_ONE), Address.fromString(ADDRESS_TWO), ]; - + let pluginAddress = Address.fromString(CONTRACT_ADDRESS); + // create approvers for (let index = 0; index < memberAddresses.length; index++) { - const user = memberAddresses[index].toHexString(); - const pluginId = Address.fromString(CONTRACT_ADDRESS).toHexString(); - let memberId = pluginId + '_' + user; - let userEntity = new MultisigApprover(memberId); - userEntity.plugin = Address.fromString(CONTRACT_ADDRESS).toHexString(); - userEntity.save(); + let memberId = generateMemberEntityId( + pluginAddress, + memberAddresses[index] + ); + let approverEntity = new MultisigApprover(memberId); + approverEntity.plugin = pluginAddress.toHexString(); + approverEntity.address = memberAddresses[index]; + approverEntity.isActive = true; + approverEntity.save(); } // checks - let memberId1 = - Address.fromString(CONTRACT_ADDRESS).toHexString() + - '_' + - memberAddresses[0].toHexString(); - let memberId2 = - Address.fromString(CONTRACT_ADDRESS).toHexString() + - '_' + - memberAddresses[1].toHexString(); + let memberId1 = generateMemberEntityId(pluginAddress, memberAddresses[0]); + let memberId2 = generateMemberEntityId(pluginAddress, memberAddresses[1]); assert.fieldEquals('MultisigApprover', memberId1, 'id', memberId1); assert.fieldEquals('MultisigApprover', memberId2, 'id', memberId2); @@ -427,8 +424,9 @@ test('Run Multisig (handleMembersRemoved) mappings with mock event', () => { // checks assert.fieldEquals('MultisigApprover', memberId1, 'id', memberId1); - assert.notInStore('MultisigApprover', memberId2); - + assert.fieldEquals('MultisigApprover', memberId1, 'isActive', 'true'); + assert.fieldEquals('MultisigApprover', memberId2, 'id', memberId2); + assert.fieldEquals('MultisigApprover', memberId2, 'isActive', 'false'); clearStore(); }); From c7702ecd8e987e6eafa8e8c43a821caf084e90d1 Mon Sep 17 00:00:00 2001 From: josemarinas <36479864+josemarinas@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:33:26 +0200 Subject: [PATCH 4/6] Update packages/subgraph/schema.graphql Co-authored-by: Jordan <45881807+jordaniza@users.noreply.github.com> --- packages/subgraph/schema.graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 83dbf4319..0f58243b6 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -900,7 +900,7 @@ type MultisigApprover @entity { type MultisigProposalApproval @entity(immutable: true) { """ - An approver for a specific multisig proposal + An approval for a specific multisig proposal Will typically also be the address of a MultisigApprover But will also store historical approvers if the address was later deleted. From 9f30f59573abf0493ff91bf64d1d93a8bfacc084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Manuel=20Mari=C3=B1as=20Bascoy?= Date: Wed, 24 Apr 2024 17:07:31 +0200 Subject: [PATCH 5/6] style: fix lint warnings --- .../subgraph/src/packages/multisig/multisig.ts | 5 +---- .../addresslist-voting/addresslist-voting.test.ts | 1 - packages/subgraph/tests/multisig/multisig.test.ts | 4 ++-- .../subgraph/tests/token/governance-erc20.test.ts | 15 +-------------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/packages/subgraph/src/packages/multisig/multisig.ts b/packages/subgraph/src/packages/multisig/multisig.ts index 8f3136251..877e5375d 100644 --- a/packages/subgraph/src/packages/multisig/multisig.ts +++ b/packages/subgraph/src/packages/multisig/multisig.ts @@ -17,11 +17,10 @@ import { import {generateMemberEntityId, generateVoterEntityId} from '../../utils/ids'; import { generateActionEntityId, - generateEntityIdFromAddress, generatePluginEntityId, generateProposalEntityId, } from '@aragon/osx-commons-subgraph'; -import {dataSource, store} from '@graphprotocol/graph-ts'; +import {dataSource} from '@graphprotocol/graph-ts'; export function handleProposalCreated(event: ProposalCreated): void { let context = dataSource.context(); @@ -103,7 +102,6 @@ export function _handleProposalCreated( export function handleApproved(event: Approved): void { let memberAddress = event.params.approver; let pluginAddress = event.address; - let pluginEntityId = generatePluginEntityId(pluginAddress); let approverEntityId = generateMemberEntityId(pluginAddress, memberAddress); let pluginProposalId = event.params.proposalId; let proposalEntityId = generateProposalEntityId( @@ -191,7 +189,6 @@ export function handleMembersRemoved(event: MembersRemoved): void { const members = event.params.members; for (let index = 0; index < members.length; index++) { const memberAddress = members[index]; - const pluginEntityId = generatePluginEntityId(event.address); const approverEntityId = generateMemberEntityId( event.address, memberAddress diff --git a/packages/subgraph/tests/addresslist-voting/addresslist-voting.test.ts b/packages/subgraph/tests/addresslist-voting/addresslist-voting.test.ts index 3f54a88c2..318440c30 100644 --- a/packages/subgraph/tests/addresslist-voting/addresslist-voting.test.ts +++ b/packages/subgraph/tests/addresslist-voting/addresslist-voting.test.ts @@ -595,7 +595,6 @@ test('Run AddresslistVoting (handleMembersAdded) mappings with mock event', () = 'id', memberEntityId ); - const voter = AddresslistVotingVoter.load(memberEntityId); assert.fieldEquals( 'AddresslistVotingVoter', memberEntityId, diff --git a/packages/subgraph/tests/multisig/multisig.test.ts b/packages/subgraph/tests/multisig/multisig.test.ts index 77f5d2b1a..33346b924 100644 --- a/packages/subgraph/tests/multisig/multisig.test.ts +++ b/packages/subgraph/tests/multisig/multisig.test.ts @@ -1,4 +1,4 @@ -import {MultisigApprover, MultisigProposal} from '../../generated/schema'; +import {MultisigApprover} from '../../generated/schema'; import { handleMembersAdded, handleApproved, @@ -44,7 +44,7 @@ import { generateProposalEntityId, createDummyAction, } from '@aragon/osx-commons-subgraph'; -import {Address, BigInt, log} from '@graphprotocol/graph-ts'; +import {Address, BigInt} from '@graphprotocol/graph-ts'; import {assert, clearStore, test} from 'matchstick-as/assembly/index'; let actions = [createDummyAction(DAO_TOKEN_ADDRESS, '0', '0x00000000')]; diff --git a/packages/subgraph/tests/token/governance-erc20.test.ts b/packages/subgraph/tests/token/governance-erc20.test.ts index 750273221..c76634fdb 100644 --- a/packages/subgraph/tests/token/governance-erc20.test.ts +++ b/packages/subgraph/tests/token/governance-erc20.test.ts @@ -17,7 +17,6 @@ import {getBalanceOf} from '../dao/utils'; import {ExtendedTokenVotingMember} from '../helpers/extended-schema'; import { createNewDelegateChangedEvent, - createNewERC20TransferEvent, createNewERC20TransferEventWithAddress, createTokenVotingMember, getDelegatee, @@ -27,7 +26,7 @@ import { generateEntityIdFromAddress, generatePluginEntityId, } from '@aragon/osx-commons-subgraph'; -import {Address, BigInt, DataSourceContext, log} from '@graphprotocol/graph-ts'; +import {Address, BigInt, DataSourceContext} from '@graphprotocol/graph-ts'; import { assert, afterEach, @@ -610,8 +609,6 @@ describe('Governance ERC20', () => { test("It should initialize with the user's existing voting power and delegation, if she has any", () => { // constants const STARTING_BALANCE = '10'; - const TRANSFER = '3'; - const REMAINING = '7'; // mocked calls getBalanceOf( @@ -639,16 +636,6 @@ describe('Governance ERC20', () => { Address.fromString(fromAddressHexString) ); - const memberEntityIdTo = generateMemberEntityId( - pluginAddressSecond, - Address.fromString(toAddressHexString) - ); - - const memberEntityIdToSecondPlugin = generateMemberEntityId( - pluginAddressSecond, - Address.fromString(toAddressHexString) - ); - // delegate to self const delegateChangedEvent = createNewDelegateChangedEvent( fromAddressHexString, From b51bd9437acd776f91d383f163c8d45c3f7bade5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Manuel=20Mari=C3=B1as=20Bascoy?= Date: Wed, 24 Apr 2024 17:17:57 +0200 Subject: [PATCH 6/6] docs: improve graphql schema comments --- packages/subgraph/schema.graphql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 0f58243b6..cd0840851 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -889,7 +889,8 @@ type MultisigPlugin implements IPlugin @entity { type MultisigApprover @entity { """ - Current Approver of the multisig + Current Approver of the multisig. If the approver is removed from the multisig, + the entity is not deleted and instead the isActive flag is set to false. """ id: ID! # plugin_address + member_address address: Bytes! @@ -900,10 +901,9 @@ type MultisigApprover @entity { type MultisigProposalApproval @entity(immutable: true) { """ - An approval for a specific multisig proposal - Will typically also be the address of a MultisigApprover - But will also store historical approvers if the address - was later deleted. + An approval of an specific multisig proposal + This entity works as a join table between MultisigProposal and MultisigApprover + and also stores the timestamp of the approval """ id: ID! # approver + proposal approver: MultisigApprover!