Skip to content

Commit 1c7fce4

Browse files
Use boa from source, fix more tests
1 parent 620bfe4 commit 1c7fce4

File tree

10 files changed

+233
-171
lines changed

10 files changed

+233
-171
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Out[1]: '0xc4AD29ba4B3c580e6D59105FFf484999997675Ff'
338338

339339
#### `MetaRegistry.get_pool_asset_type`
340340

341-
Gets the asset type of pool. `0` = `USD`, `1` = `ETH`, `2` = `BTC`, `3` = Other, `4` = CryptoPool token. The asset type is a property of StableSwaps, and is not enforced in CryptoSwap pools (which always return `4`).
341+
Gets the asset type of a pool. `0` = `USD`, `1` = `ETH`, `2` = `BTC`, `3` = Other, `4` = CryptoPool token. The asset type is a property of StableSwaps, and is not enforced in CryptoSwap pools (which always return `4`).
342342

343343
StableSwap pool example for `LUSD-3CRV` pool which is a `USD` stablecoin pool:
344344

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
titanoboa[forking-recommended]==0.1.8
1+
titanoboa[forking-recommended] @ git+https://github.com/vyperlang/titanoboa
22
black
33
flake8
44
isort

requirements.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile
@@ -45,7 +45,6 @@ eth-bloom==3.0.0
4545
eth-hash[pycryptodome]==0.5.2
4646
# via
4747
# eth-bloom
48-
# eth-hash
4948
# eth-utils
5049
# trie
5150
eth-keyfile==0.6.1
@@ -78,6 +77,10 @@ eth-utils==2.3.1
7877
# py-evm
7978
# rlp
8079
# trie
80+
exceptiongroup==1.2.0
81+
# via
82+
# hypothesis
83+
# pytest
8184
filelock==3.13.1
8285
# via virtualenv
8386
flake8==6.1.0
@@ -178,16 +181,23 @@ sortedcontainers==2.4.0
178181
# trie
179182
tabulate==0.9.0
180183
# via -r requirements.in
181-
titanoboa[forking-recommended]==0.1.8
184+
titanoboa[forking-recommended] @ git+https://github.com/vyperlang/titanoboa
185+
# via -r requirements.in
186+
tomli==2.0.1
182187
# via
183-
# -r requirements.in
184-
# titanoboa
188+
# black
189+
# build
190+
# pip-tools
191+
# pyproject-hooks
192+
# pytest
185193
toolz==0.12.0
186194
# via cytoolz
187195
trie==2.2.0
188196
# via py-evm
189197
typing-extensions==4.8.0
190-
# via eth-typing
198+
# via
199+
# black
200+
# eth-typing
191201
ujson==5.8.0
192202
# via titanoboa
193203
urllib3==2.1.0

