We have a dedicated thread stf_task_thread used for the sync handling of stf-tasks.
We need to find a way to read/write the sp-io storage in it.
The implementation of reading could be:
let mut stf_state: StfState = state_handler.load(&default_shard_identifier).unwrap();
stf_state.execute_with(||{
let key = storage_double_map_key(
"IdentityManagement",
"ChallengeCodes",
&self.verification_request.target,
&StorageHasher::Blake2_128Concat,
&self.verification_request.identity,
&StorageHasher::Blake2_128Concat,
);
log::warn!("storage--key: {:?}", key);
let code: Option<u32> = ita_stf::helpers::get_storage_by_key_hash(key);
log::warn!("code: {:?}", code);
});
What about the writing? We need to consider apply_update
Can we call pallet storage getter/setter instead? Like ita_sgx_runtime::IdentityManagement::challenge_codes(...)
We have a dedicated thread
stf_task_thread
used for the sync handling of stf-tasks.We need to find a way to read/write the sp-io storage in it.
The implementation of reading could be:
What about the writing? We need to consider
apply_update
Can we call pallet storage getter/setter instead? Likeita_sgx_runtime::IdentityManagement::challenge_codes(...)