1

I defined a keyset (i.e. "my-admin-keyset") in the pact environment data. I want to test a function without that keyset present.

However every function I run, signs with that keyset.

How do I exclude a keyset when running a function?

Kitty Kad
  • 412
  • 1
  • 7

1 Answers1

1

This can be done by defining things in transaction blocks in the REPL.

When you need the admin-keyset functionality, you can define the keys for that block you're testing.

(begin-tx)
(env-keys ["my-admin-keyset"])
; Your code ...
(commit-tx)

If you want to test without that keyset and with another keyset, just set the environment keys to something else, like this

(begin-tx)
(env-keys ["some-other-keyset"])
; Your code ...
(commit-tx)
Kitty Kad
  • 412
  • 1
  • 7