Skip to content

Commit

Permalink
test(py): resolve starknet_version
Browse files Browse the repository at this point in the history
  • Loading branch information
Joonas Koivunen committed Jul 20, 2022
1 parent 13b900e commit 8b728b5
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion py/src/test_call.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from call import do_loop, loop_inner, EXPECTED_SCHEMA_REVISION, check_cairolang_version
from call import (
do_loop,
loop_inner,
EXPECTED_SCHEMA_REVISION,
check_cairolang_version,
resolve_block,
)
import sqlite3
import io
import json
Expand Down Expand Up @@ -463,6 +469,23 @@ def test_fee_estimate_on_positive():
}


def test_starknet_version_is_resolved():
# using the existing setup, but just updating the one block to have a bogus version
con = inmemory_with_tables()
_ = populate_test_contract_with_132_on_3(con)

con.execute("BEGIN")
cursor = con.execute(
"INSERT INTO starknet_versions (version) VALUES (?)", ["0.9.1"]
)
version_id = cursor.lastrowid

con.execute("UPDATE starknet_blocks SET version_id = ?", [version_id])
(info, _root) = resolve_block(con, "latest", None)

assert info.starknet_version == "0.9.1"


@pytest.mark.skip(reason="this requires up to 2804 block synced database")
def test_failing_mainnet_tx2():
from starkware.starknet.definitions.general_config import StarknetChainId
Expand Down

0 comments on commit 8b728b5

Please sign in to comment.