Skip to content

Commit

Permalink
Merge pull request #3271 from input-output-hk/feat/LW-12088-enable-ci…
Browse files Browse the repository at this point in the history
…p129-support

feat: add support of cip129 for drep ids
  • Loading branch information
michalrus authored Jan 10, 2025
2 parents 57141a8 + 286799a commit d9a45a0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Chores

- Added support of CIP-129 for DRep IDs ([PR 3271](https://github.com/input-output-hk/daedalus/pull/3271))

- 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))

## 7.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export const messages = defineMessages({
drepInputLabel: {
id: 'voting.governance.drepInputLabel',
defaultMessage:
'!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}',
'!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}',
description: 'Label for DRep input on the governance page',
},
drepInputLabelPreprod: {
id: 'voting.governance.drepInputLabelPreprod',
defaultMessage: '!!!Please type or paste a valid DRep ID (CIP-105) here.',
defaultMessage: '!!!Please type or paste a valid DRep ID here.',
description: 'Label for DRep input on the governance page for preprod',
},
drepInputLabelLinkText: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ type StateConfirmation = Omit<FormData, 'fee'> & {

type State = Form | FormWithError | StateFormComplete | StateConfirmation;

// TODO discuss if we need to restrict the length
const isDrepIdValid = (drepId: string) => {
const isDRepId = (value: string): value is Cardano.DRepID =>
Cardano.DRepID.isValid(value);
return isDRepId(drepId) && Cardano.DRepID.toCip105DRepID(drepId) === drepId;
};

const mapOfTxErrorCodeToIntl: Record<
InitializeVPDelegationTxError,
typeof messages[keyof typeof messages]
Expand Down Expand Up @@ -110,7 +103,7 @@ function VotingPowerDelegation({
}: Props) {
const [state, setState] = useState<State>(initialState);

const drepInputIsValid = isDrepIdValid(state.drepInputState.value);
const drepInputIsValid = Cardano.DRepID.isValid(state.drepInputState.value);

const formIsValid =
!!state.selectedWallet &&
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/app/i18n/locales/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4407,12 +4407,12 @@
{
"descriptors": [
{
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
"defaultMessage": "!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
"description": "Label for DRep input on the governance page",
"id": "voting.governance.drepInputLabel"
},
{
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here.",
"defaultMessage": "!!!Please type or paste a valid DRep ID here.",
"description": "Label for DRep input on the governance page for preprod",
"id": "voting.governance.drepInputLabelPreprod"
},
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,11 @@
"voting.governance.confirmationDialog.vote": "Vote",
"voting.governance.delegateToDRep": "Delegate to DRep (default)",
"voting.governance.drepInputError": "Invalid DRep ID",
"voting.governance.drepInputLabel": "Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
"voting.governance.drepInputLabel": "Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
"voting.governance.drepInputLabelLinkText": "DRep directory",
"voting.governance.drepInputLabelLinkUrl": "https://gov.tools/drep_directory",
"voting.governance.drepInputLabelLinkUrlPreview": "https://preview.gov.tools/drep_directory",
"voting.governance.drepInputLabelPreprod": "Please type or paste a valid DRep ID (CIP-105) here.",
"voting.governance.drepInputLabelPreprod": "Please type or paste a valid DRep ID here.",
"voting.governance.drepInputPlaceholder": "Paste DRep ID here …",
"voting.governance.heading": "CARDANO VOTING POWER DELEGATION",
"voting.governance.initializeTxError.generic": "Something went wrong during transaction initialization. Please try again in a few minutes. ",
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/app/i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,11 @@
"voting.governance.confirmationDialog.vote": "投票",
"voting.governance.delegateToDRep": "DRepに委任(初期設定)",
"voting.governance.drepInputError": "無効なDRep IDです",
"voting.governance.drepInputLabel": "有効なDRep ID (CIP-105)を入力するか貼り付けます。{drepDirectoryLink}で検索する",
"voting.governance.drepInputLabel": "有効なDRep ID を入力するか貼り付けます。{drepDirectoryLink}で検索する",
"voting.governance.drepInputLabelLinkText": "DRepディレクトリ",
"voting.governance.drepInputLabelLinkUrl": "https://gov.tools/drep_directory",
"voting.governance.drepInputLabelLinkUrlPreview": "https://preview.gov.tools/drep_directory",
"voting.governance.drepInputLabelPreprod": "有効なDRep ID (CIP-105)を入力するか貼り付けます。",
"voting.governance.drepInputLabelPreprod": "有効なDRep ID を入力するか貼り付けます。",
"voting.governance.drepInputPlaceholder": "DRep IDを追加してください",
"voting.governance.heading": "Cardano投票権の委任",
"voting.governance.initializeTxError.generic": "トランザクションの初期化中に問題が発生しました。しばらくしてからもう一度お試しください。",
Expand Down
4 changes: 2 additions & 2 deletions translations/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4407,12 +4407,12 @@
{
"descriptors": [
{
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here. Look up {drepDirectoryLink}",
"defaultMessage": "!!!Please type or paste a valid DRep ID here. Look up {drepDirectoryLink}",
"description": "Label for DRep input on the governance page",
"id": "voting.governance.drepInputLabel"
},
{
"defaultMessage": "!!!Please type or paste a valid DRep ID (CIP-105) here.",
"defaultMessage": "!!!Please type or paste a valid DRep ID here.",
"description": "Label for DRep input on the governance page for preprod",
"id": "voting.governance.drepInputLabelPreprod"
},
Expand Down

0 comments on commit d9a45a0

Please sign in to comment.