Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Update to cairo-lang 0.10.3 #360

Merged
merged 9 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix expected values
  • Loading branch information
FabijanC committed Dec 5, 2022
commit d88cd68f4f409643e6b8c49266413fd59ef90a62
4 changes: 2 additions & 2 deletions page/docs/guide/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Installing the package adds the `starknet-devnet` command.
usage: starknet-devnet [-h] [-v] [--host HOST] [--port PORT] [--load-path LOAD_PATH] [--dump-path DUMP_PATH] [--dump-on DUMP_ON] [--lite-mode] [--accounts ACCOUNTS]
[--initial-balance INITIAL_BALANCE] [--seed SEED] [--hide-predeployed-accounts] [--start-time START_TIME] [--gas-price GAS_PRICE] [--timeout TIMEOUT]
[--account-class ACCOUNT_CLASS] [--fork-network FORK_NETWORK] [--fork-block FORK_BLOCK]
[--chain_id CHAIN_ID]
[--chain-id CHAIN_ID]

Run a local instance of StarkNet Devnet

Expand Down Expand Up @@ -43,7 +43,7 @@ optional arguments:
Specify the network to fork: can be a URL (e.g. https://alpha-mainnet.starknet.io) or network name (valid names: alpha-goerli, alpha-goerli2, alpha-mainnet)
--fork-block FORK_BLOCK
Specify the block number where the --fork-network is forked; defaults to latest
--chain_id CHAIN_ID
--chain-id CHAIN_ID
Specify the chain id as string: {MAINNET, TESTNET, TESTNET2}
```

Expand Down
3 changes: 3 additions & 0 deletions scripts/check_starknet_artifacts_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ set -o pipefail

echo "Checking if starknet contracts are compiled using the latest compiler..."

# Use contract.cairo to test
COMPILED=$(jq -r ".program.compiler_version" test/artifacts/contracts/cairo/contract.cairo/contract.json)
echo "Compiled with: $COMPILED"
INSTALLED=$(poetry run starknet-compile --version | sed -rn "s/^starknet-compile (.*)$/\1/p")
echo "Installed: $INSTALLED"

if [ "$COMPILED" != "$INSTALLED" ]; then
echo "Error: Compiled with version: $COMPILED, installed version: $INSTALLED"
Expand Down
4 changes: 3 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
set -e
set -eu

./scripts/check_starknet_artifacts_version.sh

CMD="poetry run pytest -n auto --dist loadscope -v ${1:-test/}"
echo $CMD
Expand Down
2 changes: 1 addition & 1 deletion starknet_devnet/devnet_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _chain_id(chain_id: str):
chain_id = StarknetChainId[chain_id]
except KeyError:
sys.exit(
f"Error: The value of --chain_id must be in {{{CHAIN_IDS}}}, got: {chain_id}"
f"Error: The value of --chain-id must be in {{{CHAIN_IDS}}}, got: {chain_id}"
)

return chain_id
Expand Down
4 changes: 2 additions & 2 deletions test/expected/deploy_function_invocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"call_type": "CALL",
"calldata": ["0x0"],
"caller_address": "0x0",
"class_hash": "0x4f547ede68edfeb9403f63a1042bc13424b5a29bad2a828a4f6883bc96a4c09",
"contract_address": "0x5536cba44460628d54b12be790b8d1f3827ace5a40f39149d57d6fa04fe9d",
"class_hash": "0x71df7c871d389943e24aaaf85d41594266d12f2f9b580a9f92ba4a0bf763d67",
"contract_address": "0x6f47c70cfad7e0865af23e60e596e4926d557bc3fc26ce96a234d55bfb04857",
"entry_point_type": "CONSTRUCTOR",
"events": [],
"execution_resources": {
Expand Down
6 changes: 3 additions & 3 deletions test/expected/invoke_function_invocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"events": [],
"calldata": [
"0x1",
"0x5536cba44460628d54b12be790b8d1f3827ace5a40f39149d57d6fa04fe9d",
"0x6f47c70cfad7e0865af23e60e596e4926d557bc3fc26ce96a234d55bfb04857",
"0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320",
"0x0",
"0x2",
Expand All @@ -34,7 +34,7 @@
},
"messages": [],
"call_type": "CALL",
"class_hash": "0x4f547ede68edfeb9403f63a1042bc13424b5a29bad2a828a4f6883bc96a4c09",
"class_hash": "0x71df7c871d389943e24aaaf85d41594266d12f2f9b580a9f92ba4a0bf763d67",
"result": [],
"events": [],
"calldata": [
Expand All @@ -44,7 +44,7 @@
"caller_address": "0x347be35996a21f6bf0623e75dbce52baba918ad5ae8d83b6f416045ab22961a",
"entry_point_type": "EXTERNAL",
"selector": "0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320",
"contract_address": "0x5536cba44460628d54b12be790b8d1f3827ace5a40f39149d57d6fa04fe9d",
"contract_address": "0x6f47c70cfad7e0865af23e60e596e4926d557bc3fc26ce96a234d55bfb04857",
"internal_calls": []
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/expected/invoke_receipt_account_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"0x0",
"0xa"
],
"from_address": "0x72db98d364f15c7971de4e19b8b225b25a31f9e9aa3d0084009466208c6a119",
"from_address": "0x5b5c8722ce893e19fc813996e610f0699fbe9b6c685ce175e60d7cbdbb87fa1",
"keys": [
"0x3db3da4221c078e78bd987e54e1cc24570d89a7002cefa33e548d6c72c73f9d"
]
Expand Down
2 changes: 1 addition & 1 deletion test/expected/invoke_receipt_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"0x0",
"0xa"
],
"from_address": "0x72db98d364f15c7971de4e19b8b225b25a31f9e9aa3d0084009466208c6a119",
"from_address": "0x5b5c8722ce893e19fc813996e610f0699fbe9b6c685ce175e60d7cbdbb87fa1",
"keys": [
"0x3db3da4221c078e78bd987e54e1cc24570d89a7002cefa33e548d6c72c73f9d"
]
Expand Down
6 changes: 3 additions & 3 deletions test/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
)

EXPECTED_SALTY_DEPLOY_ADDRESS = (
"0x072db98d364f15c7971de4e19b8b225b25a31f9e9aa3d0084009466208c6a119"
"0x05b5c8722ce893e19fc813996e610f0699fbe9b6c685ce175e60d7cbdbb87fa1"
)
EXPECTED_SALTY_DEPLOY_HASH = (
"0x5db3829a149ab82c9a27e6a32f135cdd061e3939894f95398ab2571e4310b40"
"0x2e750343e63dc7ddf543c196c54018b4e5989acd413e6acafdae62ef2c3146d"
)

EXPECTED_CLASS_HASH = (
"0x4f547ede68edfeb9403f63a1042bc13424b5a29bad2a828a4f6883bc96a4c09"
"0x71df7c871d389943e24aaaf85d41594266d12f2f9b580a9f92ba4a0bf763d67"
)

NONEXISTENT_TX_HASH = "0x1"
Expand Down
2 changes: 1 addition & 1 deletion test/test_block_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def my_get_block_number(address: str):
)


EXPECTED_TX_HASH = "0x565c5f0c1561da745a8a929d6cab60f0e07e5dacd755d01817341fa9512f1ae"
EXPECTED_TX_HASH = "0x2a80a6c3878fb0b68b2da38b4a488276c014d955d1bf17933aefab6cb722121"


@pytest.mark.usefixtures("run_devnet_in_background")
Expand Down
4 changes: 2 additions & 2 deletions test/test_chain_id_cli_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_chain_id_invalid(chain_id):
stdout=subprocess.PIPE,
)
assert (
f"Error: The value of --chain_id must be in {{{CHAIN_IDS}}}, got:"
f"Error: The value of --chain-id must be in {{{CHAIN_IDS}}}, got:"
in read_stream(proc.stderr)
)
assert proc.returncode == 1
Expand All @@ -66,7 +66,7 @@ def test_chain_id_invalid(chain_id):
@pytest.mark.parametrize(
"run_devnet_in_background, chain_id",
[
([*PREDEPLOY_ACCOUNT_CLI_ARGS, "--chain_id", chain_id.name], chain_id)
([*PREDEPLOY_ACCOUNT_CLI_ARGS, "--chain-id", chain_id.name], chain_id)
for chain_id in StarknetChainId
],
indirect=True,
Expand Down
2 changes: 1 addition & 1 deletion test/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def test_deploy(starknet_wrapper_args, expected_block_hash):

assert_hex_equal(
hex(tx_hash),
"0x58e5f41a48e756d686c1b028292d548859f71bb2763d7bbe584c50f9dc36068",
"0x29c0f6e2321da26dd143dc772740526416294e9300634ec646cb525c3eb9c5e",
)
assert contract_address == expected_contract_address

Expand Down
2 changes: 1 addition & 1 deletion test/test_fork_feeder_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

DEPLOYMENT_INPUT = "10"
EXPECTED_DEPLOYMENT_ADDRESS = (
"0x06442b891d63377cc12bd4b7ca4ecd9d6e4cb7eece8aa4051d64c4fe4dcaa98c"
"0x0737ae2bc29753c32794143d098d87f2f96bdcbb9acd83969318522af90e4ebe"
)
EXPECTED_INVOKE_HASH = (
"0x51b501687e77d5433c7fc00b3a6dd25c2f6edf95f506dd9cba2251a4ce9ed43"
Expand Down