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: support for index-ng canister (in a dedicated module) in ledger-icrc #562

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Mar 4, 2024

Motivation

Provide support for the index-ng canister in @dfinity/ledger-icrc.

Notes

The support was originally introduced as a replacement of the existing IndexCanister but, after testing a next release, we figured out it introduced a breaking changes as a variable balance was added as a non optional argument in the GetTransactions results.

This lead to following error when the canister was using to query "old-index" canister:

Sorry, there was an error loading the transactions for this account. Cannot find required field balance

That's why ultimately we decided to introduce support for the index-ng canister in a dedicated module.

Previous PRs

For tracability:

Changes

  • use index-ng/index-ng.did as source for the Index-ng canister
  • extract an interface for icrc_balance_of for Index-ng and ledger canister (we assume in the future there might be other duplicate functions that are shared by both canisters)
  • Implement getTransactions which accept queries

@peterpeterparker peterpeterparker changed the title feat: move ICRC index-ng canister to dedicated own module feat: support for index-ng canister (in a dedicated module) in ledger-icrc Mar 4, 2024
Copy link
Contributor

github-actions bot commented Mar 4, 2024

size-limit report 📦

Path Size
@dfinity/ckbtc 7.23 KB (0%)
@dfinity/cketh 1.97 KB (0%)
@dfinity/cmc 1.29 KB (0%)
@dfinity/ledger-icrc 3.38 KB (+13.92% 🔺)
@dfinity/ledger-icp 15.83 KB (0%)
@dfinity/nns 35.74 KB (0%)
@dfinity/nns-proto 76.44 KB (0%)
@dfinity/sns 15.43 KB (0%)
@dfinity/utils 4.44 KB (0%)
@dfinity/ic-management 2.44 KB (0%)

@peterpeterparker peterpeterparker marked this pull request as ready for review March 4, 2024 15:31
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.

LGTM

@peterpeterparker
Copy link
Member Author

Quickly tested in Oisy ✅

@peterpeterparker peterpeterparker merged commit d384621 into main Mar 5, 2024
11 checks passed
@peterpeterparker peterpeterparker deleted the feat/index-ng-in-specific-canister branch March 5, 2024 06:15
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