Skip to content

Commit a3b5b29

Browse files
authored
Update graviton and ensuing dependencies (#598)
1 parent 38934d2 commit a3b5b29

5 files changed

Lines changed: 22 additions & 21 deletions

File tree

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
black==22.3.0
2-
flake8==4.0.1
2+
flake8==5.0.4
33
flake8-tidy-imports==4.6.0
4-
graviton@git+https://github.com/algorand/graviton@v0.3.0
4+
graviton@git+https://github.com/algorand/graviton@v0.5.0
55
mypy==0.950
6-
pytest==7.1.1
6+
pytest==7.2.0
77
pytest-cov==3.0.0
88
pytest-timeout==2.1.0
9-
pytest-xdist==2.5.0
9+
pytest-xdist==3.0.2
1010
types-setuptools==57.4.18

tests/blackbox.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from graviton import blackbox
88
from graviton.blackbox import DryRunInspector, DryRunExecutor
9+
from graviton.models import PyTypes
910

1011
from pyteal.ast.subroutine import OutputKwArgInfo
1112

@@ -404,23 +405,23 @@ def compile(self, version: int, assemble_constants: bool = False) -> str:
404405

405406
def dryrun_on_sequence(
406407
self,
407-
inputs: list[Sequence[str | int]],
408+
inputs: list[Sequence[PyTypes]],
408409
compiler_version=6,
409410
) -> list[DryRunInspector]:
410411
return _MatchMode(
411412
app_case=lambda: DryRunExecutor.dryrun_app_on_sequence(
412-
algod_with_assertion(),
413-
self.compile(compiler_version),
414-
inputs,
415-
self.abi_argument_types(),
416-
self.abi_return_type(),
413+
algod=algod_with_assertion(),
414+
teal=self.compile(compiler_version),
415+
inputs=inputs,
416+
abi_argument_types=self.abi_argument_types(),
417+
abi_return_type=self.abi_return_type(),
417418
),
418419
signature_case=lambda: DryRunExecutor.dryrun_logicsig_on_sequence(
419-
algod_with_assertion(),
420-
self.compile(compiler_version),
421-
inputs,
422-
self.abi_argument_types(),
423-
self.abi_return_type(),
420+
algod=algod_with_assertion(),
421+
teal=self.compile(compiler_version),
422+
inputs=inputs,
423+
abi_argument_types=self.abi_argument_types(),
424+
abi_return_type=self.abi_return_type(),
424425
),
425426
)(self.mode)
426427

tests/integration/abi_roundtrip_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import algosdk.abi
77

8-
from graviton.abi_strategy import ABIStrategy
8+
from graviton.abi_strategy import RandomABIStrategy
99

1010
from pyteal import abi
1111

@@ -248,8 +248,8 @@ def test_roundtrip(abi_type):
248248
)
249249
return
250250

251-
abi_strat = ABIStrategy(sdk_abi_types[0], dynamic_length=dynamic_length)
252-
rand_abi_instance = abi_strat.get_random()
251+
abi_strat = RandomABIStrategy(sdk_abi_types[0], dynamic_length=dynamic_length)
252+
rand_abi_instance = abi_strat.get()
253253
args = (rand_abi_instance,)
254254
inspector = roundtripper.dryrun(args)
255255

tests/integration/graviton_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def blackbox_test_runner(
537537

538538
invariant = Invariant(predicate, name=f"{case_name}[{i}]@{mode}-{dr_prop}")
539539
print(f"{i+1}. Assertion for {case_name}-{mode}: {dr_prop} <<{predicate}>>")
540-
invariant.validates(dr_prop, inputs, inspectors)
540+
invariant.validates(dr_prop, inspectors)
541541

542542

543543
# ---- Graviton / Blackbox tests ---- #
@@ -729,7 +729,7 @@ def euclid(x, y):
729729

730730
# Assert that each invariant holds on the sequences of inputs and dry-runs:
731731
for property, predicate in predicates.items():
732-
Invariant(predicate).validates(property, inputs, inspectors)
732+
Invariant(predicate).validates(property, inspectors)
733733

734734

735735
def blackbox_pyteal_example4():

tests/integration/pure_logicsig_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def payment_amount(x, y):
105105
lambda args: bool(payment_amount(*args)),
106106
name=f"passing invariant for coeffs {a, p, q}",
107107
)
108-
passing_invariant.validates(DRProp.passed, inputs, inspectors)
108+
passing_invariant.validates(DRProp.passed, inspectors)
109109

110110
print(
111111
f"validate procedurally that payment amount as expected for (a,p,q) = {a,p,q} over {M, N} dry-rundry-run calls"

0 commit comments

Comments
 (0)