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

[#90] Limit minters #95

Merged
merged 1 commit into from
Aug 21, 2020
Merged

[#90] Limit minters #95

merged 1 commit into from
Aug 21, 2020

Conversation

sras
Copy link
Contributor

@sras sras commented Aug 20, 2020

Description

Summary of changes.

  1. Changed storage to use Map instead of big map.
  2. Added check in configure_minter entrypoint to see if contract already contains 12 minters, and if it does throw error "MINTER_LIMIT_REACHED" (Could probably use a better error)
  3. Added tests to check if we can add minters up to the limit, and if the the contract throw error if we try to add more.
  4. Added a Nettest that tries to max out the minter count.

Related issue(s)

Resolves #90

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog unless I am sure my changes are
      not essential.

Stylistic guide (mandatory)

docs/specification.md Outdated Show resolved Hide resolved
docs/specification.md Outdated Show resolved Hide resolved
haskell/test/Lorentz/Contracts/Test/Management.hs Outdated Show resolved Hide resolved
haskell/test/Lorentz/Contracts/Test/Management.hs Outdated Show resolved Hide resolved
haskell/test/Lorentz/Contracts/Test/Management.hs Outdated Show resolved Hide resolved
@gromakovsky
Copy link
Collaborator

Note that nettest started to fail.

Problem: Currently we do not limit the number of possible minters and
thus store them in a big map. But this is not required as we won't
really have more than around 12 minters.

Solution: Limit the total number of minters to 12. Since the number of
minters is limited, we can store them in a map instead of a bigmap. So
chage the storage accordingly. Add tests to check contract won't accept
more then 12 minters.
@sras sras force-pushed the sras/#90-limit-minters branch from e335566 to 5a6d7fc Compare August 21, 2020 11:01
@sras sras merged commit d381267 into master Aug 21, 2020
@sras sras deleted the sras/#90-limit-minters branch August 21, 2020 11:31
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.

Limit the number of minters and store in a strict map
2 participants