Closed vplasencia closed 8 months ago
looks good. i'd also update/add a test where after deleting a leaf, self._has(0)
is asserted to be false.
Hey @0xbok! I think that's covered in the test Should not update a leaf that was removed
, but it makes sense to add one just for it in the has
section. Thanks.
@0xbok done ✅
Description
This PR:
Adds a check to the
_update
function in theInternalLeanIMT.sol
file to update thenewLeaf
index only ifnewLeaf
is different from 0. Now when trying to update a removed leaf the transaction will revert with the custom errorLeafDoesNotExist
.Removes unnecessary
newLeaf != 0
check. Since the _has function will no longer return true for the leaf 0, this check is no longer necessary.Adds new tests to cover 100% of the lines of
InternalLeanIMT.sol
,Related Issue(s)
Closes #228
Checklist
yarn prettier
andyarn lint
without getting any errors