Skip to content

Commit

Permalink
refactor(group): remove check on generateMerkleProof function
Browse files Browse the repository at this point in the history
Contracts actually need devs to generate a Merkle proof of a removed member.

re #717
  • Loading branch information
cedoor committed Mar 28, 2024
1 parent 1c42ab3 commit 0014365
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions packages/group/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ export class Group {
* @returns The {@link MerkleProof} object.
*/
public generateMerkleProof(index: number): LeanIMTMerkleProof {
if (this.members[index] === 0n) {
throw new Error("Failed to generate Merkle proof: member has been removed")
}

return this.leanIMT.generateProof(index)
}

Expand Down
10 changes: 0 additions & 10 deletions packages/group/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,6 @@ describe("Group", () => {

expect(proof.leaf).toBe(1n)
})

it("Should not generate a proof of membership if the member has been removed", () => {
const group = new Group()
group.addMembers([1n, 3n])
group.removeMember(0)

const fun = () => group.generateMerkleProof(0)

expect(fun).toThrow("Failed to generate Merkle proof: member has been removed")
})
})

describe("# export", () => {
Expand Down

0 comments on commit 0014365

Please sign in to comment.