Calldata decode issue for singleton records #272

Closed
opened 2020-08-10 20:08:24 +09:00 by zxq9 · 0 comments
zxq9 commented 2020-08-10 20:08:24 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Singleton records are simplified to just values by the compiler, this is missing in the calldata decoding logic.

contract Test =
  
  record t = { name : string }
  type state = map(int, t)

  stateful entrypoint init() = {[1] = {name = "test"}}
  
  entrypoint get_state() = state
Error data: [{"message":"Cannot translate FATE value #{1 => <<\"test\">>}\n  of Sophia type map(int, {name : string})\n","pos":{"col":0,"line":0},"type":"data_error"}]
*Created by: hanssv* Singleton records are simplified to just values by the compiler, this is missing in the calldata decoding logic. ```sophia contract Test = record t = { name : string } type state = map(int, t) stateful entrypoint init() = {[1] = {name = "test"}} entrypoint get_state() = state ``` ``` Error data: [{"message":"Cannot translate FATE value #{1 => <<\"test\">>}\n of Sophia type map(int, {name : string})\n","pos":{"col":0,"line":0},"type":"data_error"}] ```
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#272
No description provided.