Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/IntersectMBO/govtool int…
Browse files Browse the repository at this point in the history
…o fix/272-display-plain-json-as-descriptions-in-governance-actions
  • Loading branch information
Sworzen1 committed Feb 22, 2024
2 parents a12b620 + f64673c commit 3387b2b
Show file tree
Hide file tree
Showing 18 changed files with 1,637 additions and 620 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ jobs:
curl -X POST -u "admin:$GRAFANA_ADMIN_PASSWORD" https://$DOMAIN/grafana/api/admin/provisioning/dashboards/reload
curl -X POST -u "admin:$GRAFANA_ADMIN_PASSWORD" https://$DOMAIN/grafana/api/admin/provisioning/notifications/reload
- name: Notify on Slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_NOTIFY_SLACK_WEBHOOK_URL }}
run: |
if [[ "${{ inputs.environment }}" == "staging" ]]; then export DOMAIN=staging.govtool.byron.network; fi;
if [[ "${{ inputs.environment }}" == "beta" ]]; then export DOMAIN=sanchogov.tools; fi;
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@ infra/terraform/.terraform*
# local env files
.env
.envrc

# local docker-compose files
scripts/govtool/dev-postgres_db
scripts/govtool/dev-postgres_user
scripts/govtool/dev-postgres_password
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@ changes.

### Fixed
- Fix GA details [Issue 272](https://github.com/IntersectMBO/govtool/issues/272)
- Fix drep voting power calculation [Issue 231](https://github.com/IntersectMBO/govtool/issues/231)
- Fix proposal/list and network/metrics bug that appeared when noone has delegated their funds either to drep_always_abstain or drep_always_no_confidence [Issue 231](https://github.com/IntersectMBO/govtool/issues/231)
- Fix copy for maintenance page [Issue 180](https://github.com/IntersectMBO/govtool/issues/180)
- Fix misleading metadata hash text [Issue 90](https://github.com/IntersectMBO/govtool/issues/90)
- Fixed vote calculation problems related to NoConfidence DRep [Issue 59](https://github.com/IntersectMBO/govtool/issues/59)
- Fixed ada-holder/get-current-delegation error when delegated to NoConfidence or AlwaysAbstain dreps. [Issue 82](https://github.com/IntersectMBO/govtool/issues/82)
- Fixed deployment scripts to address [Issue 171](https://github.com/IntersectMBO/govtool/issues/171).

### Changed
- Update Cardano-Serialization-Lib to 12.0.0-alpha.16 [Issue 156](https://github.com/IntersectMBO/govtool/issues/156)
- Changed and improved working conventions docs, PR template and codeowners file, addressing [Issue 88](https://github.com/IntersectMBO/govtool/issues/88).
- Changed Node version from 8.7.1-pre to 8.7.2 and Db-sync version from sancho-2-3-0 to sancho-3-0-0.
- Changed Node version from 8.7.1-pre to 8.8.0-pre and DbSync version from sancho-2-3-0 to sancho-4-0-0-fix-config, addressing also [Issue 181](https://github.com/IntersectMBO/govtool/issues/181).
- Reorganized repository to fit new conventions [Issue 85](https://github.com/IntersectMBO/govtool/issues/85).
- Renamed project from VVA to GovTool [Issue 97](https://github.com/IntersectMBO/govtool/issues/97).
- (`docs/update-working-conventions`) Addressing [Issue 25](https://github.com/IntersectMBO/govtool/issues/25) changed working conventions documentation to improve intended flows.
- Adjusted Nix configuration to meet projects needs [Issue 187](https://github.com/IntersectMBO/govtool/issues/187).

### Removed
-

## [sancho-v1.0.0](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.0) 2023-12-17

- Import code to new repository
- Import code to new repository
14 changes: 9 additions & 5 deletions govtool/backend/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{ pkgs ? (import ./sources.nix).pkgs
, ghcVersion ? "ghc927"
}:
# TODO: Remove the sources file and use the nixpkgs version provided from the
# flakes lock file instead when the flakes feature is present and enabled in the
# root of the project.
{ pkgs ? (import ./sources.nix).pkgs }:
let
additionalTools = drv: pkgs.haskell.lib.addBuildTools drv (with pkgs.haskell.packages."${ghcVersion}";
# This is the version of the Haskell compiler we reccommend using.
ghcPackages = pkgs.haskell.packages.ghc927;

additionalTools = drv: pkgs.haskell.lib.addBuildTools drv (with ghcPackages;
[
cabal-install
haskell-language-server
Expand All @@ -12,7 +16,7 @@ let
zlib
]);

project = pkgs.haskell.packages."${ghcVersion}".developPackage {
project = ghcPackages.developPackage {
root = ./.;
modifier = additionalTools;
overrides = self: super: { openapi3 = pkgs.haskell.lib.dontCheck super.openapi3; };
Expand Down
12 changes: 6 additions & 6 deletions govtool/backend/sql/get-network-metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ with current_epoch as (
select count(*) as count
from drep_hash
), always_abstain_voting_power as (
select amount
from drep_distr
join drep_hash
select coalesce(amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_abstain'
order by epoch_no desc
limit 1
), always_no_confidence_voting_power as (
select amount
from drep_distr
join drep_hash
select coalesce(amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_no_confidence'
order by epoch_no desc
Expand Down
10 changes: 6 additions & 4 deletions govtool/backend/sql/get-voting-power.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
select drep_distr.amount
from drep_distr
join drep_hash
select coalesce(drep_distr.amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.raw = decode(?,'hex')
where drep_hash.raw = decode(?,'hex')
order by epoch_no desc
limit 1
12 changes: 6 additions & 6 deletions govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ WITH LatestDrepDistr AS (
Max(end_time) as last_epoch_end_time
FROM epoch
), always_no_confidence_voting_power as (
select amount
from drep_distr
join drep_hash
select coalesce(amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_no_confidence'
order by epoch_no desc
limit 1
), always_abstain_voting_power as (
select amount
from drep_distr
join drep_hash
select coalesce(amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_abstain'
order by epoch_no desc
Expand Down
8 changes: 3 additions & 5 deletions govtool/backend/src/VVA/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ getVotingPower ::
Text ->
m Integer
getVotingPower drepId = withPool $ \conn -> do
votingPower <-
sum . map (\(SQL.Only x) -> x) <$>
liftIO
(SQL.query @_ @(SQL.Only Scientific) conn getVotingPowerSql $
SQL.Only drepId)
[SQL.Only votingPower] <-
liftIO
(SQL.query @_ @(SQL.Only Scientific) conn getVotingPowerSql $ SQL.Only drepId)
return $ floor votingPower

listDRepsSql :: SQL.Query
Expand Down
184 changes: 184 additions & 0 deletions govtool/frontend/package-lock.json

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

3 changes: 3 additions & 0 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
"vite": "^4.3.9",
"vitest": "^1.1.0"
},
"optionalDependencies": {
"@rollup/rollup-linux-arm64-musl": "4.12.0"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
Expand Down
Loading

0 comments on commit 3387b2b

Please sign in to comment.