Kitty Kad
Kitty Kad

Reputation: 444

How do I run a function in Pact REPL without a keyset I defined

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?

Upvotes: 1

Views: 54

Answers (1)

Kitty Kad
Kitty Kad

Reputation: 444

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)

Upvotes: 1

Related Questions