Open lacabra opened 5 years ago
That's weird. can you give me a sample of data? I can't see any unwraps there.
If I try to add "0x" to a pre_code, there is no exception. The following happens:
to_hex
fails here https://github.com/enigmampc/enigma-core/blob/develop/enigma-core/app/src/networking/ipc_listener.rs#L309
and then IpcResponse::Error
is created (as expected).
@elichai, as far as I understand, we have 2 relevant unwraps: https://github.com/enigmampc/enigma-core/blob/develop/enigma-core/app/src/networking/messages.rs#L219 https://github.com/enigmampc/enigma-core/blob/develop/enigma-core/app/src/main.rs#L37 But I don't see any problems with them in this case. This defect reveals some issue. Although the problem is wrong user input, system error is returned. Is this what we want?
This defect is planned to be fixed as part of general improvement of treating wrong inputs for deployment and computation of secret contracts.
Is your feature request related to a problem? Please describe.
Core throws an exception when processing a request to deploy a SecretContract that includes a PreCode field with other characters that are not hex, for example, just prepending the string
0x
to a hex string causes the following error:Describe the solution you'd like
It should gracefully return an error indicating that the input is invalid, more like: