Good day, I would love to know how to make Sudo calls through subxt library , I can't seem to find a meaningful solution. substrate-api-client has an example on how to make on, but going through the documentation of subxt library, it doesn't show how to do it.
1 Answer
There is a nice test that could be helpful for you to discover how to use sudo
:
let call = Call::Balances(BalancesCall::transfer {
dest: bob,
value: 10_000,
});
let found_event = cxt
.api
.tx()
.sudo()
.sudo(call)
.sign_and_submit_then_watch(&alice)
.await?
.wait_for_finalized_success()
.await?
.has::<sudo::events::Sudid>()?;
Update May 2023:
Original reference is outdated, new reference here: https://github.com/paritytech/subxt/blob/81494027c8f5ae62d44883167585d5e557f0fcba/testing/integration-tests/src/frame/sudo.rs#L26
-
1Original reference code is outdated, new reference here: github.com/paritytech/subxt/blob/… Commented May 17, 2023 at 7:48