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

feat: implement toJSON on delegations #173

Closed
wants to merge 1 commit into from
Closed

Conversation

Gozala
Copy link
Collaborator

@Gozala Gozala commented Dec 12, 2022

Fixes #172

@Gozala Gozala marked this pull request as ready for review December 12, 2022 19:24
@alanshaw
Copy link
Member

If we get a fromJSON we can remove some code for storing delegations in the access Conf store.

@Gozala
Copy link
Collaborator Author

Gozala commented Dec 12, 2022

If we get a fromJSON we can remove some code for storing delegations in the access Conf store.

I don't think fromJSON is visible because delegation formats the block not the chain, which is to say that fromJSON(toJSON(delegation)) is going to be lossy because all of the proofs will be turned into links, which is why fromJSON was never part of the API.

I've created #174 to discuss this further, I don't think we should block this

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very unexpected for toJSON to be lossy. I wouldn't have suggested fromJSON if I'd known that was the case.

It either needs to be commented heavily or renamed. I'm not even sure if commenting is enough since toJSON is called transparently by JSON.stringify.

@vasco-santos
Copy link
Contributor

Let's discuss this further once we get first prod release in place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add toJSON method to delegations
3 participants