Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ad04d61
tests: add invalid metadata error behavior tests
kneerose Mar 6, 2025
1b1f195
tests: add tests for invalid live voting metadata error behaviour
kneerose Mar 6, 2025
d0da5f5
fix: check locator visibility before filter validate
kneerose Mar 7, 2025
bb9c693
chore: add new condition on invalid metadata
kneerose Mar 7, 2025
cd544a2
test: increase timeout for visibility checks in DRep tests
kneerose Mar 7, 2025
34f7c14
chore: check share button visibility before clicking
kneerose Mar 7, 2025
036e473
fix: check visibility of 'show all' button before clicking
kneerose Mar 7, 2025
4aed3db
chore: update outcome filter order
kneerose Mar 7, 2025
b9c7ead
feat(#3155): add integration and support of drep handles within drep …
MSzalowski Mar 10, 2025
9133aa2
feat(#3155): add ada handles to drep search phrase processor
MSzalowski Mar 10, 2025
86eb011
fix: tsc and lint errors
MSzalowski Mar 10, 2025
fc99d80
Merge pull request #3168 from IntersectMBO/feat/3155-integration-and-…
MSzalowski Mar 10, 2025
349220e
Merge pull request #3164 from IntersectMBO/fix/locator-visibility-on-…
kneerose Mar 10, 2025
eac6b50
fix: network issues with drep images and adahandle
MSzalowski Mar 10, 2025
cf25453
Merge pull request #3171 from IntersectMBO/fix/fix-network-issues-wit…
MSzalowski Mar 10, 2025
3ca7470
feat(#3148): improve numerical data formatting in drep directory
MSzalowski Mar 10, 2025
376c95e
Merge pull request #3152 from IntersectMBO/tests/invalid-metadata
mesudip Mar 11, 2025
a2bffb8
Merge pull request #3172 from IntersectMBO/feat/3148-improve-numerica…
MSzalowski Mar 11, 2025
667b29b
Merge pull request #3169 from IntersectMBO/develop
MSzalowski Mar 11, 2025
08ecfc3
chore: update GovTool to v2.0.15
github-actions[bot] Mar 11, 2025
f678a0e
Merge pull request #3174 from IntersectMBO/chore/update-govtool-to-v2…
MSzalowski Mar 11, 2025
d6ccd39
Merge pull request #3175 from IntersectMBO/develop
MSzalowski Mar 11, 2025
9a63f64
Merge pull request #3176 from IntersectMBO/test
MSzalowski Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ changes.

### Removed

## [v2.0.15](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.15) 2025-03-11


### Added

- Add support for ada handle in drep payment address [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155)
- Improve numerical data formatting in drep directory [Issue 3148](https://github.com/IntersectMBO/govtool/issues/3148)

### Fixed

### Changed

### Removed

## [v2.0.14](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.14) 2025-03-06

### Added
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.14/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.15/x/vva-be/build/vva-be/vva-be /usr/local/bin
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.14/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.15/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
version: 2.0.14
version: 2.0.15

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
55 changes: 29 additions & 26 deletions govtool/frontend/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ModalProvider } from "../src/context/modal";
import { CardanoProvider } from "../src/context/wallet";
import i18n from "../src/i18n";
import { theme } from "../src/theme";
import { AdaHandleProvider } from "../src/context/adaHandle";

const queryClient = new QueryClient();

Expand All @@ -29,32 +30,34 @@ const preview: Preview = {
<QueryClientProvider client={queryClient}>
<AppContextProvider>
<FeatureFlagProvider>
<ThemeProvider theme={theme}>
<CardanoProvider>
<ModalProvider>
<I18nextProvider i18n={i18n}>
<MemoryRouter>
<Routes>
<Route
path="/*"
element={
<div
style={{
margin: "0px",
padding: "0px",
position: "relative",
}}
>
<Story />
</div>
}
/>
</Routes>
</MemoryRouter>
</I18nextProvider>
</ModalProvider>
</CardanoProvider>
</ThemeProvider>
<AdaHandleProvider>
<ThemeProvider theme={theme}>
<CardanoProvider>
<ModalProvider>
<I18nextProvider i18n={i18n}>
<MemoryRouter>
<Routes>
<Route
path="/*"
element={
<div
style={{
margin: "0px",
padding: "0px",
position: "relative",
}}
>
<Story />
</div>
}
/>
</Routes>
</MemoryRouter>
</I18nextProvider>
</ModalProvider>
</CardanoProvider>
</ThemeProvider>
</AdaHandleProvider>
</FeatureFlagProvider>
</AppContextProvider>
</QueryClientProvider>
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
"version": "2.0.14",
"version": "2.0.15",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ICONS } from "@consts";
import { PendingTransaction } from "@context";
import { useGetNetworkMetrics, useTranslation } from "@hooks";
import { AutomatedVotingCard } from "@molecules";
import { correctVoteAdaFormat, openInNewTab } from "@/utils";
import { correctDRepDirectoryFormat, openInNewTab } from "@/utils";
import {
AutomatedVotingOptionCurrentDelegation,
AutomatedVotingOptionDelegationId,
Expand Down Expand Up @@ -129,7 +129,9 @@ export const AutomatedVotingOptions = ({
}
votingPower={
networkMetrics
? correctVoteAdaFormat(networkMetrics?.alwaysAbstainVotingPower)
? correctDRepDirectoryFormat(
networkMetrics?.alwaysAbstainVotingPower,
)
: ""
}
transactionId={
Expand Down Expand Up @@ -170,7 +172,7 @@ export const AutomatedVotingOptions = ({
}
votingPower={
networkMetrics
? correctVoteAdaFormat(
? correctDRepDirectoryFormat(
networkMetrics?.alwaysNoConfidenceVotingPower,
)
: ""
Expand Down
21 changes: 17 additions & 4 deletions govtool/frontend/src/components/organisms/DRepCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useTranslation } from "@hooks";
import { DRepData, DRepStatus } from "@models";
import { Card } from "@molecules";
import {
correctVoteAdaFormat,
correctDRepDirectoryFormat,
ellipsizeText,
encodeCIP129Identifier,
getBase64ImageDetails,
Expand Down Expand Up @@ -218,8 +218,21 @@ export const DRepCard = ({
</Box>
</Box>

<Box sx={{ display: "flex", flex: { xl: 1 }, gap: 3 }}>
<Box sx={{ width: { lg: "128px" } }}>
<Box
sx={{
display: "flex",
flex: { xl: 1 },
gap: 3,
}}
>
<Box
sx={{
width: { lg: "128px" },
display: "flex",
alignItems: "flex-end",
flexDirection: "column",
}}
>
<Typography
data-testid={`${view}-voting-power-label`}
variant="caption"
Expand All @@ -232,7 +245,7 @@ export const DRepCard = ({
data-testid={`${view}-voting-power`}
sx={{ whiteSpace: "nowrap" }}
>
₳ {correctVoteAdaFormat(votingPower)}
₳ {correctDRepDirectoryFormat(votingPower)}
</Typography>
</Box>
<Divider
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useCardano, useModal } from "@context";
import { useDelegateTodRep, useScreenDimension, useTranslation } from "@hooks";
import { Card, DataMissingInfoBox } from "@molecules";
import {
correctVoteAdaFormat,
correctDRepDirectoryFormat,
encodeCIP129Identifier,
testIdFromLabel,
} from "@utils";
Expand Down Expand Up @@ -146,7 +146,7 @@ export const DRepDetailsCard = ({
sx={{ display: "flex", flexDirection: "row", mt: 0.5 }}
>
{"₳ "}
{correctVoteAdaFormat(votingPower)}
{correctDRepDirectoryFormat(votingPower)}
</Typography>
</DRepDetailsInfoItem>
</Box>
Expand Down
49 changes: 49 additions & 0 deletions govtool/frontend/src/context/adaHandle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { createContext, useContext, PropsWithChildren, useMemo } from "react";
import { HandleObject } from "@/models/adaHandle";
import { adaHandleService } from "@/services/AdaHandle";

type AdaHandleContextType = {
isValidAdaHandle: (handle: string) => Promise<boolean>;
getAdaHandleCIP105DRepId: (handle: string) => Promise<string>;
getAdaHandleCIP129DRepId: (handle: string) => Promise<string>;
getHandleDetails: (handle: string) => Promise<HandleObject | null>;
};

const AdaHandleContext = createContext<AdaHandleContextType | null>(null);

/**
* Provides the AdaHandle context to its children components.
*/
export const AdaHandleProvider = ({ children }: PropsWithChildren) => {
const value = useMemo<AdaHandleContextType>(
() => ({
isValidAdaHandle: adaHandleService.isValidAdaHandle,
getAdaHandleCIP105DRepId: adaHandleService.getAdaHandleCIP105DRepId,
getAdaHandleCIP129DRepId: adaHandleService.getAdaHandleCIP129DRepId,
getHandleDetails: adaHandleService.getHandleDetails,
}),
[adaHandleService],
);

return (
<AdaHandleContext.Provider value={value}>
{children}
</AdaHandleContext.Provider>
);
};

/**
* Custom hook that provides access to the AdaHandle context.
* Throws an error if used outside of an AdaHandleProvider.
*/
export const useAdaHandleContext = () => {
const context = useContext(AdaHandleContext);

if (!context) {
throw new Error(
"useAdaHandleContext must be used within an AdaHandleProvider",
);
}

return context;
};
10 changes: 7 additions & 3 deletions govtool/frontend/src/context/appContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
PROTOCOL_PARAMS_KEY,
setItemToLocalStorage,
} from "@/utils";
import { EpochParams, NetworkMetrics } from "@/models";
import { EpochParams, NetworkMetrics, Network } from "@/models";
import { adaHandleService } from "@/services/AdaHandle";

const BOOTSTRAPPING_PHASE_MAJOR = 9;

Expand All @@ -25,7 +26,7 @@ type AppContextType = {
isInBootstrapPhase: boolean;
isFullGovernance: boolean;
networkName: string;
network: string;
network: Network;
cExplorerBaseUrl: string;
epochParams?: EpochParams;
networkMetrics?: NetworkMetrics;
Expand Down Expand Up @@ -58,6 +59,9 @@ const AppContextProvider = ({ children }: PropsWithChildren) => {
const { data: networkMetricsData } = await fetchNetworkMetrics();
if (networkMetricsData) {
setItemToLocalStorage(NETWORK_METRICS_KEY, networkMetricsData);

// Initialize ada handle service
adaHandleService.initialize(networkMetricsData.networkName);
}

setIsAppInitializing(false);
Expand All @@ -81,7 +85,7 @@ const AppContextProvider = ({ children }: PropsWithChildren) => {
(networkMetrics?.networkName as keyof typeof NETWORK_NAMES) ||
"preview"
],
network: networkMetrics?.networkName || "preview",
network: networkMetrics?.networkName ?? Network.preview,
cExplorerBaseUrl:
CEXPLORER_BASE_URLS[
(networkMetrics?.networkName as keyof typeof NETWORK_NAMES) ||
Expand Down
17 changes: 10 additions & 7 deletions govtool/frontend/src/context/contextProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SnackbarProvider, useSnackbar } from "./snackbar";
import { DataActionsBarProvider } from "./dataActionsBar";
import { FeatureFlagProvider } from "./featureFlag";
import { GovernanceActionProvider } from "./governanceAction";
import { AdaHandleProvider } from "./adaHandle";

interface Props {
children: React.ReactNode;
Expand All @@ -14,13 +15,15 @@ const ContextProviders = ({ children }: Props) => (
<AppContextProvider>
<GovernanceActionProvider>
<FeatureFlagProvider>
<ModalProvider>
<SnackbarProvider>
<DataActionsBarProvider>
<CardanoProvider>{children}</CardanoProvider>
</DataActionsBarProvider>
</SnackbarProvider>
</ModalProvider>
<AdaHandleProvider>
<ModalProvider>
<SnackbarProvider>
<DataActionsBarProvider>
<CardanoProvider>{children}</CardanoProvider>
</DataActionsBarProvider>
</SnackbarProvider>
</ModalProvider>
</AdaHandleProvider>
</FeatureFlagProvider>
</GovernanceActionProvider>
</AppContextProvider>
Expand Down
3 changes: 2 additions & 1 deletion govtool/frontend/src/context/featureFlag.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { renderHook } from "@testing-library/react";
import { FeatureFlagProvider, useFeatureFlag } from "./featureFlag";
import { GovernanceActionType } from "@/types/governanceAction";
import { useAppContext } from "./appContext";
import { Network } from "@/models";

vi.mock("./appContext");

Expand All @@ -13,7 +14,7 @@ const mockUseAppContextReturnValue = {
isAppInitializing: false,
isInBootstrapPhase: false,
isFullGovernance: true,
network: "preview",
network: Network.preview,
networkName: "preview",
isMainnet: false,
};
Expand Down
Loading