6

I have created an anonymous proxy(Proxy pallet). Now I need to delete this proxy. I am using killAnonymous but it is giving me errors. enter image description here

Please suggest what i am doing incorrect here

6
  • I believe the extrinsic was executed successfully. The "incomplete execution" error seems like a misleading message. Can you check in storage that the proxy account has been removed?
    – Shawn Tabrizi
    Commented Mar 23, 2022 at 4:53
  • The only error that can be returned by killAnonymous is NoPermission, otherwise, it cannot fail.
    – Shawn Tabrizi
    Commented Mar 23, 2022 at 4:54
  • 2
    Yeah it's not deleted from the storage
    – Pankaj
    Commented Mar 23, 2022 at 4:57
  • When you generated the anonymous account, did you give yourself full permissions? Otherwise, you won't be able to delete the account.
    – Shawn Tabrizi
    Commented Mar 23, 2022 at 5:01
  • 2
    yeah, I created one proxy with Any and the other with Non-Transfer Proxy Type. and deleting the Non-transfer with Any One.
    – Pankaj
    Commented Mar 23, 2022 at 5:06

1 Answer 1

9

The kill_anonymous call needs to come from the anonymous itself:

let who = ensure_signed(origin)?;
let when = (height, ext_index);
let proxy = Self::anonymous_account(&spawner, &proxy_type, index, Some(when));
ensure!(proxy == who, Error::<T>::NoPermission);

Of course the only way to access an anonymous proxy origin is via proxy.proxy. Your call above is correct, but you need to wrap it in a proxy.proxy such that the origin is the anon proxy.

proxy.proxy(
    real: <YOUR_ANON_PROXY>,
    force_proxy_type: Any,
    call: proxy.killAnonymous(
        /* args */
    )

)

This is because the spawner may have set a new account as the proxy and removed itself, so the permission to kill an anon rests with the anon itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.