Created
June 1, 2022 21:38
-
-
Save 0xNonCents/a1b7a5543637afd3611cbe656060d709 to your computer and use it in GitHub Desktop.
Running Cairo Tests without step limit and allowing hints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import os | |
import pytest | |
from starkware.starknet.testing.starknet import Starknet | |
from starkware.starknet.compiler.compile import compile_starknet_files | |
from starkware.starknet.definitions.general_config import build_general_config, default_general_config | |
CONTRACT = os.path.join("contracts", "contract_name.cairo") | |
@pytest.fixture(scope="module") | |
async def starknet_factory(): | |
MAX_STEPS = 10 ** 60 | |
default_config = default_general_config | |
default_config['invoke_tx_max_n_steps'] = MAX_STEPS | |
config = build_general_config(default_config) | |
starknet = await Starknet.empty(config) | |
return starknet | |
@pytest.fixture(scope="module") | |
async def contract_factory(starknet_factory): | |
starknet = starknet_factory | |
# Deploy the account contract | |
contract_def = compile_starknet_files( | |
files=[CONTRACT], disable_hint_validation=True | |
) | |
contract = await starknet.deploy(contract_def=contract_def) | |
return contract |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment