Open haerdib opened 3 years ago
Actually, that does not work. All Strings sent to and received from openfinex need to be handled with normal from_uft8()
and as_bytes()
. Or atleast some conversion mechanism needs to be built.
I'm moving this issue to the main net. This should not be done hurriedly and it would be best to use this in combination with integration tests.. otherwise one might break alot of things.
With the removal of openfinex, this should not be an issue anymore, as we can completely remove the normal uft8 conversion. We'll need to see what the future brings about, I guess..
We somehow need to ensure that when comparing Strings in their UTF8 representation, all strings are converted the same way, either by
.encode()
from parity scale codec or.as_bytes()
. But never mixed. They are not compatible:When testing within the enclave:
The test failed:
Because with the
full
feature of parity scale codec theString::decode()
is now working within the enclave (see this issue for more information) I think it is easier to ensure noas_bytes()
is used compared to noencode()
for string. Mainly becauseencode()
is widely used for many different types and structs, whileas_bytes()
is not.