Skip to content

Expanded example for env-sigs #358

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

lsgunnlsgunn
Copy link
Contributor

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • (If Relevant) Documentation has been (manually) updated at https://docs.kadena.io/pact

Additionally, please justify why you should or should not do the following:

  • Benchmark regressions
  • Confirm replay/back compat (Ignore until core release)
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact (Ignore until core release)

@lsgunnlsgunn lsgunnlsgunn requested a review from rsoeldner April 16, 2025 18:49
@lsgunnlsgunn lsgunnlsgunn self-assigned this Apr 16, 2025
@lsgunnlsgunn lsgunnlsgunn added the documentation Improvements or additions to documentation label Apr 16, 2025
The following example illustrates using the `env-sigs` function to sign a transaction with a specific public key and capability in the Pact REPL:

```pact
(env-sigs [{"key": "9a23bf6a61f753d3ffa45c02b33c65b9dc80b8fb63857debcfe21fdb170fcd99", "caps": [PAYADMIN]}])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this hasn't been tested and is incorrect.

Caps must be enclosed in ()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help, @CryptoPascal31 !
I know there are some other typos or untested examples, so please do feel free to flag anything you find or submit a fix directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only typos... The current Pact 5 documentation has a lot of misleading (and even some totally wrong) statements on every page...

Comment on lines 56 to 58
,'caps: [(MINT (read-msg "token-id") (read-string 'account) 4.0)]}
])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"key" and "caps" here as well please :)

@lsgunnlsgunn lsgunnlsgunn requested a review from jmcardon April 25, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants