Skip to content

Commit

Permalink
Merge pull request #2389 from IntersectMBO/staging
Browse files Browse the repository at this point in the history
GovTool-v1.0.27
  • Loading branch information
MSzalowski authored Nov 19, 2024
2 parents 9c2e740 + 7a90288 commit d18ebab
Show file tree
Hide file tree
Showing 67 changed files with 2,621 additions and 5,742 deletions.
36 changes: 15 additions & 21 deletions .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
name: Add Issue to Projects
name: Add all issues created to projects

on:
issues:
types: [opened]

jobs:
add-to-projects:
add-to-govtool-all-project:
name: Add issue to GovTool all project
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/IntersectMBO/projects/30
github-token: ${{ secrets.ADD_ISSUE_TO_PROJECT_PAT }}

- name: Install GitHub CLI
run: sudo apt-get install gh

- name: Authenticate GitHub CLI with default token
run: gh auth login --with-token <<< "$GITHUB_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add issue to GovTool Project
run: gh project item-add IntersectMBO/30 --content-type Issue --content-id ${{ github.event.issue.node_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add issue to Community Backlog Project
run: gh project item-add IntersectMBO/34 --content-type Issue --content-id ${{ github.event.issue.node_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
add-to-community-backlog-project:
name: Add issue to governance tools community backlog project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/IntersectMBO/projects/34
github-token: ${{ secrets.ADD_ISSUE_TO_PROJECT_PAT }}
2 changes: 2 additions & 0 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }}
PDF_API_URL: ${{ secrets.PDF_API_URL}}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }}
PDF_API_URL: ${{ secrets.PDF_API_URL }}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
PDF_API_URL: ${{ secrets.PDF_API_URL}}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
PDF_API_URL: ${{ secrets.PDF_API_URL}}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
IPFS_PROJECT_ID: ${{ secrets.IPFS_PROJECT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "sanchogov.tools"
- "staging.govtool.byron.network"
- "govtool.cardanoapi.io"
- "preview.gov.tools"

workflow_run:
workflows: ["Build and deploy GovTool to TEST server"]
Expand Down Expand Up @@ -79,6 +80,8 @@ jobs:
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
TEST_WORKERS: ${{vars.TEST_WORKERS}}
CI: ${{vars.CI}}
NETWORK: ${{vars.NETWORK}}
FAUCET_ADDRESS: ${{vars.FAUCET_ADDRESS}}
CARDANOAPI_METADATA_URL: ${{vars.CARDANOAPI_METADATA_URL}}

publish-report:
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,32 @@ changes.

-

## [v1.0.27](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.27) 2024-11-19

### Added

- Handle displaying votes based on bootstrap phase, full governance and security groups [Issue 2316](https://github.com/IntersectMBO/govtool/issues/2316)
- Add support for displaying Motion of No Confidence Governance Action [Issue 1597](https://github.com/IntersectMBO/govtool/issues/1597)
- Add support for displaying Update committee/threshold Governance Action [Issue 1598](https://github.com/IntersectMBO/govtool/issues/1598)
- Add support for displaying New Constitution and/or Guardrails Script Governance Action [Issue 1599](https://github.com/IntersectMBO/govtool/issues/1598)
- Add support for ipfs in metadata validation service [Issue 1616](https://github.com/IntersectMBO/govtool/issues/1616)
- Add support for displaying array of treasury withdrawals [Issue 1602](https://github.com/IntersectMBO/govtool/issues/1602)

### Fixed

- Fix submitting treasury governance action [Issue 1845](https://github.com/IntersectMBO/govtool/issues/1845)
- Fix failing github action workflow [Issue 2277](https://github.com/IntersectMBO/govtool/issues/2277)

### Changed

- Bumped Cardano node version to `10.1.2`.
- Bumped Cardano DB Sync version to `13.6.0.1`.
- Make calculation of a DRep voting power on the backend [Issue 1960](https://github.com/IntersectMBO/govtool/issues/1960)

### Removed

-

## [v1.0.26](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.26) 2024-11-07

### Added
Expand Down
6 changes: 2 additions & 4 deletions docs/GOVERNANCE_ACTION_SUBMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ interface InfoProps {
interface TreasuryProps {
amount: string;
hash: string;
receivingAddress: string;
url: string;
withdrawals: { receivingAddress: string; amount: string }[];
}

type ProtocolParamsUpdate = {
Expand Down Expand Up @@ -184,8 +183,7 @@ const { buildTreasuryGovernanceAction } = useCardano();
const govActionBuilder = await buildTreasuryGovernanceAction({
hash,
url,
amount,
receivingAddress,
withdrawals: [{ amount, receivingAddress }],
});

// Protocol Parameter Change Governance Action
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "GovTool and utilities monorepo.";
inputs = {
default_nixpkgs.url = "github:nixos/nixpkgs/c9ece0059f42e0ab53ac870104ca4049df41b133";
node_nixpkgs.url = "github:nixos/nixpkgs/9957cd48326fe8dbd52fdc50dd2502307f188b0d";
node_nixpkgs.url = "github:nixos/nixpkgs/23aa9e2f958310c69a94d21f6523240841a02d58";
flake-utils.url = "github:numtide/flake-utils";
nix-inclusive.url = "github:input-output-hk/nix-inclusive";
};
Expand Down
8 changes: 4 additions & 4 deletions gov-action-loader/backend/app/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def get_base_proposal():
def get_base_proposal_for_multiple():
base_proposal = get_base_proposal()
base_proposal["anchor"] = {
"url": "http://bit.ly/3QFMhii",
"dataHash": "1111111111111111111111111111111111111111111111111111111111111112",
"url": "https://metadata-govtool.cardanoapi.io/data/gov-action-loader",
"dataHash": "bcb2fadedbe928519ff000051d8e78ffcabadba0f92b91334cee3e8786491462",
}
base_proposal["deposit"] = default_proposal_deposit_ada * 1000000
return base_proposal
Expand Down Expand Up @@ -69,7 +69,7 @@ def generate_bytes(length):


def generate_withdraw(number):
stake_addresses = [generate_raw_address() for _ in range(number)]
stake_addresses = ["e02fe0d8c1b1c600249e8b9663e18790425e9589ac17cb5ee952d54bee"]
amounts = [
random.choice([10000000, 20000000, 30000000, 40000000, 50000000])
for _ in range(number)
Expand All @@ -78,7 +78,7 @@ def generate_withdraw(number):


def generate_update(number):
stake_addresses = [generate_raw_address() for _ in range(number)]
stake_addresses = ["e02fe0d8c1b1c600249e8b9663e18790425e9589ac17cb5ee952d54bee"]
current_epoch = int((int(time.time()) - 1506635071) / (5 * 24 * 60 * 60))
maximum_epoch = 10000
epochs = [random.randint(current_epoch + 2, maximum_epoch) for _ in range(number)]
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-1.0.26/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-1.0.27/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-1.0.26/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-1.0.27/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
4 changes: 2 additions & 2 deletions govtool/backend/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ startApp vvaConfig = do
settings =
setPort vvaPort
$ setHost vvaHost
$ setTimeout 60 -- 60 seconds timeout
$ setTimeout 120 -- 120 seconds timeout
$ setBeforeMainLoop
( Text.hPutStrLn stderr $
Text.pack
Expand Down Expand Up @@ -117,7 +117,7 @@ startApp vvaConfig = do
, dRepListCache
, networkMetricsCache
}
connectionPool <- createPool (connectPostgreSQL (encodeUtf8 (dbSyncConnectionString $ getter vvaConfig))) close 1 1 60
connectionPool <- createPool (connectPostgreSQL (encodeUtf8 (dbSyncConnectionString $ getter vvaConfig))) close 10 10 120
let appEnv = AppEnv {vvaConfig=vvaConfig, vvaCache=cacheEnv, vvaConnectionPool=connectionPool }
server' <- mkVVAServer appEnv
runSettings settings server'
Expand Down
7 changes: 3 additions & 4 deletions govtool/backend/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> { }, incl }:
{ pkgs ? import <nixpkgs> { }, incl, returnShellEnv ? null }:
let
inherit (pkgs.lib.trivial) pipe;
inherit (pkgs) haskell;
Expand All @@ -21,17 +21,16 @@ let

modifier = drv: pipe drv [ appendLibraries appendTools ];

project = ghcPackages.developPackage {
project = ghcPackages.developPackage ({
root = incl ./. [
./vva-be.cabal
./app
./src
./CHANGELOG.md
./sql
];
modifier = modifier;
overrides = self: super: { openapi3 = useBroken super.openapi3; };
};
} // pkgs.lib.optionalAttrs (returnShellEnv != null) { inherit returnShellEnv; });
in project.overrideAttrs (oldAttrs: {
shellHook = ''
function warn() { tput setaf $2; echo "$1"; tput sgr0; }
Expand Down
24 changes: 12 additions & 12 deletions govtool/backend/example-config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"dbsyncconfig" : {
"host" : "localhost",
"dbname" : "cexplorer",
"user" : "postgres",
"password" : "postgres",
"port" : 5432
},
"port" : 9999,
"host" : "localhost",
"cachedurationseconds": 20,
"sentrydsn": "https://username:[email protected]/id",
"sentryenv": "dev"
"dbsyncconfig" : {
"host" : "localhost",
"dbname" : "cexplorer",
"user" : "postgres",
"password" : "postgres",
"port" : 5432
},
"port" : 9999,
"host" : "localhost",
"cachedurationseconds": 20,
"sentrydsn": "https://username:[email protected]/id",
"sentryenv": "dev"
}
13 changes: 6 additions & 7 deletions govtool/backend/sql/get-voting-power.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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')
order by epoch_no desc
limit 1
select sum(uv.value) as amount
from utxo_view uv
join delegation_vote dv on uv.stake_address_id = dv.addr_id
join drep_hash dh on dv.drep_hash_id = dh.id
where dh.raw = decode(?,'hex')
and dv.cert_index != 0
Loading

0 comments on commit d18ebab

Please sign in to comment.