scripts/boa_scripts/set_up_registries.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,16 @@ def set_up_registries(
4343
boa.env.eoa = Account.from_key(os.environ[account])
4444

4545
data = next(
46-
(
47-
data
48-
for _network, data in deploy_utils.curve_dao_network_settings.items()
49-
if _network in network
50-
),
51-
None,
46+
data
47+
for _network, data in deploy_utils.curve_dao_network_settings.items()
48+
if _network in network
5249
)
5350

5451
owner = data.dao_ownership_contract
5552
fee_receiver = data.fee_receiver_address
56-
address_provider = Contract(data.address_provider)
5753
assert owner, f"Curve's DAO contracts may not be on {network}."
5854
assert fee_receiver, f"Curve's DAO contracts may not be on {network}."
55+
address_provider = Contract(data.address_provider)
5956

6057
# -------------------------- Register into AddressProvider --------------------------
6158

tests/fixtures/constants.py

Lines changed: 116 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -5,141 +5,129 @@
55

66
@pytest.fixture(scope="module")
77
def base_pools():
8-
base_pool_data = {}
9-
base_pool_data["tripool"] = {
10-
"pool": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",
11-
"lp_token": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
12-
"num_coins": 3,
13-
"is_legacy": False,
14-
"is_lending": False,
15-
"is_v2": False,
16-
}
17-
18-
base_pool_data["fraxusdc"] = {
19-
"pool": "0xdcef968d416a41cdac0ed8702fac8128a64241a2",
20-
"lp_token": "0x3175df0976dfa876431c2e9ee6bc45b65d3473cc",
21-
"num_coins": 2,
22-
"is_legacy": False,
23-
"is_lending": False,
24-
"is_v2": False,
25-
}
26-
27-
base_pool_data["sbtc"] = {
28-
"pool": "0x7fC77b5c7614E1533320Ea6DDc2Eb61fa00A9714",
29-
"lp_token": "0x075b1bb99792c9E1041bA13afEf80C91a1e70fB3",
30-
"num_coins": 3,
31-
"is_legacy": True,
32-
"is_lending": False,
33-
"is_v2": False,
8+
return {
9+
"tripool": {
10+
"pool": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",
11+
"lp_token": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
12+
"num_coins": 3,
13+
"is_legacy": False,
14+
"is_lending": False,
15+
"is_v2": False,
16+
},
17+
"fraxusdc": {
18+
"pool": "0xdcef968d416a41cdac0ed8702fac8128a64241a2",
19+
"lp_token": "0x3175df0976dfa876431c2e9ee6bc45b65d3473cc",
20+
"num_coins": 2,
21+
"is_legacy": False,
22+
"is_lending": False,
23+
"is_v2": False,
24+
},
25+
"sbtc": {
26+
"pool": "0x7fC77b5c7614E1533320Ea6DDc2Eb61fa00A9714",
27+
"lp_token": "0x075b1bb99792c9E1041bA13afEf80C91a1e70fB3",
28+
"num_coins": 3,
29+
"is_legacy": True,
30+
"is_lending": False,
31+
"is_v2": False,
32+
},
3433
}
3534

36-
return base_pool_data
37-
3835

3936
@pytest.fixture(scope="module")
4037
def crypto_registry_pools(base_pools):
41-
pool_data = {}
42-
pool_data["tricrypto2"] = {
43-
"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46",
44-
"lp_token": "0xc4AD29ba4B3c580e6D59105FFf484999997675Ff",
45-
"gauge": "0xDeFd8FdD20e0f34115C7018CCfb655796F6B2168",
46-
"zap": "0x3993d34e7e99Abf6B6f367309975d1360222D446",
47-
"num_coins": 3,
48-
"name": "tricrypto2",
49-
"base_pool": ZERO_ADDRESS,
50-
"has_positive_rebasing_tokens": False,
51-
}
52-
53-
pool_data["eurt3crv"] = {
54-
"pool": "0x9838eccc42659fa8aa7daf2ad134b53984c9427b",
55-
"lp_token": "0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833",
56-
"gauge": "0x4Fd86Ce7Ecea88F7E0aA78DC12625996Fb3a04bC",
57-
"zap": "0x5D0F47B32fDd343BfA74cE221808e2abE4A53827",
58-
"num_coins": 2,
59-
"name": "eurtusd",
60-
"base_pool": base_pools["tripool"]["pool"],
61-
"has_positive_rebasing_tokens": False,
62-
}
63-
64-
pool_data["eursusdc"] = {
65-
"pool": "0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B",
66-
"lp_token": "0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B",
67-
"gauge": "0x65CA7Dc5CB661fC58De57B1E1aF404649a27AD35",
68-
"zap": ZERO_ADDRESS,
69-
"num_coins": 2,
70-
"name": "eursusd",
71-
"base_pool": ZERO_ADDRESS,
72-
"has_positive_rebasing_tokens": False,
73-
}
74-
75-
pool_data["crveth"] = {
76-
"pool": "0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511",
77-
"lp_token": "0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d",
78-
"gauge": "0x1cEBdB0856dd985fAe9b8fEa2262469360B8a3a6",
79-
"zap": ZERO_ADDRESS,
80-
"num_coins": 2,
81-
"name": "crveth",
82-
"base_pool": ZERO_ADDRESS,
83-
"has_positive_rebasing_tokens": False,
84-
}
85-
86-
pool_data["cvxeth"] = {
87-
"pool": "0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4",
88-
"lp_token": "0x3A283D9c08E8b55966afb64C515f5143cf907611",
89-
"gauge": "0x7E1444BA99dcdFfE8fBdb42C02F0005D14f13BE1",
90-
"zap": ZERO_ADDRESS,
91-
"num_coins": 2,
92-
"name": "cvxeth",
93-
"base_pool": ZERO_ADDRESS,
94-
"has_positive_rebasing_tokens": False,
95-
}
96-
97-
pool_data["xaut3crv"] = {
98-
"pool": "0xAdCFcf9894335dC340f6Cd182aFA45999F45Fc44",
99-
"lp_token": "0x8484673cA7BfF40F82B041916881aeA15ee84834",
100-
"gauge": "0x1B3E14157ED33F60668f2103bCd5Db39a1573E5B",
101-
"zap": "0xc5FA220347375ac4f91f9E4A4AAb362F22801504",
102-
"num_coins": 2,
103-
"name": "xaut3crv",
104-
"base_pool": base_pools["tripool"]["pool"],
105-
"has_positive_rebasing_tokens": False,
106-
}
107-
108-
pool_data["spelleth"] = {
109-
"pool": "0x98638FAcf9a3865cd033F36548713183f6996122",
110-
"lp_token": "0x8282BD15dcA2EA2bDf24163E8f2781B30C43A2ef",
111-
"gauge": "0x08380a4999Be1a958E2abbA07968d703C7A3027C",
112-
"zap": ZERO_ADDRESS,
113-
"num_coins": 2,
114-
"name": "spelleth",
115-
"base_pool": ZERO_ADDRESS,
116-
"has_positive_rebasing_tokens": False,
117-
}
118-
119-
pool_data["teth"] = {
120-
"pool": "0x752eBeb79963cf0732E9c0fec72a49FD1DEfAEAC",
121-
"lp_token": "0xCb08717451aaE9EF950a2524E33B6DCaBA60147B",
122-
"gauge": "0x6070fBD4E608ee5391189E7205d70cc4A274c017",
123-
"zap": ZERO_ADDRESS,
124-
"num_coins": 2,
125-
"name": "teth",
126-
"base_pool": ZERO_ADDRESS,
127-
"has_positive_rebasing_tokens": False,
128-
}
129-
130-
pool_data["eurocusd"] = {
131-
"pool": "0xE84f5b1582BA325fDf9cE6B0c1F087ccfC924e54",
132-
"lp_token": "0x70fc957eb90e37af82acdbd12675699797745f68",
133-
"gauge": "0x4329c8F09725c0e3b6884C1daB1771bcE17934F9",
134-
"zap": "0xd446a98f88e1d053d1f64986e3ed083bb1ab7e5a",
135-
"num_coins": 2,
136-
"name": "eurocusd",
137-
"base_pool": base_pools["tripool"]["pool"],
138-
"has_positive_rebasing_tokens": False,
38+
return {
39+
"tricrypto2": {
40+
"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46",
41+
"lp_token": "0xc4AD29ba4B3c580e6D59105FFf484999997675Ff",
42+
"gauge": "0xDeFd8FdD20e0f34115C7018CCfb655796F6B2168",
43+
"zap": "0x3993d34e7e99Abf6B6f367309975d1360222D446",
44+
"num_coins": 3,
45+
"name": "tricrypto2",
46+
"base_pool": ZERO_ADDRESS,
47+
"has_positive_rebasing_tokens": False,
48+
},
49+
"eurt3crv": {
50+
"pool": "0x9838eccc42659fa8aa7daf2ad134b53984c9427b",
51+
"lp_token": "0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833",
52+
"gauge": "0x4Fd86Ce7Ecea88F7E0aA78DC12625996Fb3a04bC",
53+
"zap": "0x5D0F47B32fDd343BfA74cE221808e2abE4A53827",
54+
"num_coins": 2,
55+
"name": "eurtusd",
56+
"base_pool": base_pools["tripool"]["pool"],
57+
"has_positive_rebasing_tokens": False,
58+
},
59+
"eursusdc": {
60+
"pool": "0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B",
61+
"lp_token": "0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B",
62+
"gauge": "0x65CA7Dc5CB661fC58De57B1E1aF404649a27AD35",
63+
"zap": ZERO_ADDRESS,
64+
"num_coins": 2,
65+
"name": "eursusd",
66+
"base_pool": ZERO_ADDRESS,
67+
"has_positive_rebasing_tokens": False,
68+
},
69+
"crveth": {
70+
"pool": "0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511",
71+
"lp_token": "0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d",
72+
"gauge": "0x1cEBdB0856dd985fAe9b8fEa2262469360B8a3a6",
73+
"zap": ZERO_ADDRESS,
74+
"num_coins": 2,
75+
"name": "crveth",
76+
"base_pool": ZERO_ADDRESS,
77+
"has_positive_rebasing_tokens": False,
78+
},
79+
"cvxeth": {
80+
"pool": "0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4",
81+
"lp_token": "0x3A283D9c08E8b55966afb64C515f5143cf907611",
82+
"gauge": "0x7E1444BA99dcdFfE8fBdb42C02F0005D14f13BE1",
83+
"zap": ZERO_ADDRESS,
84+
"num_coins": 2,
85+
"name": "cvxeth",
86+
"base_pool": ZERO_ADDRESS,
87+
"has_positive_rebasing_tokens": False,
88+
},
89+
"xaut3crv": {
90+
"pool": "0xAdCFcf9894335dC340f6Cd182aFA45999F45Fc44",
91+
"lp_token": "0x8484673cA7BfF40F82B041916881aeA15ee84834",
92+
"gauge": "0x1B3E14157ED33F60668f2103bCd5Db39a1573E5B",
93+
"zap": "0xc5FA220347375ac4f91f9E4A4AAb362F22801504",
94+
"num_coins": 2,
95+
"name": "xaut3crv",
96+
"base_pool": base_pools["tripool"]["pool"],
97+
"has_positive_rebasing_tokens": False,
98+
},
99+
"spelleth": {
100+
"pool": "0x98638FAcf9a3865cd033F36548713183f6996122",
101+
"lp_token": "0x8282BD15dcA2EA2bDf24163E8f2781B30C43A2ef",
102+
"gauge": "0x08380a4999Be1a958E2abbA07968d703C7A3027C",
103+
"zap": ZERO_ADDRESS,
104+
"num_coins": 2,
105+
"name": "spelleth",
106+
"base_pool": ZERO_ADDRESS,
107+
"has_positive_rebasing_tokens": False,
108+
},
109+
"teth": {
110+
"pool": "0x752eBeb79963cf0732E9c0fec72a49FD1DEfAEAC",
111+
"lp_token": "0xCb08717451aaE9EF950a2524E33B6DCaBA60147B",
112+
"gauge": "0x6070fBD4E608ee5391189E7205d70cc4A274c017",
113+
"zap": ZERO_ADDRESS,
114+
"num_coins": 2,
115+
"name": "teth",
116+
"base_pool": ZERO_ADDRESS,
117+
"has_positive_rebasing_tokens": False,
118+
},
119+
"eurocusd": {
120+
"pool": "0xE84f5b1582BA325fDf9cE6B0c1F087ccfC924e54",
121+
"lp_token": "0x70fc957eb90e37af82acdbd12675699797745f68",
122+
"gauge": "0x4329c8F09725c0e3b6884C1daB1771bcE17934F9",
123+
"zap": "0xd446a98f88e1d053d1f64986e3ed083bb1ab7e5a",
124+
"num_coins": 2,
125+
"name": "eurocusd",
126+
"base_pool": base_pools["tripool"]["pool"],
127+
"has_positive_rebasing_tokens": False,
128+
},
139129
}
140130

141-
return pool_data
142-
143131

144132
@pytest.fixture(scope="module")
145133
def max_coins():

0 commit comments

Comments
 (0)