-
Notifications
You must be signed in to change notification settings - Fork 103
Governance - delegate to Drep #4443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...oroi-extension/app/UI/features/governace/useCases/GovernanceStatusRevamp/DrepOptionsCard.tsx
Outdated
Show resolved
Hide resolved
packages/yoroi-extension/app/UI/features/governace/common/hooks/useGovernanceStatusState.tsx
Show resolved
Hide resolved
...es/yoroi-extension/app/UI/features/governace/useCases/GovernanceStatusRevamp/DRepOptions.tsx
Outdated
Show resolved
Hide resolved
SorinC6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/check
...roi-extension/app/UI/features/transaction-review/useCases/ChooseDrepId/ChooseOtherDrepId.tsx
Show resolved
Hide resolved
...tension/app/UI/features/governace/useCases/GovernanceStatusRevamp/GovernanceStatusRevamp.tsx
Outdated
Show resolved
Hide resolved
...ion/app/UI/features/governace/useCases/GovernanceStatusRevamp/GovernanceStatusRevampCard.tsx
Outdated
Show resolved
Hide resolved
SorinC6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/check
SorinC6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/check
...ion/app/UI/features/governace/useCases/GovernanceStatusRevamp/GovernanceStatusRevampCard.tsx
Outdated
Show resolved
Hide resolved
SorinC6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/check
...ion/app/UI/features/governace/useCases/GovernanceStatusRevamp/GovernanceStatusRevampCard.tsx
Outdated
Show resolved
Hide resolved
| const isDelegatingToYoroiDrep = isDelegated && drepID === YOROI_DREP_ID; | ||
| const isDelegationToOtherDrep = isDelegated && drepID !== YOROI_DREP_ID; | ||
| const isAbstain = drepID === null || governanceStatus.status === DREP_ALWAYS_ABSTAIN; | ||
| const isNoConfidence = drepID === null || governanceStatus.status === DREP_ALWAYS_NO_CONFIDENCE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Null check on variable that can never be null
The isAbstain and isNoConfidence flags use drepID === null in their conditions. However, drepID is always assigned a value (falling back to YOROI_DREP_ID), so it can never be null. This prevents correctly identifying "Abstain" or "No Confidence" delegations when the DRep ID is truly null.
Note
Introduces a full governance delegation flow (Yoroi/other DReps, abstain/no-confidence) with a revamped UI and integrated transaction review, plus supporting hooks, context, and i18n updates.
GovernanceStatusRevamp,DRepOptions,DrepOptionsCard, andNotAllowedInGovernance.ChooseOtherDrepIdflow and integrates it intoReviewTxManager(modalView: 'chooseOtherDrepId').useGovernanceDelegationToYoroiDrep: creates/signs delegation txs, opens review modal, handles errors (e.g., insufficient funds).useGovernanceStatusState: maps backend status toGOVERNANCE_STATUSand detects pending delegation txs.useIsGovernanceAllowed: checks ADA balance/participation and testnet.GovernanceContextProvider: exposesisTestnet; fetches and normalizes on-chain governance status.constants.ts: addsFIND_DREPS_LINK(_TESTNET),GOVERNANCE_STATUSenum.en-US.jsonaccordingly.YoroiLogoaccepts dynamicwidth/height.truncateFormatterhelper (TS) and export in JS formatters; used in cards.useStringsimport paths undercommon/hooks.Written by Cursor Bugbot for commit eb147c5. This will update automatically on new commits. Configure here.