Call result decoder does not perform type inference #281

Closed
opened 2020-09-26 01:10:08 +09:00 by gorbak25 · 2 comments
gorbak25 commented 2020-09-26 01:10:08 +09:00 (Migrated from gitlab.com)

When decoding call results we are not doing any type inference.
Given this contract:

contract Test = 
    entrypoint test(a: 'a) = a

By trying to call:
test(ak_11111111111111111111111111111111273Yts)
the resulting call result fails to decode:

Data error:
Cannot translate FATE value {address,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                       0,0,0,0,0,0,0,0,0,0,0,0,0>>}
  of Sophia type 'a
When decoding call results we are not doing any type inference. Given this contract: ``` contract Test = entrypoint test(a: 'a) = a ``` By trying to call: test(ak_11111111111111111111111111111111273Yts) the resulting call result fails to decode: ``` Data error: Cannot translate FATE value {address,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0>>} of Sophia type 'a ```
gorbak25 commented 2020-09-26 01:32:20 +09:00 (Migrated from gitlab.com)
~/aesophia_cli/priv/bin/v4.3.1/aesophia_cli Polymorphic.aes --call_result_type "ok" --call_result_fun "test" --call_result "cb_nwCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQeQRm"
``` ~/aesophia_cli/priv/bin/v4.3.1/aesophia_cli Polymorphic.aes --call_result_type "ok" --call_result_fun "test" --call_result "cb_nwCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQeQRm" ```
zxq9 commented 2021-11-25 17:16:45 +09:00 (Migrated from gitlab.com)

Created by: hanssv

While you can do something about this in a few obvious cases; it can't be solved in the general case I think?!

*Created by: hanssv* While you can do something about this in a few obvious cases; it can't be solved in the general case I think?!
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#281
No description provided.