-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GIX-2154: Set mockCkETHToken to 18 decimals (#3935)
# Motivation `TokenAmount` only accepts 8 decimals so to be able to upgrade ic-js, we set the number of decimals on `mockCkETHToken` temporarily to 8. Now we want to set it back to 18 which is allowed by using `TokenAmountV2`. This means we have to accept `TokenAmountV2` in many places. This PR is not enough to make ENABLE_CKETH work again, but it's big enough already. # Changes 1. Make some components accept `TokenAmountV2` and some component both `TokenAmount | TokenAmountV2` to limit the spread of the change. 2. Add `formatTokenV2` which accepts both `TokenAmount | TokenAmountV2` but truncates decimals > 8 (for now?) and then calls `formatToken` with a correctly scaled amount. 3. Add `toTokenAmountV2` which accepts both `TokenAmount | TokenAmountV2` and return `TokenAmountV2`. 4. Make `numberToUlps` use `TokenAmountV2` as commented in a TODO. # Tests 1. Updated unit tests that failed because of the changes. 2. Added tests for `formatTokenV2` and `toTokenAmountV2`. 3. Enabled tests for `numberToUlps` that were previously failing. # Todos - [ ] Add entry to changelog (if necessary). not necessary
- Loading branch information
Showing
23 changed files
with
347 additions
and
93 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
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
4 changes: 2 additions & 2 deletions
4
frontend/src/lib/components/transaction/TransactionFormFee.svelte
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
6 changes: 3 additions & 3 deletions
6
frontend/src/lib/components/transaction/TransactionReceivedAmount.svelte
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
4 changes: 2 additions & 2 deletions
4
frontend/src/lib/components/transaction/TransactionReceivedTokenAmount.svelte
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
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.