Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
haf_block_explorer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
haf_block_explorer
Commits
d184a674
Commit
d184a674
authored
3 weeks ago
by
Michal Zander
Browse files
Options
Downloads
Patches
Plain Diff
Fix shortened vote power by casting to text
parent
5fdf4a19
No related branches found
No related tags found
1 merge request
!298
Unify API returns to sql composite types
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/account.sql
+40
-0
40 additions, 0 deletions
backend/account.sql
scripts/install_app.sh
+1
-0
1 addition, 0 deletions
scripts/install_app.sh
with
41 additions
and
0 deletions
backend/account.sql
0 → 100644
+
40
−
0
View file @
d184a674
SET
ROLE
hafbe_owner
;
CREATE
OR
REPLACE
FUNCTION
hafbe_backend
.
get_account_proxied_vsf_votes
(
_account
INT
)
RETURNS
TEXT
[]
-- noqa: LT01, CP05
LANGUAGE
'plpgsql'
STABLE
AS
$$
BEGIN
RETURN
(
WITH
proxy_levels
AS
MATERIALIZED
(
SELECT
vpvv
.
proxied_vests
as
proxy
,
vpvv
.
proxy_level
FROM
hafbe_views
.
voters_proxied_vests_view
vpvv
WHERE
vpvv
.
proxy_id
=
_account
ORDER
BY
vpvv
.
proxy_level
),
populate_record
AS
MATERIALIZED
(
SELECT
0
as
proxy
,
1
as
proxy_level
UNION
ALL
SELECT
0
as
proxy
,
2
as
proxy_level
UNION
ALL
SELECT
0
as
proxy
,
3
as
proxy_level
UNION
ALL
SELECT
0
as
proxy
,
4
as
proxy_level
)
SELECT
array_agg
(
coalesce
(
s
.
proxy
::
TEXT
,
"0"
)
ORDER
BY
pr
.
proxy_level
)
FROM
populate_record
pr
LEFT
JOIN
proxy_levels
s
ON
s
.
proxy_level
=
pr
.
proxy_level
);
END
$$
;
RESET
ROLE
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/install_app.sh
+
1
−
0
View file @
d184a674
...
...
@@ -178,6 +178,7 @@ setup_api() {
psql
"
$POSTGRES_ACCESS_OWNER
"
-v
"ON_ERROR_STOP=on"
-f
"
$backend
/blocksearch/filtering_functions/by_account_multi_operations.sql"
psql
"
$POSTGRES_ACCESS_OWNER
"
-v
"ON_ERROR_STOP=on"
-f
"
$backend
/aggregated_transactions.sql"
psql
"
$POSTGRES_ACCESS_OWNER
"
-v
"ON_ERROR_STOP=on"
-f
"
$backend
/authority.sql"
psql
"
$POSTGRES_ACCESS_OWNER
"
-v
"ON_ERROR_STOP=on"
-f
"
$backend
/account.sql"
psql
"
$POSTGRES_ACCESS_OWNER
"
-v
"ON_ERROR_STOP=on"
-f
"
$backend
/blocksearch/get_blocks_by_ops.sql"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment