From bafbb8e7e4347757dd9d2b66969403b888b39621 Mon Sep 17 00:00:00 2001 From: Asuma Yamada Date: Tue, 20 Aug 2024 21:21:31 -0400 Subject: [PATCH] fix: scripts --- contracts/scripts/create_genesis.sh | 10 +++++----- contracts/scripts/create_snapshot.sh | 6 ++---- contracts/scripts/init_auth.sh | 1 - contracts/scripts/update_scarb.sh | 2 +- contracts/scripts/update_scarb_mac.sh | 4 ++-- contracts/scripts/upload_manifest.sh | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/contracts/scripts/create_genesis.sh b/contracts/scripts/create_genesis.sh index 2b80e0f..927735c 100755 --- a/contracts/scripts/create_genesis.sh +++ b/contracts/scripts/create_genesis.sh @@ -78,12 +78,12 @@ sozo \ # Setup PixeLAW auth and init declare "WORLD"=$(cat $MANIFEST | jq -r '.world.address') -declare "CORE_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.name=="pixelaw::core::actions::actions") | .address') -declare "PAINT_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.name=="pixelaw::apps::paint::app::paint_actions") | .address') -declare "SNAKE_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.name=="pixelaw::apps::snake::app::snake_actions") | .address') +declare "CORE_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.tag=="pixelaw-actions") | .address') +declare "PAINT_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.tag=="pixelaw-paint_actions") | .address') +declare "SNAKE_ACTIONS"=$(cat $MANIFEST | jq -r '.contracts[] | select(.tag=="pixelaw-snake_actions") | .address') -CORE_MODELS=("App" "AppName" "CoreActionsAddress" "Pixel" "Permissions" "QueueItem") -SNAKE_MODELS=("Snake" "SnakeSegment") +CORE_MODELS=("pixelaw-App" "pixelaw-AppName" "pixelaw-CoreActionsAddress" "pixelaw-Pixel" "pixelaw-Permissions" "pixelaw-QueueItem" "pixelaw-Snake" "pixelaw-Instruction") +SNAKE_MODELS=("pixelaw-Snake" "pixelaw-SnakeSegment") echo "Write permissions for CORE_ACTIONS" diff --git a/contracts/scripts/create_snapshot.sh b/contracts/scripts/create_snapshot.sh index 14222a4..0253ca4 100755 --- a/contracts/scripts/create_snapshot.sh +++ b/contracts/scripts/create_snapshot.sh @@ -89,8 +89,8 @@ sleep 1 # Setup PixeLAW auth and init declare "WORLD"=$(cat $MANIFEST | jq -r '.world.address') -CORE_MODELS=("App" "AppName" "CoreActionsAddress" "Pixel" "Permissions" "QueueItem") -SNAKE_MODELS=("Snake" "SnakeSegment") +CORE_MODELS=("pixelaw-App" "pixelaw-AppName" "pixelaw-CoreActionsAddress" "pixelaw-Pixel" "pixelaw-Permissions" "pixelaw-QueueItem" "pixelaw-Snake" "pixelaw-Instruction") +SNAKE_MODELS=("pixelaw-Snake" "pixelaw-SnakeSegment") echo "Start Torii" unset LS_COLORS && torii \ @@ -126,7 +126,6 @@ echo "Write permissions for SNAKE_ACTIONS: Done" echo "Initialize CORE_ACTIONS" sozo --manifest-path $DEPLOY_SCARB --profile $PROFILE execute --wait pixelaw-actions init - echo "Initialize CORE_ACTIONS: Done" echo "Initialize SNAKE_ACTIONS: Done" @@ -135,7 +134,6 @@ echo "Initialize SNAKE_ACTIONS: Done" echo "Initialize PAINT_ACTIONS: Done" sozo --manifest-path $DEPLOY_SCARB --profile $PROFILE execute --wait pixelaw-paint_actions init - echo "Initialize PAINT_ACTIONS: Done" diff --git a/contracts/scripts/init_auth.sh b/contracts/scripts/init_auth.sh index 0d2f01b..98c4d06 100755 --- a/contracts/scripts/init_auth.sh +++ b/contracts/scripts/init_auth.sh @@ -28,7 +28,6 @@ fi # make sure all components/systems are deployed CORE_MODELS=("pixelaw-App" "pixelaw-AppName" "pixelaw-CoreActionsAddress" "pixelaw-Pixel" "pixelaw-Permissions" "pixelaw-QueueItem" "pixelaw-Snake" "pixelaw-Instruction") - SNAKE_MODELS=("pixelaw-Snake" "pixelaw-SnakeSegment") echo "Write permissions for CORE_ACTIONS" diff --git a/contracts/scripts/update_scarb.sh b/contracts/scripts/update_scarb.sh index 969790f..c1a7f43 100755 --- a/contracts/scripts/update_scarb.sh +++ b/contracts/scripts/update_scarb.sh @@ -3,7 +3,7 @@ set -euo pipefail pushd $(dirname "$0")/.. # Get world address from manifest -WORLD_ADDRESS=$(cat target/dev/manifest.json | jq '.world.address') +WORLD_ADDRESS=$(cat manifests/dev/deployment/manifest.json | jq '.world.address') # Check if WORLD_ADDRESS is not "null" if [ "$WORLD_ADDRESS" != "null" ]; then diff --git a/contracts/scripts/update_scarb_mac.sh b/contracts/scripts/update_scarb_mac.sh index 7fe6f21..059f827 100755 --- a/contracts/scripts/update_scarb_mac.sh +++ b/contracts/scripts/update_scarb_mac.sh @@ -3,7 +3,7 @@ set -euo pipefail pushd $(dirname "$0")/.. # Get world address from manifest -WORLD_ADDRESS=$(cat target/dev/manifest.json | jq -r '.world.address') +WORLD_ADDRESS=$(cat manifests/dev/deployment/manifest.json | jq -r '.world.address') # Check if WORLD_ADDRESS is not "null" if [ "$WORLD_ADDRESS" != "null" ]; then @@ -12,4 +12,4 @@ if [ "$WORLD_ADDRESS" != "null" ]; then sed -i '' "s/world_address = \".*\"/world_address = \"$WORLD_ADDRESS\"/" Scarb.toml fi -echo "Scarb.toml has been updated with address(es)" \ No newline at end of file +echo "Scarb.toml has been updated with address(es)" diff --git a/contracts/scripts/upload_manifest.sh b/contracts/scripts/upload_manifest.sh index a4508b8..032d1b5 100755 --- a/contracts/scripts/upload_manifest.sh +++ b/contracts/scripts/upload_manifest.sh @@ -2,7 +2,7 @@ SYSTEMS=("core" "paint" "snake") DEFAULT_BASE_URL="http://localhost:3000/manifests" -JSON_FILE="./target/dev/manifest.json" +JSON_FILE="./manifests/dev/deployment/manifest.json" # Check if a command line argument is provided if [ "$#" -ne 0 ]; then