Skip to content

Commit 81af77c

Browse files
critesjoshclaude
andcommitted
fix(docs): fix bootstrap errexit and TypeScript API compatibility
- Add NOIR_HASH export to bootstrap.sh to fix transpiler path resolution - Wrap run_step command substitution with set +e to prevent errexit from causing early script termination - Update TypeScript to use new aztec.js API where .send() returns Promise directly instead of requiring .deployed()/.wait() chains Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 7d81d3c commit 81af77c

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

docs/examples/bootstrap.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export NARGO=${NARGO:-"$REPO_ROOT/noir/noir-repo/target/release/nargo"}
99
export TRANSPILER=${TRANSPILER:-"$REPO_ROOT/avm-transpiler/target/release/avm-transpiler"}
1010
export STRIP_AZTEC_NR_PREFIX=${STRIP_AZTEC_NR_PREFIX:-"$REPO_ROOT/noir-projects/noir-contracts/scripts/strip_aztec_nr_prefix.sh"}
1111
export BB_HASH=${BB_HASH:-$("$REPO_ROOT/barretenberg/cpp/bootstrap.sh" hash)}
12+
export NOIR_HASH=${NOIR_HASH:-$("$REPO_ROOT/noir/bootstrap.sh" hash)}
1213

1314
function compile-circuits {
1415
echo_header "Compiling vanilla Noir circuits"
@@ -142,8 +143,11 @@ function run_step {
142143
local step_func=$2
143144
local output exit_code
144145

146+
# Disable errexit for command substitution to properly capture exit code
147+
set +e
145148
output=$($step_func 2>&1)
146149
exit_code=$?
150+
set -e
147151
echo "$output"
148152

149153
if [[ $exit_code -ne 0 ]]; then

docs/examples/ts/recursive_verification/index.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ async function main() {
6868
const manager = await account.getDeployMethod();
6969

7070
// Deploy the account contract
71-
await manager
72-
.send({
73-
from: AztecAddress.ZERO,
74-
fee: { paymentMethod: sponsoredPaymentMethod },
75-
})
76-
.deployed();
71+
await manager.send({
72+
from: AztecAddress.ZERO,
73+
fee: { paymentMethod: sponsoredPaymentMethod },
74+
});
7775

7876
const accounts = await testWallet.getAccounts();
7977

@@ -84,12 +82,10 @@ async function main() {
8482
10, // Initial counter value
8583
accounts[0].item, // Owner address
8684
data.vkHash as unknown as FieldLike, // VK hash for verification
87-
)
88-
.send({
89-
from: accounts[0].item,
90-
fee: { paymentMethod: sponsoredPaymentMethod },
91-
})
92-
.deployed();
85+
).send({
86+
from: accounts[0].item,
87+
fee: { paymentMethod: sponsoredPaymentMethod },
88+
});
9389

9490
console.log(`Contract deployed at: ${valueNotEqual.address}`);
9591

@@ -120,8 +116,7 @@ async function main() {
120116
);
121117

122118
// Step 5: Send transaction and wait for inclusion
123-
// wait() blocks until the transaction is included in a block
124-
await interaction.send(opts).wait();
119+
await interaction.send(opts);
125120

126121
// Step 6: Read updated counter
127122
counterValue = await valueNotEqual.methods

0 commit comments

Comments
 (0)