Skip to content

Commit d9a45a0

Browse files
authored
Merge pull request #3271 from input-output-hk/feat/LW-12088-enable-cip129-support
feat: add support of cip129 for drep ids
2 parents 57141a8 + 286799a commit d9a45a0

File tree

7 files changed

+13
-18
lines changed

7 files changed

+13
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Chores
66

7+
- Added support of CIP-129 for DRep IDs ([PR 3271](https://github.com/input-output-hk/daedalus/pull/3271))
8+
79
- Update `cardano-node` to 10.1.4, and `cardano-wallet` to v2025-01-09 ([PR 3270](https://github.com/input-output-hk/daedalus/pull/3270))
810

911
## 7.0.2

source/renderer/app/components/voting/voting-governance/VotingPowerDelegation.messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ export const messages = defineMessages({
44
drepInputLabel: {
55
id: 'voting.governance.drepInputLabel',
66
defaultMessage:
7-
'!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}',
7+
'!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}',
88
description: 'Label for DRep input on the governance page',
99
},
1010
drepInputLabelPreprod: {
1111
id: 'voting.governance.drepInputLabelPreprod',
12-
defaultMessage: '!!!Please type or paste a valid DRep ID (CIP-105) here.',
12+
defaultMessage: '!!!Please type or paste a valid DRep ID here.',
1313
description: 'Label for DRep input on the governance page for preprod',
1414
},
1515
drepInputLabelLinkText: {

source/renderer/app/components/voting/voting-governance/VotingPowerDelegation.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ type StateConfirmation = Omit<FormData, 'fee'> & {
7272

7373
type State = Form | FormWithError | StateFormComplete | StateConfirmation;
7474

75-
// TODO discuss if we need to restrict the length
76-
const isDrepIdValid = (drepId: string) => {
77-
const isDRepId = (value: string): value is Cardano.DRepID =>
78-
Cardano.DRepID.isValid(value);
79-
return isDRepId(drepId) && Cardano.DRepID.toCip105DRepID(drepId) === drepId;
80-
};
81-
8275
const mapOfTxErrorCodeToIntl: Record<
8376
InitializeVPDelegationTxError,
8477
typeof messages[keyof typeof messages]
@@ -110,7 +103,7 @@ function VotingPowerDelegation({
110103
}: Props) {
111104
const [state, setState] = useState<State>(initialState);
112105

113-
const drepInputIsValid = isDrepIdValid(state.drepInputState.value);
106+
const drepInputIsValid = Cardano.DRepID.isValid(state.drepInputState.value);
114107

115108
const formIsValid =
116109
!!state.selectedWallet &&

source/renderer/app/i18n/locales/defaultMessages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4407,12 +4407,12 @@
44074407
{
44084408
"descriptors": [
44094409
{
4410-
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
4410+
"defaultMessage": "!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
44114411
"description": "Label for DRep input on the governance page",
44124412
"id": "voting.governance.drepInputLabel"
44134413
},
44144414
{
4415-
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here.",
4415+
"defaultMessage": "!!!Please type or paste a valid DRep ID here.",
44164416
"description": "Label for DRep input on the governance page for preprod",
44174417
"id": "voting.governance.drepInputLabelPreprod"
44184418
},

source/renderer/app/i18n/locales/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,11 @@
729729
"voting.governance.confirmationDialog.vote": "Vote",
730730
"voting.governance.delegateToDRep": "Delegate to DRep (default)",
731731
"voting.governance.drepInputError": "Invalid DRep ID",
732-
"voting.governance.drepInputLabel": "Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
732+
"voting.governance.drepInputLabel": "Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
733733
"voting.governance.drepInputLabelLinkText": "DRep directory",
734734
"voting.governance.drepInputLabelLinkUrl": "https://gov.tools/drep_directory",
735735
"voting.governance.drepInputLabelLinkUrlPreview": "https://preview.gov.tools/drep_directory",
736-
"voting.governance.drepInputLabelPreprod": "Please type or paste a valid DRep ID (CIP-105) here.",
736+
"voting.governance.drepInputLabelPreprod": "Please type or paste a valid DRep ID here.",
737737
"voting.governance.drepInputPlaceholder": "Paste DRep ID here …",
738738
"voting.governance.heading": "CARDANO VOTING POWER DELEGATION",
739739
"voting.governance.initializeTxError.generic": "Something went wrong during transaction initialization. Please try again in a few minutes. ",

source/renderer/app/i18n/locales/ja-JP.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,11 @@
729729
"voting.governance.confirmationDialog.vote": "投票",
730730
"voting.governance.delegateToDRep": "DRepに委任(初期設定)",
731731
"voting.governance.drepInputError": "無効なDRep IDです",
732-
"voting.governance.drepInputLabel": "有効なDRep ID (CIP-105)を入力するか貼り付けます。{drepDirectoryLink}で検索する",
732+
"voting.governance.drepInputLabel": "有効なDRep ID を入力するか貼り付けます。{drepDirectoryLink}で検索する",
733733
"voting.governance.drepInputLabelLinkText": "DRepディレクトリ",
734734
"voting.governance.drepInputLabelLinkUrl": "https://gov.tools/drep_directory",
735735
"voting.governance.drepInputLabelLinkUrlPreview": "https://preview.gov.tools/drep_directory",
736-
"voting.governance.drepInputLabelPreprod": "有効なDRep ID (CIP-105)を入力するか貼り付けます。",
736+
"voting.governance.drepInputLabelPreprod": "有効なDRep ID を入力するか貼り付けます。",
737737
"voting.governance.drepInputPlaceholder": "DRep IDを追加してください",
738738
"voting.governance.heading": "Cardano投票権の委任",
739739
"voting.governance.initializeTxError.generic": "トランザクションの初期化中に問題が発生しました。しばらくしてからもう一度お試しください。",

translations/messages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4407,12 +4407,12 @@
44074407
{
44084408
"descriptors": [
44094409
{
4410-
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
4410+
"defaultMessage": "!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
44114411
"description": "Label for DRep input on the governance page",
44124412
"id": "voting.governance.drepInputLabel"
44134413
},
44144414
{
4415-
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here.",
4415+
"defaultMessage": "!!!Please type or paste a valid DRep ID here.",
44164416
"description": "Label for DRep input on the governance page for preprod",
44174417
"id": "voting.governance.drepInputLabelPreprod"
44184418
},

0 commit comments

Comments
 (0)