Refactor domain_index
xlc opened this issue · 4 comments
xlc commented
Line 30 in 0a09486
It can be easily outdated and causing unexpected bug.
Why domains is a HashMap
if is really just a Vec<String, Vec<u8>>
?
jordy25519 commented
HashMap is unordered, Vec is an implementation detail to preserve ordering of payloads on encoding/decoding.
xlc commented
There is no need to use HashMap at all in this case. Vec<String, Vec<u8>>
is enough.
jordy25519 commented
If we use vec only, then we have to do search when querying the doughnut for permission domains.
This may be the solution if we can't integrate hashmap in cennznet/plug-blockchain#15
jordy25519 commented
Closed via #8