tezos-commons / baseDAO

BaseDAO - a generic smart contract framework for DAOs on Tezos
57 stars 15 forks source link

[#319] Add `plist` ligo contract, add property tests for it #320

Closed rinn7e closed 2 years ago

rinn7e commented 2 years ago

Description

Problem: Currently, we only tests plist utility functions one at a time. It may be helpful to test combinations of them at the same time.

Solution: Add plist ligo contract, and add property tests for it by comparing it with haskell list implementation.

Related issue(s)

Resolves #319

:white_check_mark: Checklist for your Pull Request

Related changes (conditional)

Stylistic guide (mandatory)

rinn7e commented 2 years ago

@sras This PR is ready for review, let me know if this solution is what you have in mind.

sras commented 2 years ago

@rinn7e When I run these tests locally, it hangs sometimes. Can you please check on your side?

sras commented 2 years ago

@rinn7e When I completely delete the plist_delete and plist_insert function (in original LIGO code) and replace it with a nop code, and then run these tests, they still appear to pass. The main SMT tests pass as well.

But regular integrational tests fail.

Can you please try this and see if you are getting the same result?

rinn7e commented 2 years ago

@rinn7e When I completely delete the plist_delete and plist_insert function (in original LIGO code) and replace it with a nop code, and then run these tests, they still appear to pass. The main SMT tests pass as well.

But regular integrational tests fail.

Can you please try this and see if you are getting the same result?

@sras Looks like the BaseDAO smt was passing because the proposal min token is too high and no proposal get through (RegistryDAO and TreasuryDAO still fail as expected). I've fixed this now by setting the min token lower.

The property tests for plist functions still fail as expected:

Not sure why it does not fail for you, did you compile the plist contract? (by using make all or make out/plist_contract.tz).

image

sras commented 2 years ago

did you compile the plist contract?

I did compile it earlier, but now after running make clean and retrying, it appear to work as expected.

sras commented 2 years ago

@rinn7e Can you please rebase

rinn7e commented 2 years ago

@rinn7e Can you please rebase

@sras I've rebased with master now, have to squash the commits to fix come conflicts.