-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icrc1Transfer method to ICP ledger canister (#419)
# Motivation We want to transfer ICP using the ICRC-1 API because then we don't have to compute account identifiers in the client. Passing the ICP ledger canister ID to the ICRC-1 API works but the ICP ledger canister has its own ICRC-1 interface so calling it directly on the ICP ledger API is cleaner. *Note*: I started with a commit that duplicates the non-ICRC-1 code. That way you can see how the ICRC-1 code differs from the existing code by reviewing the second commit. # Changes 1. Added `icrc1Transfer` canister method. 2. Added `toIcrc1TransferRawRequest` request converter. 3. Added `mapIcrc1TransferError` error converter. 4. Added `Icrc1TransferRequest` request type. # Tests Copied the existing tests for `transfer` and applied them to `icrc1Transfer` as far as they made sense. The new method has less custom code for hardware wallets so some of those test have not been duplicated. Tested manually in NNS dapp by using the new method when making ICRC-1 transfers and then testing an ICRC-1 transfer. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4c8dd0b
commit 1f2e7d9
Showing
7 changed files
with
482 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.