-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fromCell
method for maps
#1271
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Let's change the syntax here to make it consistent with
fromCell
for structs/messages. -
We need negative tests showing what happens when the cell does not represent a valid map. We need to validate the cell and it seems to me we could use TVM's
LDDICTS
instruction here and check the remainder is an empty slice. Or is there a better approach? What do you think?
let fizz: map<Int, Int> = emptyMap(); | ||
fizz.fromCell(cell); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, this should be consistent with what we have for structs:
struct Fizz { foo: Int }
let fizzCell = ...
let parsedFizz: Fizz = Fizz.fromCell(fizzCell);
So I would expect something like:
let fizz = map<Int, Int>.fromCell(cell);
This makes parsing harder but it seems it's too late to do it differently
@anton-trunov |
@Gusarich The TVM docs say this for
So, if a cell is map, then the remainder should be an empty slice, if I understand this correctly. |
@anton-trunov |
Issue
Closes #1229.
Checklist
docs/
and made the build locally