Skip to content
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

marshal cannot serialize standard Maps #838

Closed
DavidBruant opened this issue Apr 3, 2020 · 2 comments
Closed

marshal cannot serialize standard Maps #838

DavidBruant opened this issue Apr 3, 2020 · 2 comments
Assignees
Labels
marshal package: marshal

Comments

@DavidBruant
Copy link
Contributor

This came out in a discussion with @katelynsills about what the getAvailableTickets method could return in the Opera ticket contract

@DavidBruant DavidBruant added the marshal package: marshal label Apr 3, 2020
@erights
Copy link
Member

erights commented Apr 3, 2020

For now, we can't serialize any kind of maps. For now though, given a map m, you can turn it into an array of [key, value] pairs by

[...m]

which we can serialize. On the other side, given an array of [key, value] pairs pairs, you can turn it back into a map by

new Map(pairs)

Longer term, in the https://github.com/Agoric/agoric-sdk/tree/passable-collections branch I'm working on passable collections which can be marshalled and unmarshalled correctly, and whose key-lookup-equality is sameStructure equality, which is the equality preserved by our marshal and distributed object semantics. But this won't happen soon.

@erights
Copy link
Member

erights commented Feb 19, 2021

The need for passable collections is already described or started in other issues and PRs. The so-called "passable collections" would include passable sets and passable maps. However, that's as far as this support should go. Marshal should not serialize standard sets and maps. Since the others remain open I'm closing this.

@erights erights closed this as completed Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
marshal package: marshal
Projects
None yet
Development

No branches or pull requests

2 participants