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

Add dedicated node and constructor for general custom contracts #1964

Merged
merged 7 commits into from
Jun 24, 2024

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    82ce09f View commit details
    Browse the repository at this point in the history
  2. Use %contract/custom% in the stdlib

    Use the previously introduced new primop in the stdlib, to migrate from
    naked functions to wrapped custom contracts everywhere in the stdlib.
    yannham committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    9049696 View commit details
    Browse the repository at this point in the history
  3. Fix tests

    yannham committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    f31cb8c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4919678 View commit details
    Browse the repository at this point in the history
  5. Update the manual to use std.contract.custom

    Introduce the new contract constructor std.contract.custom in the
    manual, and make sure that this is now everywhere presented as the
    official way of building custom contracts. The section on custom
    contracts is also re-organized to make general custom contracts the last
    section, and present it as a last resort rather than the default way of
    building custom contracts. We also left some placeholder for to the
    soon-to-come validators.
    yannham committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    970d268 View commit details
    Browse the repository at this point in the history
  6. Fix typo in code comment

    yannham committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    522c330 View commit details
    Browse the repository at this point in the history
  7. Revert std.contract.apply -> %contract/apply%

    In a previous commit, after introducing %contract/custom%, the stdlib
    was upgraded to use this new contract constructor. Doing so, in the
    contract.unstable module, many `std.contract.apply` were turned into
    `%contract/apply%` following the philosophy that the stdlib should avoid
    indirection through other stdlib functions bit rather directly use
    primops.
    
    However, it turns out `%contract/apply%` is not equivalent to
    `std.contract.apply`. The later also stack the current diagnostics,
    while the former is really only performing a function-like application,
    which does make a difference for error reporting - the version with
    `%contract/apply%` could erase existing error reporting data.
    
    This commit reverts those primops calls back to using
    `std.contract.apply`.
    yannham committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    5cc4425 View commit details
    Browse the repository at this point in the history