Skip to content

Commit

Permalink
Merge pull request #147 from gnosisguild/auryn/test-merkle-root-on-ci…
Browse files Browse the repository at this point in the history
…phernode-removal

add: test that root is correctly updated on leaf removal
  • Loading branch information
auryn-macmillan authored Oct 16, 2024
2 parents ecfd738 + 57ed5a6 commit c75f232
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,17 @@ describe("CiphernodeRegistryOwnable", function () {
.withArgs(notTheOwner.address);
});
it("removes the ciphernode from the registry", async function () {
const { registry, tree } = await loadFixture(setup);
const { registry } = await loadFixture(setup);
const tree = new LeanIMT(hash);
tree.insert(BigInt(AddressOne));
tree.insert(BigInt(AddressTwo));
const index = tree.indexOf(BigInt(AddressOne));
const proof = tree.generateProof(index);
tree.update(index, BigInt(0));
expect(await registry.isEnabled(AddressOne)).to.be.true;
expect(await registry.removeCiphernode(AddressOne, proof.siblings));
expect(await registry.isEnabled(AddressOne)).to.be.false;
expect(await registry.root()).to.equal(tree.root);
});
it("decrements numCiphernodes", async function () {
const { registry, tree } = await loadFixture(setup);
Expand Down

0 comments on commit c75f232

Please sign in to comment.