From d634a7bd16fe173f6f3bb265ea8040a07256e633 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 27 Dec 2023 15:55:24 +0100 Subject: [PATCH 1/2] first --- deploy_dapp.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy_dapp.sh b/deploy_dapp.sh index b71f364..19a327b 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -14,8 +14,9 @@ dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa- if [[ -z "${WASM}" ]] then - dfx build --network "${NETWORK}" "${NAME}" + # dfx build --network "${NETWORK}" "${NAME}" -- TODO: Make this step optional export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm" + curl --fail -L https://github.com/dfinity/sns-testing/releases/download/test-wasm-rc-1/test.wasm -o "${WASM}" fi dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}" From ee072b43a485b253fb532008ef3f29eff4ca6de1 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 27 Dec 2023 19:03:02 +0100 Subject: [PATCH 2/2] second --- deploy_dapp.sh | 3 +-- deploy_test_canister.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/deploy_dapp.sh b/deploy_dapp.sh index 19a327b..43cc234 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -14,9 +14,8 @@ dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa- if [[ -z "${WASM}" ]] then - # dfx build --network "${NETWORK}" "${NAME}" -- TODO: Make this step optional export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm" - curl --fail -L https://github.com/dfinity/sns-testing/releases/download/test-wasm-rc-1/test.wasm -o "${WASM}" + dfx build --network "${NETWORK}" "${NAME}" fi dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}" diff --git a/deploy_test_canister.sh b/deploy_test_canister.sh index ad6b508..5afb8de 100755 --- a/deploy_test_canister.sh +++ b/deploy_test_canister.sh @@ -6,9 +6,18 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" . ./constants.sh normal +export NAME="test" +export WASM_FILE_NAME="${NAME}.wasm" +export WASM_LOCATION=".dfx/${DX_NETWORK}/canisters/${NAME}" +export WASM="${WASM_LOCATION}/test.wasm" +mkdir -p "${WASM_LOCATION}" +curl --fail -L "https://github.com/dfinity/sns-testing/releases/download/test-wasm-rc-1/${WASM_FILE_NAME}" -o "${WASM}" + +# TODO: Set WASM="" in case the caller of this script opts for re-compiling the test canister. + if [ -f "./sns_canister_ids.json" ] then - ./deploy_dapp.sh "test" "" "(opt record {sns_governance = opt principal\"${SNS_GOVERNANCE_CANISTER_ID}\"; greeting = null;})" + ./deploy_dapp.sh "test" "${WASM}" "(opt record {sns_governance = opt principal\"${SNS_GOVERNANCE_CANISTER_ID}\"; greeting = null;})" else - ./deploy_dapp.sh "test" "" "(opt record {sns_governance = null; greeting = null;})" + ./deploy_dapp.sh "test" "${WASM}" "(opt record {sns_governance = null; greeting = null;})" fi