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

Rename ICRC-1 memo to icrc1Memo #425

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Rename ICRC-1 memo to icrc1Memo #425

merged 4 commits into from
Sep 27, 2023

Conversation

dskloetd
Copy link
Collaborator

Motivation

The ICP ledger canister offers different interfaces to make transfers. The newer ICRC-1 interface and the older "legacy" interface.
Both interfaces allow passing a memo field in the parameters.
However these fields called memo have absolutely nothing to do with each other.
When fetching the transaction later, you get 2 unrelated fields called "memo" and "icrc1_memo".

When using the ICRC-1 interface it is not possible to set the memo field and when using the "legacy" interface it is not possible to set the icrc1_memo field.

Given how surprising and confusing this is, I believe it was a mistake to give these fields the same name in the method parameters.

Changes

  1. Rename the memo field in the ICRC-1 method parameters to icrc1Memo, in the ic-js repo.
  2. Add comments warning about the two fields being completely unrelated.

Tests

Existing unit test have been updated where necessary.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 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/ledger-icp -19 B (0%)
@dfinity/nns 29.69 KB (+0.02% 🔺)
@dfinity/nns-proto 76.3 KB (0%)
@dfinity/sns 14.72 KB (0%)
@dfinity/utils 3.81 KB (0%)
@dfinity/ic-management 1.94 KB (0%)

@dskloetd dskloetd requested a review from lmuntaner September 26, 2023 08:46
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
Copy link
Member

peterpeterparker commented Sep 26, 2023

Not sure renaming the field really makes it more clear that both field are unrelated. I mean "memo" and "icrc1_memo" are still "memo". In addition, the lib "ledger" is meant for icrc-1 and this is a breaking changes. So personally rather like that we do not rename it.

@peterpeterparker peterpeterparker added the breaking_changes New feature or issue that results in breaking changes label Sep 26, 2023
@dskloetd
Copy link
Collaborator Author

I've reverted the changes in the ledger package but kept the warning comments and kept the changes in the nns package.

@peterpeterparker peterpeterparker removed the breaking_changes New feature or issue that results in breaking changes label Sep 27, 2023
Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

Thanks @dskloetd

@dskloetd dskloetd enabled auto-merge (squash) September 27, 2023 08:15
@dskloetd dskloetd merged commit 1490895 into main Sep 27, 2023
9 checks passed
@dskloetd dskloetd deleted the kloet/icrc1-memo branch September 27, 2023 08:18
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.

3 participants