In a custom Substrate pallet unit test, I need to get a list of governance proposals using the chain state. I have used Polkadot JS to query state before but not from within a Substrate unit test in Rust.
Do I need to use a mock? I think I have to create to create the encoded key from the module and method names. This is probably way off but here's what I've come up with:
let key = twox_128("Collective") + twox_128("CouncilProposals");
let encoded_key = scale_encode(key);
let storage_key = blake2_128_concat(encoded_key);
let proposals = state_getStorage(storage_key);
What's the correct way to do it? I need an example.