Skip to content

Commit 2458528

Browse files
critesjoshclaude
andcommitted
Migrate prediction-market to Aztec v3.0.0-devnet.20251212
CI Workflow: - Fix directory path from prediction_market_contract to prediction-market - Update Aztec version from devnet.5 to devnet.20251212 - Replace deprecated aztec-nargo/aztec-postprocess-contract with aztec compile Contract Migration: - Add balance_set dependency for BalanceSet storage pattern - Replace Map<AztecAddress, PrivateSet<UintNote>> with Owned<BalanceSet> - Use BalanceSet.add()/sub() with .deliver() for note management - Update partial note creation to use get_storage_slot() from Owned wrapper - Replace #[internal] with #[only_self] for internal public functions - Update storage access from `storage.X` to `self.storage.X` - Update context access from `context` to `self.context` - Use self.enqueue_self for enqueueing public calls - Add pub keyword to unconstrained function return types All 10 Noir unit tests and 9 E2E tests pass. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 318d3ef commit 2458528

File tree

6 files changed

+87
-146
lines changed

6 files changed

+87
-146
lines changed

.github/workflows/prediction-market-tests.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- main
1010
paths:
11-
- "prediction_market_contract/**"
11+
- "prediction-market/**"
1212
- ".github/workflows/prediction-market-tests.yml"
1313
workflow_dispatch:
1414

@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: sandbox
21-
AZTEC_VERSION: 3.0.0-devnet.4
21+
AZTEC_VERSION: 3.0.0-devnet.20251212
2222

2323
steps:
2424
- name: Checkout repository
@@ -70,23 +70,22 @@ jobs:
7070
done
7171
7272
- name: Install project dependencies
73-
working-directory: prediction_market_contract
73+
working-directory: prediction-market
7474
run: bun install
7575

7676
- name: Run Noir unit tests
77-
working-directory: prediction_market_contract
77+
working-directory: prediction-market
7878
run: aztec test
7979
timeout-minutes: 10
8080

8181
- name: Compile contract and generate artifacts
82-
working-directory: prediction_market_contract
82+
working-directory: prediction-market
8383
run: |
84-
aztec-nargo compile
85-
aztec-postprocess-contract
84+
aztec compile
8685
aztec codegen target -o artifacts
8786
8887
- name: Run end-to-end tests
89-
working-directory: prediction_market_contract
88+
working-directory: prediction-market
9089
run: bun test
9190
timeout-minutes: 15
9291

@@ -96,7 +95,7 @@ jobs:
9695
with:
9796
name: test-logs
9897
path: |
99-
prediction_market_contract/tests/**/*.log
98+
prediction-market/tests/**/*.log
10099
retention-days: 7
101100

102101
- name: Cleanup

prediction-market/Nargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ compiler_version = ">=0.25.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.5", directory = "noir-projects/aztec-nr/aztec" }
9-
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.5", directory = "noir-projects/aztec-nr/uint-note" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.20251212", directory = "noir-projects/aztec-nr/aztec" }
9+
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.20251212", directory = "noir-projects/aztec-nr/uint-note" }
10+
balance_set = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.20251212", directory = "noir-projects/aztec-nr/balance-set" }

prediction-market/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const balance = await market.methods.get_collateral_balance(myAddress).simulate(
9292
```bash
9393
# Install Aztec tools
9494
bash -i <(curl -s https://install.aztec.network)
95-
aztec-up 3.0.0-devnet.5
95+
aztec-up 3.0.0-devnet.20251212
9696

9797
# Install dependencies
9898
yarn install
@@ -102,10 +102,9 @@ yarn install
102102

103103
```bash
104104
# Compile the contract
105-
aztec-nargo compile
105+
aztec compile
106106

107-
# Post-process and generate TypeScript bindings
108-
aztec-postprocess-contract
107+
# Generate TypeScript bindings
109108
aztec codegen target -o artifacts
110109
```
111110

prediction-market/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"scripts": {
55
"clean": "rm -rf target artifacts",
6-
"ccc": "aztec-nargo compile && aztec-postprocess-contract && aztec codegen target -o artifacts",
6+
"ccc": "aztec compile && aztec codegen target -o artifacts",
77
"test": "jest",
88
"test:watch": "jest --watch",
99
"test:noir": "aztec test"
@@ -23,9 +23,9 @@
2323
"typescript": "^5.0.0"
2424
},
2525
"dependencies": {
26-
"@aztec/accounts": "3.0.0-devnet.5",
27-
"@aztec/aztec.js": "3.0.0-devnet.5",
28-
"@aztec/pxe": "3.0.0-devnet.5",
29-
"@aztec/test-wallet": "3.0.0-devnet.5"
26+
"@aztec/accounts": "3.0.0-devnet.20251212",
27+
"@aztec/aztec.js": "3.0.0-devnet.20251212",
28+
"@aztec/pxe": "3.0.0-devnet.20251212",
29+
"@aztec/test-wallet": "3.0.0-devnet.20251212"
3030
}
3131
}

prediction-market/run-tests.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,18 @@ aztec test
2020

2121
echo ""
2222
echo "3. Compiling contract..."
23-
aztec-nargo compile
23+
aztec compile
2424

2525
echo ""
26-
echo "4. Post-processing contract..."
27-
aztec-postprocess-contract
28-
29-
echo ""
30-
echo "5. Generating TypeScript bindings..."
26+
echo "4. Generating TypeScript bindings..."
3127
aztec codegen target -o artifacts
3228

3329
echo ""
34-
echo "6. Installing dependencies..."
30+
echo "5. Installing dependencies..."
3531
bun install
3632

3733
echo ""
38-
echo "7. Running end-to-end tests..."
34+
echo "6. Running end-to-end tests..."
3935
bun test
4036

4137
echo ""

0 commit comments

Comments
 (0)