Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python code for cairo-lang 0.8.1 release #230

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py/requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# see README.md
cairo-lang==0.8.0
cairo-lang==0.8.1
# We don't use rlp directly, however this needs to be defined for it to help pip-compile
eth-rlp==0.2.1
pip-tools==6.4.0
Expand Down
2 changes: 1 addition & 1 deletion py/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ black==21.12b0
# via -r requirements-dev.in
cachetools==5.0.0
# via cairo-lang
cairo-lang==0.8.0
cairo-lang==0.8.1
# via -r requirements-dev.in
certifi==2021.10.8
# via requests
Expand Down
9 changes: 5 additions & 4 deletions py/src/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def check_cairolang_version():
import pkg_resources

version = pkg_resources.get_distribution("cairo-lang").version
return version == "0.8.0"
return version == "0.8.1"


def do_loop(connection, input_gen, output_file):
Expand Down Expand Up @@ -229,7 +229,8 @@ def check_schema(connection):


def resolve_block(connection, at_block):
from starkware.starknet.business_logic.state import BlockInfo
from starkware.starknet.business_logic.state.state import BlockInfo
from starkware.starknet.definitions.general_config import DEFAULT_GAS_PRICE

if at_block == "latest":
# latest is questionable, but the rust side cannot use it at the moment at least,
Expand Down Expand Up @@ -258,7 +259,7 @@ def resolve_block(connection, at_block):
# NOTE: this assumes the rust side to serialize starknet_blocks::timestamp as compatible
# for blocks before 0.7.0
return (
BlockInfo(block_number, block_time),
BlockInfo(block_number, block_time, DEFAULT_GAS_PRICE),
global_root,
)
except Exception:
Expand Down Expand Up @@ -420,7 +421,7 @@ async def do_call(

Returns the retdata from the call, which is the only property needed by the RPC api.
"""
from starkware.starknet.business_logic.state import (
from starkware.starknet.business_logic.state.state import (
SharedState,
StateSelector,
)
Expand Down
2 changes: 1 addition & 1 deletion py/src/generate_test_global_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def generate_root_and_nodes(input):
from starkware.starkware_utils.commitment_tree.patricia_tree.patricia_tree import (
PatriciaTree,
)
from starkware.starknet.business_logic.state_objects import ContractState
from starkware.starknet.business_logic.state.objects import ContractState
from copy import deepcopy

# still create this for the ffc it creates.
Expand Down