Skip to content

Commit 8377c28

Browse files
authored
Merge pull request #816 from humanprotocol/develop
Release 230822
2 parents c7648cd + 8258f18 commit 8377c28

File tree

319 files changed

+12801
-5513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+12801
-5513
lines changed

.github/workflows/cd-subgraph.yaml

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,51 @@ on:
88
- packages/sdk/typescript/subgraph/**
99
- .github/workflows/cd-subgraph.yaml
1010
workflow_dispatch:
11-
inputs:
12-
subgraph-name:
13-
description: 'subgraph name'
14-
required: true
1511

1612
jobs:
17-
contracts-check:
18-
runs-on: ubuntu-latest
19-
outputs:
20-
contracts_updated: ${{ steps.filter.outputs.contracts }}
21-
steps:
22-
- uses: actions/checkout@v3
23-
- name: Check changes in files
24-
uses: dorny/paths-filter@v2
25-
id: filter
26-
with:
27-
base: ${{ github.ref }}
28-
filters: |
29-
contracts:
30-
- 'packages/core/contracts/**'
3113
subgraph:
3214
name: Deploy Subgraph
33-
environment: deploy-subgraph
34-
needs: contracts-check
3515
runs-on: ubuntu-latest
3616
strategy:
3717
matrix:
3818
network:
3919
- name: matic
40-
graph: polygon-v1
20+
graph: polygon-v2
4121
- name: goerli
42-
graph: goerli-v1
22+
graph: goerli-v2
4323
- name: moonbeam
44-
graph: moonbeam-v1
24+
graph: moonbeam-v2
4525
- name: bsc
46-
graph: bsc-v1
26+
graph: bsc-v2
4727
- name: chapel
48-
graph: bsctest-v1
28+
graph: bsctest-v2
4929
- name: mumbai
50-
graph: mumbai-v1
30+
graph: mumbai-v2
5131
- name: mbase
52-
graph: moonbase-alpha-v1
32+
graph: moonbase-alpha-v2
5333
- name: mainnet
54-
graph: mainnet-v1
34+
graph: mainnet-v2
5535
fail-fast: true
5636
max-parallel: 3
57-
if: ${{ needs.contracts-check.outputs.contracts_updated != 'true' || github.event.inputs.subgraph-name }}
5837
steps:
5938
- uses: actions/checkout@v3
60-
- name: Continue check
61-
id: continue_check
62-
run: |
63-
if [[ ${{ needs.contracts-check.outputs.contracts_updated}} == 'true' && "${{ github.event.inputs.subgraph-name }}" != "${{ matrix.network.graph }}" ]]; then
64-
echo "stop=true" >> $GITHUB_OUTPUT
65-
fi
6639
- run: yarn --ignore-scripts
67-
if: ${{steps.continue_check.outputs.stop != 'true'}}
6840
name: Install dependencies
6941
- run: yarn build
70-
if: ${{steps.continue_check.outputs.stop != 'true'}}
7142
name: Build core package
7243
working-directory: ./packages/core
7344
- run: yarn global add @graphprotocol/graph-cli
74-
if: ${{steps.continue_check.outputs.stop != 'true'}}
7545
name: Install Graph CLI
7646
- run: graph auth --product hosted-service ${API_KEY}
77-
if: ${{steps.continue_check.outputs.stop != 'true'}}
7847
name: Authenticate Graph CLI
7948
env:
8049
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
8150
- run: yarn generate
82-
if: ${{steps.continue_check.outputs.stop != 'true'}}
8351
name: Generate Subgraph
8452
working-directory: ./packages/sdk/typescript/subgraph
8553
env:
8654
NETWORK: ${{ matrix.network.graph }}
8755
- run: graph deploy --product hosted-service humanprotocol/${NETWORK}
88-
if: ${{steps.continue_check.outputs.stop != 'true'}}
8956
name: Deploy Subgraph
9057
working-directory: ./packages/sdk/typescript/subgraph
9158
env:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CVAT Recording Oracle Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- 'packages/examples/cvat/recording-oracle/**'
7+
8+
jobs:
9+
cvat-exo-test:
10+
name: CVAT Test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: CVAT Recording Oracle tests
15+
working-directory: ./packages/examples/cvat/recording-oracle
16+
run: docker compose -f docker-compose.test.yml up --attach test --exit-code-from test

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,4 @@ build
4545
dist
4646

4747
#cache
48-
cache
49-
50-
#Postgres Data
51-
db
48+
cache

packages/apps/escrow-dashboard/src/components/SolvedTasks/NewsView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ export const NewsView = () => {
5858
fontSize: { xs: '14px', sm: '20px', md: '24px' },
5959
}}
6060
color="primary"
61-
mb={{ xs: 0, md: 6 }}
61+
mb={2}
6262
>
6363
{data?.title}
6464
</Typography>
6565
<Typography
6666
variant="body2"
6767
color="primary"
6868
maxWidth={450}
69-
mb={5}
69+
mb={4}
7070
sx={{ display: { xs: 'none', md: 'block' } }}
7171
>
7272
{data?.description}
Lines changed: 101 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import { Box, Typography, useTheme } from '@mui/material';
1+
import { Box, Grid, Typography } from '@mui/material';
22
import dayjs from 'dayjs';
33
import numeral from 'numeral';
4-
import { FC } from 'react';
4+
import { FC, useMemo } from 'react';
55
import {
6-
BarChart as RechartsBarChart,
7-
Bar,
6+
AreaChart,
7+
Area,
88
ResponsiveContainer,
99
Tooltip,
1010
XAxis,
11+
YAxis,
12+
CartesianGrid,
1113
} from 'recharts';
1214

1315
import SOLVED_TASKS from '../../history-data/sovled_tasks.json';
@@ -19,22 +21,14 @@ const CustomTooltip = ({ active, payload, label }: any) => {
1921
<Box
2022
sx={{
2123
background: '#fff',
22-
border: '1px solid rgba(218, 222, 240, 0.8)',
23-
borderRadius: '16px',
24-
padding: '30px 38px',
24+
border: '1px solid #CBCFE6',
25+
borderRadius: '10px',
26+
padding: '8px 16px',
2527
}}
2628
>
27-
<Typography color="text.primary" variant="body2" fontWeight={600}>
28-
{dayjs(label).format('MMM YYYY')}
29+
<Typography color="text.primary" variant="h6" fontWeight={500}>
30+
{numeral(payload[0].value).format('0a').toUpperCase()}
2931
</Typography>
30-
<Box mt={2}>
31-
<Typography color="text.primary" variant="caption" component="p">
32-
Task Solved
33-
</Typography>
34-
<Typography color="text.primary" variant="h6" fontWeight={500}>
35-
{payload[0].value}
36-
</Typography>
37-
</Box>
3832
</Box>
3933
);
4034
}
@@ -43,71 +37,119 @@ const CustomTooltip = ({ active, payload, label }: any) => {
4337
};
4438

4539
export const SolvedTasksView: FC = () => {
46-
const theme = useTheme();
4740
const solvedTasksCount = SOLVED_TASKS.reduce((acc, d) => acc + d.value, 0);
4841

42+
const qoqGrowth = useMemo(() => {
43+
const currentTasks = SOLVED_TASKS[SOLVED_TASKS.length - 1].value;
44+
const previousTasks = SOLVED_TASKS[SOLVED_TASKS.length - 4].value;
45+
return numeral((currentTasks - previousTasks) / previousTasks).format('0%');
46+
}, []);
47+
4948
return (
5049
<CardContainer>
51-
<Box
52-
sx={{
53-
display: 'flex',
54-
flexWrap: 'wrap',
55-
justifyContent: 'space-evenly',
56-
}}
57-
>
58-
<Box>
59-
<Typography variant="body2" color="primary" fontWeight={600} mb="8px">
60-
{`Solved Tasks till ${dayjs(
61-
SOLVED_TASKS[SOLVED_TASKS.length - 1].date
62-
).format('MMM D, YYYY')}`}
63-
</Typography>
64-
<Typography
65-
variant="h2"
66-
color="primary"
67-
fontWeight={600}
68-
lineHeight={1.125}
69-
>
70-
{numeral(solvedTasksCount).format('0.000 a').toUpperCase()}
71-
</Typography>
72-
</Box>
73-
<Box sx={{ width: 400, height: 300 }}>
74-
<ResponsiveContainer>
75-
<RechartsBarChart
76-
data={SOLVED_TASKS}
77-
margin={{ top: 30, left: 4, right: 4 }}
50+
<Grid container sx={{ height: '100%' }} spacing={3}>
51+
<Grid item xs={12} lg={4}>
52+
<Box mb={2}>
53+
<Typography
54+
variant="body2"
55+
color="primary"
56+
fontWeight={600}
57+
mb="8px"
58+
>
59+
{`Solved Tasks till ${dayjs(
60+
SOLVED_TASKS[SOLVED_TASKS.length - 1].date
61+
).format('MMM D, YYYY')}`}
62+
</Typography>
63+
<Typography
64+
variant="h2"
65+
color="primary"
66+
fontWeight={800}
67+
lineHeight={1.125}
68+
>
69+
{numeral(solvedTasksCount).format('0.000 a').toUpperCase()}
70+
</Typography>
71+
</Box>
72+
<Box>
73+
<Typography
74+
variant="body2"
75+
color="secondary"
76+
fontWeight={600}
77+
mb="8px"
78+
>
79+
QoQ Growth
80+
</Typography>
81+
<Typography
82+
variant="h2"
83+
color="secondary"
84+
fontWeight={800}
85+
lineHeight={1.125}
7886
>
87+
{qoqGrowth}
88+
</Typography>
89+
</Box>
90+
</Grid>
91+
<Grid item xs={12} lg={8}>
92+
<ResponsiveContainer width="100%" height="100%" minHeight={300}>
93+
<AreaChart data={SOLVED_TASKS} margin={{ right: 30, bottom: 10 }}>
94+
<defs>
95+
<linearGradient
96+
id="paint0_linear_4037_63345"
97+
x1="257"
98+
y1="0"
99+
x2="257"
100+
y2="276.5"
101+
gradientUnits="userSpaceOnUse"
102+
>
103+
<stop
104+
offset="0.290598"
105+
stop-color="#CACFE8"
106+
stop-opacity="0.3"
107+
/>
108+
<stop offset="1" stop-color="#E9ECFF" stop-opacity="0" />
109+
</linearGradient>
110+
</defs>
111+
<CartesianGrid vertical={false} strokeDasharray={3} />
79112
<XAxis
80113
dataKey="date"
81-
type="category"
82114
axisLine={false}
83115
tickLine={false}
84-
interval="preserveStartEnd"
85-
ticks={[
86-
SOLVED_TASKS[0].date,
87-
SOLVED_TASKS[SOLVED_TASKS.length - 1].date,
88-
]}
89116
tick={{
90117
fill: '#320A8D',
91-
fontSize: '12px',
118+
fontSize: '14px',
92119
fontFamily: 'Inter',
120+
fontWeight: 500,
93121
}}
94-
tickFormatter={(value: any) => dayjs(value).format('MMM D')}
122+
tickFormatter={(value: any) => dayjs(value).format('MMM')}
95123
tickMargin={12}
96124
padding={{ left: 10, right: 10 }}
97125
/>
126+
<YAxis
127+
axisLine={false}
128+
tickLine={false}
129+
tick={{
130+
fill: '#320A8D',
131+
fontSize: '14px',
132+
fontFamily: 'Inter',
133+
fontWeight: 500,
134+
}}
135+
tickFormatter={(value: any) =>
136+
numeral(value).format('0a').toUpperCase()
137+
}
138+
/>
98139
<Tooltip
99140
cursor={{ fill: '#dadef0' }}
100141
content={<CustomTooltip />}
101142
/>
102-
<Bar
143+
<Area
144+
type="monotone"
103145
dataKey="value"
104-
fill={theme.palette.primary.main}
105-
barSize={16}
146+
stroke="#320A8D"
147+
fill="url(#paint0_linear_4037_63345)"
106148
/>
107-
</RechartsBarChart>
149+
</AreaChart>
108150
</ResponsiveContainer>
109-
</Box>
110-
</Box>
151+
</Grid>
152+
</Grid>
111153
</CardContainer>
112154
);
113155
};

packages/apps/escrow-dashboard/src/history-data/sovled_tasks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
{ "date": "2023-03-31", "value": 212012559 },
1111
{ "date": "2023-04-30", "value": 182462076 },
1212
{ "date": "2023-05-31", "value": 148126905 },
13-
{ "date": "2023-06-30", "value": 147005424 }
13+
{ "date": "2023-06-30", "value": 147005424 },
14+
{ "date": "2023-07-31", "value": 132977763 }
1415
]

packages/apps/fortune/recording-oracle/.env.sample

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"arrowParens": "avoid",
3-
"bracketSpacing": true,
4-
"printWidth": 120,
5-
"trailingComma": "all",
6-
"singleQuote": false
7-
}
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

0 commit comments

Comments
 (0)