Skip to content

Commit

Permalink
Merge pull request #57 from dfinity/arshavir/download-test-wasm
Browse files Browse the repository at this point in the history
Download test wasm instead of recompiling it
  • Loading branch information
aterga authored Dec 28, 2023
2 parents f338343 + ee072b4 commit 69ef3ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deploy_dapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-

if [[ -z "${WASM}" ]]
then
dfx build --network "${NETWORK}" "${NAME}"
export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm"
dfx build --network "${NETWORK}" "${NAME}"
fi

dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}"
13 changes: 11 additions & 2 deletions deploy_test_canister.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 69ef3ee

Please sign in to comment.