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: copy ICP ledger-related features to new ledger-icp library #427

Merged
merged 31 commits into from
Oct 2, 2023

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Sep 26, 2023

Motivation

Community and developers are confused about what ledger and interfaces to use in which context. That's why we decided to makes it more clear that interfacing with ICP requires a specific library even though it supports ICRC-1. The idea is to have a generic ICRC-1 ledger lib and one dedicated to ICP.

That's why we are creating a new library and moving all ledger ICP related code from @dfinity/nns to @dfinity/ledger-icp.

Notes

  • No code changes, only code copied around.
  • In class AccountIdentifier instead of using a type declared in the Governance candid file to returns a hash as Unit8Array, I used an object that contains the primitive type as declaration.
  • This PR copy the related content to ledger-icp and a future PR will remove the duplication in nns
  • We also explicitely not copy the deprecated ICP to definitely ultimately remove it

@peterpeterparker peterpeterparker added the breaking_changes New feature or issue that results in breaking changes label Sep 26, 2023
@peterpeterparker peterpeterparker marked this pull request as draft September 26, 2023 12:17
@peterpeterparker
Copy link
Member Author

@lmuntaner settings this PR as draft only because we might want to publish a release before merging this one.

@peterpeterparker
Copy link
Member Author

@lmuntaner as we discussed doing it in two PRs for ledger-icrc, let's do it here also in two PRs.

  1. copy code to ledger-icp
  2. remove code in nns

@peterpeterparker peterpeterparker changed the title feat: move ICP ledger-related features to new ledger-icp library feat: copy ICP ledger-related features to new ledger-icp library Oct 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

size-limit report 📦

Path Size
@dfinity/ckbtc 6.38 KB (0%)
@dfinity/cmc 1.01 KB (0%)
@dfinity/ledger 2.92 KB (0%)
@dfinity/nns 29.79 KB (0%)
@dfinity/nns-proto 76.3 KB (0%)
@dfinity/sns 14.85 KB (0%)
@dfinity/utils 3.81 KB (0%)
@dfinity/ic-management 1.94 KB (0%)
@dfinity/ledger-icp 14.17 KB (+100% 🔺)

Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

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

Thanks!

@peterpeterparker peterpeterparker marked this pull request as ready for review October 2, 2023 10:13
@peterpeterparker peterpeterparker merged commit 1a3f303 into main Oct 2, 2023
9 checks passed
@peterpeterparker peterpeterparker deleted the feat/move-ledger-icp-features branch October 2, 2023 10:56
peterpeterparker added a commit that referenced this pull request Oct 2, 2023
# Motivation

This PR effectively removes the ledger from the library `@dfinity/nns` as related features were moved to `@dfinity/ledger-icp` in #427.

# Changes

- remove files
- bump v2.0.0
- use `@dfinity/ledger-icp` as peer dependency for few utils and types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_changes New feature or issue that results in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants