Skip to content
Merged

v2.0.35 #4052

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
52f6b46
chore: add test ids for updated vote rationale components
JosephRana11 Aug 1, 2025
163ec86
fix: update include metadata anchor in vote transaction test
JosephRana11 Aug 1, 2025
ba53a98
feat: add test for ipfs vote context
JosephRana11 Aug 11, 2025
177106d
chore: increase wallet generation count
JosephRana11 Aug 11, 2025
e2d8e4b
chore: remove logs
JosephRana11 Aug 12, 2025
8b5e284
fix: add proper proposal load page await
JosephRana11 Aug 12, 2025
c770507
fix: update outdated vote context related tests
JosephRana11 Aug 12, 2025
a38ed7f
Merge pull request #4031 : Vote Anchor Related Voting Tests.
mesudip Aug 14, 2025
5518211
fix undefined data test id issue for image input
JosephRana11 Aug 15, 2025
eab2adb
fix:update image input related data test id and display message
JosephRana11 Aug 15, 2025
931c12e
fix: replace show all btn with link in governance actions page
JosephRana11 Aug 15, 2025
8b3fdaa
chore: move voting tests to proposal functionality
JosephRana11 Aug 15, 2025
42ecf9e
add include metadata anchor in vote transaction test
JosephRana11 Aug 15, 2025
8b03f18
fix: handle outcomeResponse as single object instead of array
JosephRana11 Aug 22, 2025
b8b845c
chore: remove duplicate test
JosephRana11 Aug 22, 2025
e438448
fix: udpate gov action api call regex
JosephRana11 Aug 25, 2025
2ae6c66
fix gov action network interception response
JosephRana11 Aug 25, 2025
1b47916
DRep search improvements #4030
Aug 26, 2025
bcf9ac1
Merge pull request #4040 from IntersectMBO/issue-4030
bosko-m Aug 26, 2025
3b52ae1
chore: increase wallet generation count
JosephRana11 Aug 27, 2025
fd84704
refactor: move voting related tests to perform voting group
JosephRana11 Aug 27, 2025
0cca71c
More DRep search improvements #4030
Aug 27, 2025
9908426
Merge pull request #4043 from IntersectMBO/issue-4030
bosko-m Aug 27, 2025
d6e9507
Merge pull request #4035 from JosephRana11/integration-test-fixes
mesudip Aug 28, 2025
3ae9dab
chore: update @intersect.mbo/govtool-outcomes-pillar-ui to v1.5.7
github-actions[bot] Aug 28, 2025
2455c3d
Merge pull request #4044 from IntersectMBO/chore/@intersect.mbo/govto…
bosko-m Aug 28, 2025
3fddbc6
Even more DRep search improvements #4030
Aug 28, 2025
012046b
Merge pull request #4046 from IntersectMBO/issue-4030
bosko-m Aug 28, 2025
b16d941
Merge pull request #4045 from IntersectMBO/develop
bosko-m Aug 28, 2025
de2e9f0
Merge pull request #4050 from IntersectMBO/test
bosko-m Sep 2, 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
3 changes: 2 additions & 1 deletion govtool/backend/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ startApp vvaConfig sentryService = do
$ setOnException (exceptionHandler vvaConfig sentryService) defaultSettings
cacheEnv <- do
let newCache = Cache.newCache (Just $ TimeSpec (fromIntegral (cacheDurationSeconds vvaConfig)) 0)
let newDRepListCache = Cache.newCache (Just $ TimeSpec (fromIntegral (dRepListCacheDurationSeconds vvaConfig)) 0)
proposalListCache <- newCache
getProposalCache <- newCache
currentEpochCache <- newCache
Expand All @@ -123,7 +124,7 @@ startApp vvaConfig sentryService = do
dRepGetVotesCache <- newCache
dRepInfoCache <- newCache
dRepVotingPowerCache <- newCache
dRepListCache <- newCache
dRepListCache <- newDRepListCache
networkMetricsCache <- newCache
networkInfoCache <- newCache
networkTotalStakeCache <- newCache
Expand Down
1 change: 1 addition & 0 deletions govtool/backend/example-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"port" : 9999,
"host" : "localhost",
"cachedurationseconds": 20,
"dreplistcachedurationseconds": 600,
"sentrydsn": "https://username:password@senty.host/id",
"sentryenv": "dev"
}
21 changes: 15 additions & 6 deletions govtool/backend/sql/list-dreps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ LatestVoteEpoch AS (
JOIN tx ON tx.id = lvp.tx_id
JOIN block ON block.id = tx.block_id
),
VotesLastYear AS (
SELECT
vp.drep_voter AS drep_id,
COUNT(DISTINCT vp.gov_action_proposal_id) AS votes_last_year
FROM voting_procedure vp
JOIN tx ON tx.id = vp.tx_id
JOIN block ON block.id = tx.block_id
WHERE block.time >= now() - INTERVAL '1 year'
GROUP BY vp.drep_voter
),
RankedDRepRegistration AS (
SELECT DISTINCT ON (dr.drep_hash_id)
dr.id,
Expand Down Expand Up @@ -127,6 +137,7 @@ DRepData AS (
off_chain_vote_drep_data.qualifications,
off_chain_vote_drep_data.image_url,
off_chain_vote_drep_data.image_hash,
COALESCE(vly.votes_last_year, 0) AS votes_last_year,
COALESCE(
(
SELECT jsonb_agg(
Expand Down Expand Up @@ -239,6 +250,7 @@ DRepData AS (
LEFT JOIN tx AS tx_first_register ON tx_first_register.id = dr_first_register.tx_id
LEFT JOIN block AS block_first_register ON block_first_register.id = tx_first_register.block_id
LEFT JOIN LatestVoteEpoch lve ON lve.drep_id = dh.id
LEFT JOIN VotesLastYear vly ON vly.drep_id = dh.id
CROSS JOIN DRepActivity
GROUP BY
dh.raw,
Expand All @@ -265,6 +277,7 @@ DRepData AS (
off_chain_vote_drep_data.qualifications,
off_chain_vote_drep_data.image_url,
off_chain_vote_drep_data.image_hash,
vly.votes_last_year,
(
SELECT jsonb_agg(
jsonb_build_object(
Expand Down Expand Up @@ -317,10 +330,6 @@ WHERE
(
COALESCE(?, '') = '' OR
(CASE WHEN LENGTH(?) % 2 = 0 AND ? ~ '^[0-9a-fA-F]+$' THEN drep_hash = ? ELSE false END) OR
view ILIKE ? OR
given_name ILIKE ? OR
payment_address ILIKE ? OR
objectives ILIKE ? OR
motivations ILIKE ? OR
qualifications ILIKE ?
(CASE WHEN lower(?) ~ '^drep1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]+$' THEN view = lower(?) ELSE FALSE END) OR
given_name ILIKE ?
)
3 changes: 3 additions & 0 deletions govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ drepRegistrationToDrep Types.DRepRegistration {..} =
dRepQualifications = dRepRegistrationQualifications,
dRepImageUrl = dRepRegistrationImageUrl,
dRepImageHash = HexText <$> dRepRegistrationImageHash,
dRepVotesLastYear = dRepRegistrationVotesLastYear,
dRepIdentityReferences = DRepReferences <$> dRepRegistrationIdentityReferences,
dRepLinkReferences = DRepReferences <$> dRepRegistrationLinkReferences
}
Expand Down Expand Up @@ -205,6 +206,8 @@ drepList mSearchQuery statuses mSortMode mPage mPageSize = do
Just Random -> fmap snd . sortOn fst . Prelude.zip randomizedOrderList
Just VotingPower -> sortOn $ \Types.DRepRegistration {..} ->
Down dRepRegistrationVotingPower
Just Activity -> sortOn $ \Types.DRepRegistration {..} ->
Down dRepRegistrationVotesLastYear
Just RegistrationDate -> sortOn $ \Types.DRepRegistration {..} ->
Down dRepRegistrationLatestRegistrationDate
Just Status -> sortOn $ \Types.DRepRegistration {..} ->
Expand Down
4 changes: 3 additions & 1 deletion govtool/backend/src/VVA/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ instance ToParamSchema GovernanceActionType where
& enum_ ?~ map toJSON (enumFromTo minBound maxBound :: [GovernanceActionType])


data DRepSortMode = Random | VotingPower | RegistrationDate | Status deriving
data DRepSortMode = Random | VotingPower | Activity | RegistrationDate | Status deriving
( Bounded
, Enum
, Eq
Expand Down Expand Up @@ -917,6 +917,7 @@ data DRep
, dRepQualifications :: Maybe Text
, dRepImageUrl :: Maybe Text
, dRepImageHash :: Maybe HexText
, dRepVotesLastYear :: Maybe Integer
, dRepIdentityReferences :: Maybe DRepReferences
, dRepLinkReferences :: Maybe DRepReferences
}
Expand Down Expand Up @@ -944,6 +945,7 @@ exampleDrep =
<> "\"qualifications\": \"Some Qualifications\","
<> "\"qualifications\": \"Some Qualifications\","
<> "\"imageUrl\": \"https://image.url\","
<> "\"votesLastYear\": 15,"
<> "\"imageHash\": \"9198b1b204273ba5c67a13310b5a806034160f6a063768297e161d9b759cad61\"}"

-- ToSchema instance for DRep
Expand Down
34 changes: 20 additions & 14 deletions govtool/backend/src/VVA/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,21 @@ instance DefaultConfig DBConfig where
data VVAConfigInternal
= VVAConfigInternal
{ -- | db-sync database access.
vVAConfigInternalDbsyncconfig :: DBConfig
vVAConfigInternalDbsyncconfig :: DBConfig
-- | Server port.
, vVAConfigInternalPort :: Int
, vVAConfigInternalPort :: Int
-- | Server host.
, vVAConfigInternalHost :: Text
, vVAConfigInternalHost :: Text
-- | Request cache duration
, vVaConfigInternalCacheDurationSeconds :: Int
, vVaConfigInternalCacheDurationSeconds :: Int
-- | DRep List request cache duration
, vVaConfigInternalDRepListCacheDurationSeconds :: Int
-- | Sentry DSN
, vVAConfigInternalSentrydsn :: String
, vVAConfigInternalSentrydsn :: String
-- | Sentry environment
, vVAConfigInternalSentryEnv :: String
, vVAConfigInternalSentryEnv :: String
-- | Pinata API JWT
, vVAConfigInternalPinataApiJwt :: Maybe Text
, vVAConfigInternalPinataApiJwt :: Maybe Text
}
deriving (FromConfig, Generic, Show)

Expand All @@ -92,6 +94,7 @@ instance DefaultConfig VVAConfigInternal where
vVAConfigInternalPort = 3000,
vVAConfigInternalHost = "localhost",
vVaConfigInternalCacheDurationSeconds = 20,
vVaConfigInternalDRepListCacheDurationSeconds = 600,
vVAConfigInternalSentrydsn = "https://username:password@senty.host/id",
vVAConfigInternalSentryEnv = "development",
vVAConfigInternalPinataApiJwt = Nothing
Expand All @@ -101,19 +104,21 @@ instance DefaultConfig VVAConfigInternal where
data VVAConfig
= VVAConfig
{ -- | db-sync database credentials.
dbSyncConnectionString :: Text
dbSyncConnectionString :: Text
-- | Server port.
, serverPort :: Int
, serverPort :: Int
-- | Server host.
, serverHost :: Text
, serverHost :: Text
-- | Request cache duration
, cacheDurationSeconds :: Int
, cacheDurationSeconds :: Int
-- | DRep List request cache duration
, dRepListCacheDurationSeconds :: Int
-- | Sentry DSN
, sentryDSN :: String
, sentryDSN :: String
-- | Sentry environment
, sentryEnv :: String
, sentryEnv :: String
-- | Pinata API JWT
, pinataApiJwt :: Maybe Text
, pinataApiJwt :: Maybe Text
}
deriving (Generic, Show, ToJSON)

Expand Down Expand Up @@ -153,6 +158,7 @@ convertConfig VVAConfigInternal {..} =
serverPort = vVAConfigInternalPort,
serverHost = vVAConfigInternalHost,
cacheDurationSeconds = vVaConfigInternalCacheDurationSeconds,
dRepListCacheDurationSeconds = vVaConfigInternalDRepListCacheDurationSeconds,
sentryDSN = vVAConfigInternalSentrydsn,
sentryEnv = vVAConfigInternalSentryEnv,
pinataApiJwt = vVAConfigInternalPinataApiJwt
Expand Down
11 changes: 5 additions & 6 deletions govtool/backend/src/VVA/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ data DRepQueryResult
, queryQualifications :: Maybe Text
, queryImageUrl :: Maybe Text
, queryImageHash :: Maybe Text
, queryVotesLastYear :: Maybe Integer
, queryIdentityReferences :: Maybe Value
, queryLinkReferences :: Maybe Value
}
Expand All @@ -69,7 +70,7 @@ instance FromRow DRepQueryResult where
<$> field <*> field <*> field <*> field <*> field <*> field
<*> field <*> field <*> field <*> field <*> field <*> field
<*> field <*> field <*> field <*> field <*> field <*> field
<*> field <*> field <*> field <*> field
<*> field <*> field <*> field <*> field <*> field

sqlFrom :: ByteString -> SQL.Query
sqlFrom bs = fromString $ unpack $ Text.decodeUtf8 bs
Expand All @@ -86,12 +87,9 @@ listDReps mSearchQuery = withPool $ \conn -> do
, searchParam -- LENGTH(?)
, searchParam -- AND ?
, searchParam -- decode(?, 'hex')
, "%" <> searchParam <> "%" -- dh.view
, searchParam -- lower(?)
, searchParam -- lower(?)
, "%" <> searchParam <> "%" -- given_name
, "%" <> searchParam <> "%" -- payment_address
, "%" <> searchParam <> "%" -- objectives
, "%" <> searchParam <> "%" -- motivations
, "%" <> searchParam <> "%" -- qualifications
) :: IO [DRepQueryResult])

timeZone <- liftIO getCurrentTimeZone
Expand All @@ -116,6 +114,7 @@ listDReps mSearchQuery = withPool $ \conn -> do
(queryQualifications result)
(queryImageUrl result)
(queryImageHash result)
(queryVotesLastYear result)
(queryIdentityReferences result)
(queryLinkReferences result)
| result <- results
Expand Down
2 changes: 2 additions & 0 deletions govtool/backend/src/VVA/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ data DRepRegistration
, dRepRegistrationQualifications :: Maybe Text
, dRepRegistrationImageUrl :: Maybe Text
, dRepRegistrationImageHash :: Maybe Text
, dRepRegistrationVotesLastYear :: Maybe Integer
, dRepRegistrationIdentityReferences :: Maybe Value
, dRepRegistrationLinkReferences :: Maybe Value
}
Expand Down Expand Up @@ -187,6 +188,7 @@ instance FromRow DRepRegistration where
<*> field -- dRepRegistrationQualifications
<*> field -- dRepRegistrationImageUrl
<*> field -- dRepRegistrationImageHash
<*> field -- dRepRegistrationVotesLastYear
<*> field -- dRepRegistrationIdentityReferences
<*> field -- dRepRegistrationLinkReferences

Expand Down
8 changes: 4 additions & 4 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
Expand Up @@ -27,7 +27,7 @@
"@emotion/styled": "^11.11.0",
"@emurgo/cardano-serialization-lib-asmjs": "^14.1.1",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.6",
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.7",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "1.0.13-beta",
"@mui/icons-material": "^5.14.3",
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/components/molecules/DRepDataForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const DRepDataForm = ({ control, errors, register, watch }: Props) => {
subtitle={t("forms.dRepData.imageHelpfulText")}
/>
<UncontrolledImageInput
data-testid="image-input"
dataTestId="image-input"
control={control}
name="image"
rules={Rules.IMAGE_URL}
Expand Down
18 changes: 16 additions & 2 deletions govtool/frontend/src/components/molecules/DataActionsBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Dispatch, FC, SetStateAction } from "react";
import { Box, InputBase } from "@mui/material";
import { Box, InputBase, IconButton } from "@mui/material";
import Search from "@mui/icons-material/Search";
import CloseIcon from "@mui/icons-material/Close";

import { DataActionsFilters, DataActionsSorting } from "@molecules";
import { OrderActionsChip } from "./OrderActionsChip";
Expand All @@ -20,6 +21,7 @@ type DataActionsBarProps = {
filtersTitle?: string;
isFiltering?: boolean;
searchText: string;
placeholder?: string;
setChosenFilters?: Dispatch<SetStateAction<string[]>>;
setChosenSorting: Dispatch<SetStateAction<string>>;
setFiltersOpen?: Dispatch<SetStateAction<boolean>>;
Expand Down Expand Up @@ -51,6 +53,7 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
setSortOpen,
sortOpen,
sortOptions = [],
placeholder = "Search...",
} = props;
const {
palette: { boxShadow2 },
Expand All @@ -61,7 +64,7 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
<InputBase
inputProps={{ "data-testid": "search-input" }}
onChange={(e) => setSearchText(e.target.value)}
placeholder="Search..."
placeholder={placeholder}
value={searchText}
startAdornment={
<Search
Expand All @@ -73,6 +76,17 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
}}
/>
}
endAdornment={
searchText && (
<IconButton
size="small"
onClick={() => setSearchText("")}
sx={{ ml: 1 }}
>
<CloseIcon fontSize="small" />
</IconButton>
)
}
sx={{
bgcolor: "white",
border: 1,
Expand Down
Loading
Loading