I'm writing a script with subxt. How can I wrap a set_code tx in a sudo_unchecked_weight tx?
Current code:
let sudo_set_code: Payload<SetCode> = nodetemplate::tx().system().set_code(code);
let weight = Weight {
ref_time: 0,
proof_size: 0,
};
let sudo_tx = nodetemplate::tx().sudo().sudo_unchecked_weight(sudo_set_code, weight);
Traceback:
error[E0308]: mismatched types
--> src/main.rs:29:67
|
29 | let sudo_tx = nodetemplate::tx().sudo().sudo_unchecked_weight(sudo_set_code, weight);
| --------------------- ^^^^^^^^^^^^^ expected `RuntimeCall`, found `Payload<SetCode>`
| |
| arguments to this method are incorrect
|
= note: expected enum `RuntimeCall`
found struct `subxt::tx::Payload<SetCode>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `test_sudo_subxt` (bin "test_sudo_subxt") due to previous error