Skip to content

Commit

Permalink
Update graviton and ensuing dependencies (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaffi committed Nov 14, 2022
1 parent 38934d2 commit a3b5b29
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
black==22.3.0
flake8==4.0.1
flake8==5.0.4
flake8-tidy-imports==4.6.0
graviton@git+https://github.com/algorand/graviton@v0.3.0
graviton@git+https://github.com/algorand/graviton@v0.5.0
mypy==0.950
pytest==7.1.1
pytest==7.2.0
pytest-cov==3.0.0
pytest-timeout==2.1.0
pytest-xdist==2.5.0
pytest-xdist==3.0.2
types-setuptools==57.4.18
23 changes: 12 additions & 11 deletions tests/blackbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from graviton import blackbox
from graviton.blackbox import DryRunInspector, DryRunExecutor
from graviton.models import PyTypes

from pyteal.ast.subroutine import OutputKwArgInfo

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

def dryrun_on_sequence(
self,
inputs: list[Sequence[str | int]],
inputs: list[Sequence[PyTypes]],
compiler_version=6,
) -> list[DryRunInspector]:
return _MatchMode(
app_case=lambda: DryRunExecutor.dryrun_app_on_sequence(
algod_with_assertion(),
self.compile(compiler_version),
inputs,
self.abi_argument_types(),
self.abi_return_type(),
algod=algod_with_assertion(),
teal=self.compile(compiler_version),
inputs=inputs,
abi_argument_types=self.abi_argument_types(),
abi_return_type=self.abi_return_type(),
),
signature_case=lambda: DryRunExecutor.dryrun_logicsig_on_sequence(
algod_with_assertion(),
self.compile(compiler_version),
inputs,
self.abi_argument_types(),
self.abi_return_type(),
algod=algod_with_assertion(),
teal=self.compile(compiler_version),
inputs=inputs,
abi_argument_types=self.abi_argument_types(),
abi_return_type=self.abi_return_type(),
),
)(self.mode)

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/abi_roundtrip_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import algosdk.abi

from graviton.abi_strategy import ABIStrategy
from graviton.abi_strategy import RandomABIStrategy

from pyteal import abi

Expand Down Expand Up @@ -248,8 +248,8 @@ def test_roundtrip(abi_type):
)
return

abi_strat = ABIStrategy(sdk_abi_types[0], dynamic_length=dynamic_length)
rand_abi_instance = abi_strat.get_random()
abi_strat = RandomABIStrategy(sdk_abi_types[0], dynamic_length=dynamic_length)
rand_abi_instance = abi_strat.get()
args = (rand_abi_instance,)
inspector = roundtripper.dryrun(args)

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/graviton_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def blackbox_test_runner(

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


# ---- Graviton / Blackbox tests ---- #
Expand Down Expand Up @@ -729,7 +729,7 @@ def euclid(x, y):

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


def blackbox_pyteal_example4():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pure_logicsig_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def payment_amount(x, y):
lambda args: bool(payment_amount(*args)),
name=f"passing invariant for coeffs {a, p, q}",
)
passing_invariant.validates(DRProp.passed, inputs, inspectors)
passing_invariant.validates(DRProp.passed, inspectors)

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

0 comments on commit a3b5b29

Please sign in to comment.