-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: merged icp-proxy branch, updated logic for ledger ID, fixed tests
- Loading branch information
Showing
17 changed files
with
595 additions
and
501 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Exit on error | ||
#!/bin/sh | ||
set -e | ||
|
||
# Ensure we have the wasm32 target | ||
rustup target add wasm32-unknown-unknown | ||
cd "$(dirname $0)" | ||
|
||
# Build the contract | ||
cargo build --target wasm32-unknown-unknown --release | ||
TARGET="${CARGO_TARGET_DIR:-./target}" | ||
|
||
rustup target add wasm32-unknown-unknown | ||
|
||
# Generate the candid interface | ||
candid-extractor target/wasm32-unknown-unknown/release/context_contract.wasm > context_contract.did | ||
cargo build --target wasm32-unknown-unknown --profile app-release | ||
|
||
# Stop the replica | ||
dfx stop | ||
mkdir -p res | ||
|
||
# Start the replica | ||
dfx start --background | ||
cp $TARGET/wasm32-unknown-unknown/app-release/context_contract.wasm ./res/context_contract.wasm | ||
|
||
# Deploy the contract | ||
dfx deploy | ||
if command -v wasm-opt > /dev/null; then | ||
wasm-opt -Oz ./res/context_contract.wasm -o ./res/context_contract.wasm | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Build the contract | ||
bash ./build.sh | ||
|
||
# Generate the candid interface | ||
candid-extractor res/context_contract.wasm > context_contract.did | ||
|
||
# Stop the replica | ||
dfx stop | ||
|
||
# Start the replica | ||
dfx start --background | ||
|
||
# Deploy the contract | ||
dfx deploy |
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
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
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Exit on error | ||
#!/bin/sh | ||
set -e | ||
|
||
# Ensure we have the wasm32 target | ||
cd "$(dirname $0)" | ||
|
||
TARGET="${CARGO_TARGET_DIR:-./target}" | ||
|
||
rustup target add wasm32-unknown-unknown | ||
|
||
# Build the contract | ||
cargo build --target wasm32-unknown-unknown --release | ||
cargo build --target wasm32-unknown-unknown --profile app-release | ||
|
||
# Generate the candid interface | ||
candid-extractor target/wasm32-unknown-unknown/release/proxy_contract.wasm > proxy_contract.did | ||
mkdir -p res | ||
|
||
# Stop the replica | ||
dfx stop | ||
cp $TARGET/wasm32-unknown-unknown/app-release/proxy_contract.wasm ./res/proxy_contract.wasm | ||
|
||
# Start the replica | ||
dfx start --background | ||
if command -v wasm-opt > /dev/null; then | ||
wasm-opt -Oz ./res/proxy_contract.wasm -o ./res/proxy_contract.wasm | ||
fi |
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 |
---|---|---|
@@ -1,10 +1,29 @@ | ||
cd "mock/ledger" | ||
cargo build --target wasm32-unknown-unknown --release | ||
candid-extractor target/wasm32-unknown-unknown/release/mock_ledger.wasm > mock_ledger.did | ||
#!/bin/sh | ||
set -e | ||
|
||
cd ../.. | ||
# Get the absolute path to the workspace root | ||
WORKSPACE_ROOT="$(cd "$(dirname "$0")/../../../" && pwd)" | ||
|
||
cd "mock/external" | ||
cargo build --target wasm32-unknown-unknown --release | ||
candid-extractor target/wasm32-unknown-unknown/release/mock_external.wasm > mock_external.did | ||
cd "$(dirname $0)" | ||
|
||
echo "Building proxy contract..." | ||
./build.sh | ||
|
||
echo "Building test-ledger contract..." | ||
(cd "$WORKSPACE_ROOT" && cargo build \ | ||
--target wasm32-unknown-unknown \ | ||
--profile app-release \ | ||
-p mock_ledger) | ||
mkdir -p mock/ledger/res | ||
cp "$WORKSPACE_ROOT/target/wasm32-unknown-unknown/app-release/mock_ledger.wasm" mock/ledger/res/ | ||
|
||
echo "Building test-external contract..." | ||
(cd "$WORKSPACE_ROOT" && cargo build \ | ||
--target wasm32-unknown-unknown \ | ||
--profile app-release \ | ||
-p mock_external) | ||
mkdir -p mock/external/res | ||
cp "$WORKSPACE_ROOT/target/wasm32-unknown-unknown/app-release/mock_external.wasm" mock/external/res/ | ||
|
||
echo "Building context-config contract..." | ||
(cd ../context-config && ./build.sh) |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
cd "$(dirname $0)" | ||
|
||
TARGET="${CARGO_TARGET_DIR:-../../target}" | ||
|
||
rustup target add wasm32-unknown-unknown | ||
|
||
cargo build --target wasm32-unknown-unknown --profile app-release | ||
|
||
mkdir -p res | ||
|
||
cp $TARGET/wasm32-unknown-unknown/app-release/mock_external.wasm ./res/ | ||
|
||
if command -v wasm-opt > /dev/null; then | ||
wasm-opt -Oz ./res/mock_external.wasm -o ./res/mock_external.wasm | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
cd "$(dirname $0)" | ||
|
||
TARGET="${CARGO_TARGET_DIR:-./target}" | ||
|
||
rustup target add wasm32-unknown-unknown | ||
|
||
cargo build --target wasm32-unknown-unknown --profile app-release | ||
|
||
mkdir -p res | ||
|
||
cp $TARGET/wasm32-unknown-unknown/app-release/mock_ledger.wasm ./res/mock_ledger.wasm | ||
|
||
if command -v wasm-opt > /dev/null; then | ||
wasm-opt -Oz ./res/mock_ledger.wasm -o ./res/mock_ledger.wasm | ||
fi |
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
Oops, something went wrong.