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

fix: Principal JSON is compatible with @dfinity/utils jsonReviver helper #770

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Sep 22, 2023

Description

@peterpeterparker brought up compatibility with @dfinity/utils in #766, and I agreed that we should use that standard for more concrete serialization. Instead of the string, will instead return an object,

{"__principal__":"ryjl3-tyaaa-aaaaa-aaaba-cai"}

matching a newly exported key, JSON_KEY_PRINCIPAL, and a returning a new type, JsonnablePrincipal.

Also extends the fromText and from constructors to support strings using the JSON-serialized principals

Fixes # (issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner September 22, 2023 19:18
@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2023

size-limit report 📦

Path Size
@dfinity/agent 87.43 KB (+0.06% 🔺)
@dfinity/candid 13.58 KB (+0.39% 🔺)
@dfinity/principal 5.2 KB (+0.93% 🔺)
@dfinity/auth-client 92.61 KB (+0.07% 🔺)
@dfinity/assets 90.01 KB (+0.06% 🔺)
@dfinity/identity 89.88 KB (+0.07% 🔺)
@dfinity/identity-secp256k1 232.59 KB (+0.04% 🔺)

@krpeacock krpeacock enabled auto-merge (squash) September 22, 2023 23:23
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.

2 participants