This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gregory Edison <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,12 +32,12 @@ for arg in "$@"; do | |
deploy) | ||
run_deploy=true | ||
;; | ||
--staging) | ||
ENV="kakarot-staging" | ||
;; | ||
--sepolia) | ||
ENV="sepolia" | ||
;; | ||
--staging) | ||
ENV="sepolia-staging" | ||
;; | ||
*) | ||
echo "Unknown argument: ${arg}" | ||
usage | ||
|
@@ -50,48 +50,38 @@ if [ -z "${ENV}" ]; then | |
echo "Please provide the environment to test against" | ||
exit 1 | ||
fi | ||
if [ -z "${INFURA_KEY}" ]; then | ||
echo "Please provide the INFURA_KEY environment variable" | ||
exit 1 | ||
fi | ||
|
||
cd ../lib/kakarot || exit | ||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" | ||
export L1_RPC_URL="https://sepolia.infura.io/v3/${INFURA_KEY}" | ||
export STARKNET_NETWORK="${ENV}" | ||
|
||
# Set the environment variables based on the provided environment | ||
if [ "${ENV}" = "sepolia" ]; then | ||
export RPC_URL="https://juno-kakarot-sepolia.karnot.xyz" | ||
export RPC_NAME="starknet-sepolia" | ||
export CHECK_INTERVAL=1 | ||
export MAX_WAIT=50 | ||
# Note: you might need to modify the following values in `lib/kakarot/kakarot_scripts/constants.py`: | ||
# - NETWORKS["sepolia"].rpc_url = https://juno-kakarot-sepolia.karnot.xyz | ||
# - NETWORKS["sepolia"].max_wait = 40 | ||
export STARKNET_SEPOLIA_RPC_URL="https://juno-kakarot-sepolia.karnot.xyz" | ||
export WEB3_HTTP_PROVIDER_URI="https://rpc-kakarot-sepolia.karnot.xyz/" | ||
if [ -z "${STARKNET_SEPOLIA_ACCOUNT_ADDRESS}" ]; then | ||
echo "Please provide the STARKNET_SEPOLIA_ACCOUNT_ADDRESS environment variable." | ||
echo "Please provide the STARKNET_SEPOLIA_ACCOUNT_ADDRESS environment variable" | ||
exit 1 | ||
fi | ||
if [ -z "${STARKNET_SEPOLIA_PRIVATE_KEY}" ]; then | ||
echo "Please provide the STARKNET_SEPOLIA_PRIVATE_KEY environment variable." | ||
echo "Please provide the STARKNET_SEPOLIA_PRIVATE_KEY environment variable" | ||
exit 1 | ||
fi | ||
if [ -z "${EVM_PRIVATE_KEY}" ]; then | ||
echo "Please provide the EVM_PRIVATE_KEY environment variable." | ||
echo "Please provide the EVM_PRIVATE_KEY environment variable" | ||
exit 1 | ||
fi | ||
SKIP="--ignore tests/end_to_end/L1L2Messaging --ignore tests/end_to_end/CairoPrecompiles --ignore tests/end_to_end/EvmPrecompiles --ignore tests/end_to_end/test_kakarot.py" | ||
elif [ "${ENV}" = "sepolia-staging" ]; then | ||
elif [ "${ENV}" = "kakarot-staging" ]; then | ||
export EVM_PRIVATE_KEY="0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" | ||
export RPC_URL="https://juno-kakarot-sepolia.karnot.xyz/" | ||
export RPC_NAME="starknet-sepolia-staging" | ||
export CHECK_INTERVAL=1 | ||
export MAX_WAIT=50 | ||
export WEB3_HTTP_PROVIDER_URI="https://rpc-kakarot-sepolia-staging.karnot.xyz/" | ||
if [ -z "${STARKNET_SEPOLIA_STAGING_ACCOUNT_ADDRESS}" ]; then | ||
echo "Please provide the STARKNET_SEPOLIA_STAGING_ACCOUNT_ADDRESS environment variable." | ||
exit 1 | ||
fi | ||
if [ -z "${STARKNET_SEPOLIA_STAGING_PRIVATE_KEY}" ]; then | ||
echo "Please provide the STARKNET_SEPOLIA_STAGING_PRIVATE_KEY environment variable." | ||
export KAKAROT_STAGING_RPC_URL="https://juno-kakarot-testnet-stage.karnot.xyz" | ||
export KAKAROT_STAGING_ACCOUNT_ADDRESS="0x7ecf6cd45c32ce84812e660cc176cb8b4de2e7a6d5916fe326bf871466fbe02" | ||
export WEB3_HTTP_PROVIDER_URI="https://kkrt-rpc-kakarot-testnet-stage.karnot.xyz" | ||
if [ -z "${KAKAROT_STAGING_PRIVATE_KEY}" ]; then | ||
echo "Please provide the KAKAROT_STAGING_PRIVATE_KEY environment variable. The private key should be loaded using gpg: gpg -r [email protected] --decrypt path/to/encrypted/key.gpg" | ||
exit 1 | ||
fi | ||
|
||
|
@@ -102,21 +92,21 @@ fi | |
if ${run_deploy}; then | ||
echo "Deploying the contracts to the ${ENV} environment" | ||
|
||
uv sync --all-extras --dev && make build-sol && make build | ||
uv run deploy | ||
make setup && make build-sol && make build && make fetch-ssj-artifacts && make build-cairo1 | ||
uv run python ./kakarot_scripts/deploy_kakarot.py | ||
fi | ||
|
||
# Run the tests if the test command is provided | ||
if ${run_test}; then | ||
echo "Running tests for the ${ENV} environment. Skipping: ${SKIP}" | ||
|
||
KAKAROT_ADDRESS=$(jq -r '.kakarot' ./deployments/starknet-"${ENV}"/deployments.json) | ||
UNINITIALIZED_ACCOUNT_CLASS_HASH=$(jq -r '.uninitialized_account' ./deployments/starknet-"${ENV}"/declarations.json) | ||
ACCOUNT_CONTRACT_CLASS_HASH=$(jq -r '.account_contract' ./deployments/starknet-"${ENV}"/declarations.json) | ||
KAKAROT_ADDRESS=$(jq -r '.kakarot.address' ./deployments/kakarot-"${ENV}"/deployments.json) | ||
UNINITIALIZED_ACCOUNT_CLASS_HASH=$(jq -r '.uninitialized_account' ./deployments/kakarot-"${ENV}"/declarations.json) | ||
ACCOUNT_CONTRACT_CLASS_HASH=$(jq -r '.account_contract' ./deployments/kakarot-"${ENV}"/declarations.json) | ||
|
||
export KAKAROT_ADDRESS="${KAKAROT_ADDRESS}" | ||
export UNINITIALIZED_ACCOUNT_CLASS_HASH="${UNINITIALIZED_ACCOUNT_CLASS_HASH}" | ||
export ACCOUNT_CONTRACT_CLASS_HASH="${ACCOUNT_CONTRACT_CLASS_HASH}" | ||
|
||
eval "uv run pytest -s tests/end_to_end -k 'test_should_return_data_median_for_query' ${SKIP}" | ||
eval "uv run pytest -s tests/end_to_end ${SKIP}" | ||
fi |