Hi,
I’m attempting to rewrite canister level unit tests in ic-repl for my project .
But, I couldn’t find a way to set an anonymous identity.
In dfx, following command sets anonymous identity:
dfx identity use anonymous
How can I do the same thing in ic-repl?
I have tried to set “anonymous” identity in ic-repl, but this code just generated the identity named “anonymous”, not anonymous identity.
identity anonymous;
call todo_ic.showCaller();
_;
// Current identity 7up7p-jdoh4-r2kau-5zxoe-g5mfx....
// -> not anonymous identity
Thanks.
nomeata
February 18, 2022, 8:00am
2
Pinging @chenyan and adding twenty characters to this post.
2 Likes
chenyan
February 18, 2022, 4:12pm
3
The default identity when entering ic-repl is the anonymous identity. However, you cannot switch back to anonymous after you use an identity command. I can add a binding for anonymous if needed.
2 Likes
Thank you for your reply! @chenyan
If switching to anonymous becomes possible, ic-repl would be more useful for writing anonymous testing scenarios.
I opened the feature request issue here:
opened 11:16AM - 19 Feb 22 UTC
There is no way to switch back to an anonymous identity after using an identity … command.
If it becomes possible, ic-repl would be more useful for writing anonymous testing scenarios.
Related forum post:
[Canister test by ic-repl: how to set anonymous identity?](https://forum.dfinity.org/t/canister-test-by-ic-repl-how-to-set-anonymous-identity/10957)
1 Like