I'm porting a script from TypeScript using the Polkadot.JS/api to Rust using Subxt.
let query = polkadot::storage().referenda().referendum_info_for_root();
let mut results = api.storage().at_latest().await?.iter(query,10).await?;
while let Some((key, value)) = results.next().await? {
With reference to the above, I'm having trouble getting the referendum id
from the key
. Within my TypeScript code I would use something like key.toHuman()[0]
.
Regards,