-
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.
NNS1-3094: Add stake field to TableProject (#5206)
# Motivation We want to show total stake in the staking projects table. In this PR we just add the data but don't show it in the UI yet. # Changes 1. Add `stake` field to `TableProject` type. 2. Calculate the stake for each project in `getTableProjects`. # Tests 1. Unit tests updated. 2. Tested manually in a branch including UI changes. # Todos - [ ] Add entry to changelog (if necessary). not yet
- Loading branch information
Showing
4 changed files
with
140 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import type { ResponsiveTableColumn } from "$lib/types/responsive-table"; | ||
import type { TokenAmountV2 } from "@dfinity/utils"; | ||
|
||
export type TableProject = { | ||
rowHref?: string; | ||
domKey: string; | ||
title: string; | ||
logo: string; | ||
neuronCount: number | undefined; | ||
stake: TokenAmountV2 | undefined; | ||
}; | ||
|
||
export type ProjectsTableColumn = ResponsiveTableColumn<TableProject>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import IC_LOGO_ROUNDED from "$lib/assets/icp-rounded.svg"; | ||
import { OWN_CANISTER_ID_TEXT } from "$lib/constants/canister-ids.constants"; | ||
import type { TableProject } from "$lib/types/staking"; | ||
import { ICPToken, TokenAmountV2 } from "@dfinity/utils"; | ||
|
||
export const mockTableProject: TableProject = { | ||
rowHref: `/neurons/?u=${OWN_CANISTER_ID_TEXT}`, | ||
domKey: OWN_CANISTER_ID_TEXT, | ||
title: "Internet Computer", | ||
logo: IC_LOGO_ROUNDED, | ||
neuronCount: 0, | ||
stake: TokenAmountV2.fromUlps({ | ||
amount: 100_000_000n, | ||
token: ICPToken, | ||
}), | ||
}; |