Skip to content

Commit 04f7f93

Browse files
test: enable eval for vvm
1 parent 4e5a58a commit 04f7f93

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dev = [
2525
]
2626

2727
[tool.uv.sources]
28-
titanoboa = { git = "https://github.com/vyperlang/titanoboa", rev = "master" }
28+
titanoboa = { git = "https://github.com/AlbertoCentonze/titanoboa", rev = "3fdd1d37b6afc64cd2db91352b86cbf658996934" }
2929

3030
[tool.uv]
3131
package = false # This is not a Python package

tests/conftest.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
import os
22
from datetime import timedelta
3+
import uuid
34

45
import boa
56
import pytest
67
from hypothesis import settings, Phase
78
from tests.utils.deploy import Protocol
89
from tests.utils.deployers import (
910
ERC20_MOCK_DEPLOYER,
10-
CONSTANT_MONETARY_POLICY_DEPLOYER,
1111
CONSTANT_MONETARY_POLICY_LENDING_DEPLOYER,
1212
)
1313

14+
def _patch_vvm_eval():
15+
def _eval(self, line: str):
16+
name = f"_boa_eval_{uuid.uuid4().hex}"
17+
assert line.count("\n") == 0
18+
body = "".join(f" {line}")
19+
src = f"def {name}():\n{body}"
20+
21+
self.inject_function(src)
22+
func = getattr(self, name)
23+
return func()
24+
25+
26+
boa.contracts.vvm.vvm_contract.VVMContract.eval = _eval
27+
return True
28+
29+
30+
_patch_vvm_eval()
31+
32+
1433

1534
boa.env.enable_fast_mode()
1635

uv.lock

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

0 commit comments

Comments
 (0)