Skip to content

Commit bacef5d

Browse files
committed
Update ton
1 parent 159805e commit bacef5d

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def finalize_options(self):
3131

3232
setup(
3333
name="tonpy" if not IS_DEV else "tonpy-dev",
34-
version="0.0.0.1.2c0" if not IS_DEV else "0.0.0.5.6a1",
34+
version="0.0.0.1.2c0" if not IS_DEV else "0.0.0.5.6b1",
3535
author="Disintar LLP",
3636
author_email="andrey@head-labs.com",
3737
description="Types / API for TON blockchain",

src/tonpy/compare/tvm_run.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
import multiprocessing
1212
from tonpy.tvm.c7 import C7
1313
from tqdm import tqdm
14-
from c7_data import c7_data
14+
from tonpy.tests.c7_data import c7_data
1515
from tonpy.scheduler import init_thread_scheduler
1616

1717
faulthandler.enable()
1818

1919

2020
def f(params):
21-
"""Synchronous function: Creates TVM, sets C7, and runs."""
2221
index, code, c7_entry = params # Unpack arguments
2322
if isinstance(c7_entry, Cell):
2423
c7_entry = C7(time=321, block_lt=999, trans_lt=291, global_config=c7_entry).to_stack_entry()
@@ -34,14 +33,12 @@ def f(params):
3433

3534

3635
async def af(tvm_instance):
37-
"""Asynchronous function execution."""
3836
final_stack = await tvm_instance.arun(True, allow_non_success=True)
3937
assert tvm_instance.success is False
4038
return True
4139

4240

4341
def run_multiprocessing(num_instances, code, c7_data):
44-
"""Run TVM instances in parallel using multiprocessing."""
4542
params = [(i, code, c7_data) for i in range(num_instances)] # Generate args for processes
4643
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
4744
results = pool.map(f, params, chunksize=1)
@@ -50,7 +47,7 @@ def run_multiprocessing(num_instances, code, c7_data):
5047

5148
@pytest.mark.asyncio
5249
async def test_tvm_c7_complex(cs, mode):
53-
init_thread_scheduler(128)
50+
init_thread_scheduler(30)
5451

5552
code = """<{ ZERO ZERO WHILE:<{ 1 INT }>DO<{ DUP }> }>c"""
5653
num_instances = cs

src/tonpy/tvm/tvm.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,8 @@ def run(self, unpack_stack=True, allow_non_success=False) -> Union[Stack, List]:
107107
# def arun_vm(self):
108108
# return self.tvm.run_vm()
109109

110-
async def arun_vm(self):
111-
self.tvm.start_async_vm()
112-
113-
while (result := self.tvm.check_async_vm()) is None:
114-
await asyncio.sleep(0.01)
115-
116-
return result
117-
118110
async def arun(self, unpack_stack=True, allow_non_success=False):
119-
st = Stack(prev_stack=await self.arun_vm())
111+
st = Stack(prev_stack=await self.tvm.arun_vm())
120112

121113
if allow_non_success is False:
122114
assert self.exit_code in [-1, 0], \

0 commit comments

Comments
 (0)