ubiquity / ubiquity-dollar

Ubiquity Dollar (UUSD) smart contracts and user interface.
https://uad.ubq.fi
Apache License 2.0
34 stars 89 forks source link

chore: facetCut tests #859

Closed gitcoindev closed 9 months ago

gitcoindev commented 9 months ago

test: implement MockFacet skeleton and initial facetCut tests

Resolves: #838

gitcoindev commented 9 months ago

@rndquu @molecula451 I covered initial edge cases for the diamond facet cut. I am still working to cover add / replace / remove diamond facet cut operations, therefore switched this pull request to a draft. I will let you know when it is ready for the review.

gitcoindev commented 9 months ago

@rndquu , @molecula451 pull request ready for review, this one bumps test coverage to 76.6%

Development branch coverage: 70.9 PR branch coverage: 76.6

molecula451 commented 9 months ago

good work, it's nice the coverage increased but can you mock a library instead? and import the struct, storage selectors etc from there? also the interface? Basically the whole diamond pattern are library importing would be much better architected (the test) @gitcoindev

gitcoindev commented 9 months ago

good work, it's nice the coverage increased but can you mock a library instead? and import the struct, storage selectors etc from there? also the interface? Basically the whole diamond pattern are library importing would be much better architected (the test) @gitcoindev

hi @molecula451 thank you. Did I understand correct that you mean to create test/diamond/facets/DiamondCutFacet.t.sol and move test implementation with all imports there ?

molecula451 commented 9 months ago

@gitcoindev re-checking this notice the lack commenting, at least a header comment explaining the intention, for future reference when reading the code