Skip to content

Commit 1f42e37

Browse files
Update edo2net demos, improve CI (#202)
* Update edonet demos * lint * xdist? * bump? * Update registrydao * Cleanup * Try to disable hasura test in docker * ok, just skip it * wrong test 👀 * 👀 * typo * drop case? * cache venv * Revert "drop case?" This reverts commit e51efbc. * Do not discover hasura * and utils? * dokole * subprocess.call? * Disable capture? * @ci_skip * simplier detect * cleanup aaand it's done * Fix hashFiles * typo * agen * ageen * CI * Reenable test
1 parent 0f7ae93 commit 1f42e37

File tree

16 files changed

+241
-169
lines changed

16 files changed

+241
-169
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
python-version: "3.8.x"
1313
- uses: snok/[email protected]
1414

15+
- uses: actions/cache@v2
16+
id: cache-venv
17+
with:
18+
path: /home/runner/.cache/pypoetry/virtualenvs
19+
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-venv-
22+
1523
- name: Install project
1624
run: make install
1725
- name: Run lint

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Please use [this](https://docs.gitlab.com/ee/development/changelog.html) document as guidelines to keep a changelog.
44

5+
## [unreleased]
6+
7+
### Fixed
8+
9+
* demos: Tezos Domains and Homebase DAO demos were updated from edo2net to mainnet contracts.
10+
11+
### Other
12+
13+
* ci: Cache virtual environment in GitHub Actions.
14+
* ci: Detect CI environment and skip tests that fail in GitHub Actions.
15+
* ci: Execute tests in parallel with `pytest-xdist` when possible.
16+
517
## 4.0.3 - 2022-01-09
618

719
### Fixed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mypy:
3030
poetry run mypy src tests
3131

3232
test:
33-
poetry run pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -v tests
33+
poetry run pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -n auto --dist loadscope -s -v tests
3434

3535
cover:
3636
poetry run diff-cover coverage.xml

poetry.lock

Lines changed: 128 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ testcontainers = "^3.4.1"
5757
types-pytz = "^2021.1.2"
5858
types-tabulate = "^0.8.2"
5959
pprofile = "^2.1.0"
60+
pytest-xdist = "^2.5.0"
6061

6162
[tool.poetry.extras]
6263
pytezos = ["pytezos"]

src/demo_registrydao/dipdup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ database:
77

88
contracts:
99
registry:
10-
address: KT1R8AZn5KG7mkbnJ5bzMuUw2isL8tMYkDVD
10+
address: KT1JytEHBVBg27n9w85tNhSWUpbTvETD6rx6
1111
typename: registry
1212

1313
datasources:
1414
tzkt:
1515
kind: tzkt
16-
url: ${TZKT_URL:-https://api.edo2net.tzkt.io}
16+
url: ${TZKT_URL:-https://api.tzkt.io}
1717

1818
templates:
1919

src/demo_registrydao/docker/dipdup.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ HASURA_GRAPHQL_ADMIN_INTERNAL_ERRORS=true
88
HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, webhook-log, websocket-log, query-log
99
HASURA_GRAPHQL_ADMIN_SECRET=changeme
1010
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=user
11-
TZKT_URL=https://api.edo2net.tzkt.io
11+
TZKT_URL=https://api.tzkt.io
1212
ADMIN_SECRET=changeme

src/demo_registrydao/types/registry/storage.py

Lines changed: 45 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,110 +11,86 @@
1111
from pydantic import Extra
1212

1313

14-
class FreezeHistory(BaseModel):
15-
class Config:
16-
extra = Extra.forbid
17-
18-
current_period_num: str
19-
current_unstaked: str
20-
past_unstaked: str
21-
staked: str
22-
23-
24-
class LastPeriodChange(BaseModel):
25-
class Config:
26-
extra = Extra.forbid
27-
28-
changed_on: str
29-
period_num: str
30-
31-
3214
class Key(BaseModel):
3315
class Config:
3416
extra = Extra.forbid
3517

36-
address: str
37-
nat: str
18+
delegate: str
19+
owner: str
3820

3921

40-
class LedgerItem(BaseModel):
22+
class Delegate(BaseModel):
4123
class Config:
4224
extra = Extra.forbid
4325

4426
key: Key
45-
value: str
46-
47-
48-
class MaxQuorumThreshold(BaseModel):
49-
class Config:
50-
extra = Extra.forbid
51-
52-
denominator: str
53-
numerator: str
27+
value: Dict[str, Any]
5428

5529

56-
class MinQuorumThreshold(BaseModel):
30+
class FreezeHistory(BaseModel):
5731
class Config:
5832
extra = Extra.forbid
5933

60-
denominator: str
61-
numerator: str
34+
current_stage_num: str
35+
current_unstaked: str
36+
past_unstaked: str
37+
staked: str
6238

6339

64-
class Key1(BaseModel):
40+
class GovernanceToken(BaseModel):
6541
class Config:
6642
extra = Extra.forbid
6743

68-
operator: str
69-
owner: str
44+
address: str
45+
token_id: str
7046

7147

72-
class Operator(BaseModel):
48+
class ProposalKeyListSortByLevelItem(BaseModel):
7349
class Config:
7450
extra = Extra.forbid
7551

76-
key: Key1
77-
value: Dict[str, Any]
52+
bytes: str
53+
nat: str
7854

7955

80-
class ProposalKeyListSortByDateItem(BaseModel):
56+
class Key1(BaseModel):
8157
class Config:
8258
extra = Extra.forbid
8359

84-
bytes: str
85-
timestamp: str
60+
address: str
61+
bool: bool
8662

8763

8864
class Voter(BaseModel):
8965
class Config:
9066
extra = Extra.forbid
9167

92-
vote_amount: str
93-
vote_type: bool
94-
voter_address: str
68+
key: Key1
69+
value: str
9570

9671

9772
class Proposals(BaseModel):
9873
class Config:
9974
extra = Extra.forbid
10075

10176
downvotes: str
102-
metadata: Dict[str, str]
103-
period_num: str
77+
metadata: str
10478
proposer: str
105-
proposer_fixed_fee_in_token: str
10679
proposer_frozen_token: str
107-
start_date: str
80+
quorum_threshold: str
81+
start_level: str
10882
upvotes: str
10983
voters: List[Voter]
84+
voting_stage_num: str
11085

11186

112-
class QuorumThreshold(BaseModel):
87+
class QuorumThresholdAtCycle(BaseModel):
11388
class Config:
11489
extra = Extra.forbid
11590

116-
denominator: str
117-
numerator: str
91+
last_updated_cycle: str
92+
quorum_threshold: str
93+
staked: str
11894

11995

12096
class RegistryStorage(BaseModel):
@@ -124,28 +100,30 @@ class Config:
124100
admin: str
125101
custom_entrypoints: Dict[str, str]
126102
decision_lambda: str
103+
delegates: List[Delegate]
127104
extra: Dict[str, str]
128105
fixed_proposal_fee_in_token: str
129106
freeze_history: Dict[str, FreezeHistory]
130107
frozen_token_id: str
131-
last_period_change: LastPeriodChange
132-
ledger: List[LedgerItem]
108+
frozen_total_supply: str
109+
governance_token: GovernanceToken
110+
governance_total_supply: str
111+
guardian: str
133112
max_proposals: str
134-
max_quorum_threshold: MaxQuorumThreshold
135-
max_votes: str
136-
max_voting_period: str
113+
max_quorum_change: str
114+
max_quorum_threshold: str
115+
max_voters: str
137116
metadata: Dict[str, str]
138-
min_quorum_threshold: MinQuorumThreshold
139-
min_voting_period: str
140-
operators: List[Operator]
117+
min_quorum_threshold: str
141118
pending_owner: str
119+
period: str
142120
permits_counter: str
143121
proposal_check: str
144-
proposal_key_list_sort_by_date: List[ProposalKeyListSortByDateItem]
122+
proposal_expired_level: str
123+
proposal_flush_level: str
124+
proposal_key_list_sort_by_level: List[ProposalKeyListSortByLevelItem]
145125
proposals: Dict[str, Proposals]
146-
quorum_threshold: QuorumThreshold
147-
rejected_proposal_return_value: str
148-
token_address: str
149-
total_supply: Dict[str, str]
150-
unfrozen_token_id: str
151-
voting_period: str
126+
quorum_change: str
127+
quorum_threshold_at_cycle: QuorumThresholdAtCycle
128+
rejected_proposal_slash_value: str
129+
start_level: str

src/demo_tezos_domains_big_map/dipdup.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ database:
66
path: tezos_domains_big_map.sqlite3
77

88
contracts:
9-
edo_name_registry:
10-
address: KT1JJbWfW8CHUY95hG9iq2CEMma1RiKhMHDR
9+
name_registry:
10+
address: KT1GBZmSxmnKJXGMdMLbugPfLyUPmuLSMwKS
1111
typename: name_registry
1212
mainnet_name_registry:
1313
address: KT1GBZmSxmnKJXGMdMLbugPfLyUPmuLSMwKS
1414
typename: name_registry
1515

1616
datasources:
17-
tzkt_edo:
17+
tzkt:
1818
kind: tzkt
19-
url: ${TZKT_URL:-https://api.edo2net.tzkt.io}
19+
url: ${TZKT_URL:-https://api.tzkt.io}
2020

2121
tzkt_mainnet:
2222
kind: tzkt
@@ -35,11 +35,11 @@ templates:
3535
path: store.expiry_map
3636

3737
indexes:
38-
tezos_domains_big_map_edo:
38+
tezos_domains_big_map:
3939
template: tezos_domains_big_map
4040
values:
41-
datasource: tzkt_edo
42-
name_registry: edo_name_registry
41+
datasource: tzkt
42+
name_registry: name_registry
4343

4444
tezos_domains_big_map_mainnet:
4545
template: tezos_domains_big_map

src/dipdup/utils/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import importlib
33
import logging
4+
import os
45
import pkgutil
56
import time
67
import types
@@ -25,6 +26,7 @@
2526
from typing import Sequence
2627
from typing import TextIO
2728
from typing import TypeVar
29+
from unittest import skip
2830

2931
import humps # type: ignore
3032
from genericpath import isdir
@@ -167,3 +169,9 @@ def remove_prefix(text: str, prefix: str) -> str:
167169
if text.startswith(prefix):
168170
text = text[len(prefix) :]
169171
return text.strip('_')
172+
173+
174+
def skip_ci(fn):
175+
if os.environ.get('CI'):
176+
return skip('CI environment, skipping')(fn)
177+
return fn

0 commit comments

Comments
 (0)