Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Kontrol tests for demo #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Init Kontrol tests for demo #6

wants to merge 6 commits into from

Conversation

palinatolmach
Copy link

To run tests introduced in this PR, please execute

kontrol build --require lemmas.k --module-import KontrolAllowedControllersTest:PROJECT-LEMMAS
kontrol prove --match-test "prove_" -j5

The added tests are generalized versions of existing tests, e.g.,

    function prove_setFactory_onlyOwner(address caller, address _delegationWalletFactory) public {
        _notBuiltinAddress(caller);
        _notBuiltinAddress(_delegationWalletFactory);

        vm.prank(caller);

        vm.expectRevert("Ownable: caller is not the owner");
        registry.setFactory(_delegationWalletFactory);
    }

    function prove_setFactory_should_work(address _delegationWalletFactory) public {
        _notBuiltinAddress(_delegationWalletFactory);
        vm.assume(_delegationWalletFactory != address(0));

        registry.setFactory(_delegationWalletFactory);

        assert(registry.delegationWalletFactory() == _delegationWalletFactory);
    }

ensure that a factory in DelegationWalletFactory can only be set by an owner, and is set successfully if the factory address is valid and setFactory is called by an owner.

* First add for KaaS supporting kontrol prove

* Add workflow to run proofs in KaaS

* Update references to kaas compute

* Trying to fix reporting statuses

* Need to use head.sha from the pull_request, otherwise github.sha generates a merge commit sha which doesn't reference properly for commit statuses

---------

Co-authored-by: Juan C <juanconrod@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants