From 614f6ad7361b7281d5eab6ef984dbac5a40b98c0 Mon Sep 17 00:00:00 2001 From: Ifropc Date: Fri, 20 Dec 2024 11:04:13 -0800 Subject: [PATCH] Update aliases --- docs/build/guides/conventions/workspace.mdx | 23 +++++---------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/build/guides/conventions/workspace.mdx b/docs/build/guides/conventions/workspace.mdx index 8b4110bdd..764c006da 100644 --- a/docs/build/guides/conventions/workspace.mdx +++ b/docs/build/guides/conventions/workspace.mdx @@ -176,25 +176,12 @@ STELLAR_SOURCE_ACCOUNT=alice Second is to deploy the contracts: ```bash -ADD_CONTRACT=`stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_contract.wasm` -MAIN_CONTRACT=`stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/main_contract.wasm` -``` - -This contracts can also be referenced using aliases after running following command: - -```bash -stellar contract alias add --id $ADD_CONTRACT add_contract -stellar contract alias add --id MAIN_CONTRACT main_contract +stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_contract.wasm --alias add_contract +stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/main_contract.wasm --alias main_contract ``` And finally call the main contract: -:::info - -Referencing contract arguments by aliases is not supported in the latest stable version yet, but it's still possible to use a corresponding environmental variable instead - -::: - ``` $ stellar contract invoke --id main_contract --network testnet -- add_with --contract add_contract --x 9 --y 10 ℹ️ Send skipped because simulation identified as read-only. Send by rerunning with `--send=yes`. @@ -353,9 +340,9 @@ We can now deploy this contracts and test the new behavior: ```bash stellar contract build -stellar contract alias add --id `stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_contract.wasm` add_contract -stellar contract alias add --id `stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_extra_contract.wasm` wrong_math_contract -stellar contract alias add --id `stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/main_contract.wasm` main_contract +stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_contract.wasm --alias add_contract +stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/add_extra_contract.wasm --alias wrong_math_contract +stellar contract deploy --network testnet --wasm target/wasm32-unknown-unknown/release/main_contract.wasm --alias main_contract ``` Now let's try to do sum 2 unsigned integers causing an overflow: