From 0b9a62135c103d278519e8985bacf3bae8e95005 Mon Sep 17 00:00:00 2001 From: Hjort Date: Mon, 4 Dec 2023 17:15:53 +0100 Subject: [PATCH 1/3] Fix missing date for when stake changes take effect --- packages/browser-wallet/CHANGELOG.md | 6 ++++++ packages/browser-wallet/package.json | 2 +- .../browser-wallet/src/popup/pages/Account/Earn/Earn.tsx | 9 +++++++-- yarn.lock | 8 ++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index d0c96b0b..652f34ba 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixed + +- Missing date for delegation/validation stake decrease/stop has been restored. + ## 1.2.1 ### Fixed diff --git a/packages/browser-wallet/package.json b/packages/browser-wallet/package.json index cd35ef40..17034cf7 100644 --- a/packages/browser-wallet/package.json +++ b/packages/browser-wallet/package.json @@ -53,7 +53,7 @@ "react-window-infinite-loader": "^1.0.8", "readable-stream": "^4.2.0", "uuid": "^8.3.2", - "wallet-common-helpers": "https://github.com/Concordium/concordium-wallet-common-helpers.git#d6dd106aa892d683bcaad33189ed4043bcfc55a0" + "wallet-common-helpers": "https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44" }, "devDependencies": { "@babel/core": "^7.18.2", diff --git a/packages/browser-wallet/src/popup/pages/Account/Earn/Earn.tsx b/packages/browser-wallet/src/popup/pages/Account/Earn/Earn.tsx index 9b718a75..52571840 100644 --- a/packages/browser-wallet/src/popup/pages/Account/Earn/Earn.tsx +++ b/packages/browser-wallet/src/popup/pages/Account/Earn/Earn.tsx @@ -7,7 +7,8 @@ import { ChainParametersV0, isBakerAccount, isDelegatorAccount, - isRewardStatusV1, + RewardStatus, + RewardStatusV0, } from '@concordium/web-sdk'; import Button from '@popup/shared/Button'; @@ -72,6 +73,10 @@ function Earn({ chainParameters }: EarnProps) { ); } +function isNotRewardStatusV0(rewardStatus?: RewardStatus): rewardStatus is Exclude { + return rewardStatus ? rewardStatus.version !== 0 : false; +} + export default function EarnRoutes() { const { setDetailsExpanded } = useContext(accountPageContext); const accountInfo = ensureDefined(useSelectedAccountInfo(), 'Expected to find account info for selected account'); @@ -107,7 +112,7 @@ export default function EarnRoutes() { const consensusStatus = useAsyncMemo(() => client.getConsensusStatus(), undefined, []); const tokenomicsInfo = useAsyncMemo( - () => client.getTokenomicsInfo().then(filterType(isRewardStatusV1)), + () => client.getTokenomicsInfo().then(filterType(isNotRewardStatusV0)), undefined, [] ); diff --git a/yarn.lock b/yarn.lock index 7b9fd0c1..498fc9e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2280,7 +2280,7 @@ __metadata: tsconfig-paths-webpack-plugin: ^3.5.2 typescript: ^5.2.2 uuid: ^8.3.2 - wallet-common-helpers: "https://github.com/Concordium/concordium-wallet-common-helpers.git#d6dd106aa892d683bcaad33189ed4043bcfc55a0" + wallet-common-helpers: "https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44" languageName: unknown linkType: soft @@ -23299,9 +23299,9 @@ __metadata: languageName: node linkType: hard -"wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#d6dd106aa892d683bcaad33189ed4043bcfc55a0": +"wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44": version: 2.0.0 - resolution: "wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#commit=d6dd106aa892d683bcaad33189ed4043bcfc55a0" + resolution: "wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#commit=6ffa41dc5f7bd345f4ef07860982d6d290880c44" dependencies: buffer: ^6.0.3 cbor: ^8.0.0 @@ -23311,7 +23311,7 @@ __metadata: "@concordium/web-sdk": 7.x react: ">=16" react-dom: ">=16" - checksum: 508bf6f0d52f72ff110090e4ee2ec0e58affe2d93cdb55e26a7962d2fbe2714b9bd169ce196556a54aa4d16f13541bd6fcf6b32adc709845591cf97fc61a746a + checksum: 44d3f75d2547b3bf3242f4783110bf21dedec6b142dcbad749040a64d017665c6fa3012d791e85160f6b79188adddd9dc89e65bb75d567accd12affc17bde635 languageName: node linkType: hard From 0e9580c5b287df58e9113f82d5adf43d809c6d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Hjort?= <87635671+shjortConcordium@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:17:44 +0100 Subject: [PATCH 2/3] Update wallet-common-helpers hash to target main --- packages/browser-wallet/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser-wallet/package.json b/packages/browser-wallet/package.json index 17034cf7..fd9a903c 100644 --- a/packages/browser-wallet/package.json +++ b/packages/browser-wallet/package.json @@ -53,7 +53,7 @@ "react-window-infinite-loader": "^1.0.8", "readable-stream": "^4.2.0", "uuid": "^8.3.2", - "wallet-common-helpers": "https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44" + "wallet-common-helpers": "https://github.com/Concordium/concordium-wallet-common-helpers.git#b5b8acd7304f297a1aa67c91b735e90f3edef5a5" }, "devDependencies": { "@babel/core": "^7.18.2", From 8c16fdb3ebef7ca62bf5469712b3e1c24882dc7b Mon Sep 17 00:00:00 2001 From: Hjort Date: Wed, 6 Dec 2023 10:19:51 +0100 Subject: [PATCH 3/3] Fix yarn.lock --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 498fc9e6..0c019277 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2280,7 +2280,7 @@ __metadata: tsconfig-paths-webpack-plugin: ^3.5.2 typescript: ^5.2.2 uuid: ^8.3.2 - wallet-common-helpers: "https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44" + wallet-common-helpers: "https://github.com/Concordium/concordium-wallet-common-helpers.git#b5b8acd7304f297a1aa67c91b735e90f3edef5a5" languageName: unknown linkType: soft @@ -23299,9 +23299,9 @@ __metadata: languageName: node linkType: hard -"wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#6ffa41dc5f7bd345f4ef07860982d6d290880c44": +"wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#b5b8acd7304f297a1aa67c91b735e90f3edef5a5": version: 2.0.0 - resolution: "wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#commit=6ffa41dc5f7bd345f4ef07860982d6d290880c44" + resolution: "wallet-common-helpers@https://github.com/Concordium/concordium-wallet-common-helpers.git#commit=b5b8acd7304f297a1aa67c91b735e90f3edef5a5" dependencies: buffer: ^6.0.3 cbor: ^8.0.0