Skip to content

Commit 05fa513

Browse files
mikemaccanamikemaccana-edwardbot
authored andcommitted
Fix CI for Anchor 1.0.0
- Install surfpool (Anchor 1.0.0 requires it for anchor test) - Run anchor keys sync before build - Sync IDL addresses after keys sync for declare_program! compatibility - Fix transfer-hook free function API changes - Add mpl_token_metadata.so fixtures - Remove stale Cargo.lock files - Fix cross-program-invocation: remove lever crate dep conflicting with declare_program!
1 parent 1c4a6eb commit 05fa513

53 files changed

Lines changed: 74 additions & 5243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/anchor.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,18 @@ jobs:
109109
- uses: pnpm/action-setup@v4
110110
- uses: heyAyushh/setup-anchor@v4.999
111111
with:
112-
anchor-version: 0.32.1
112+
anchor-version: 1.0.0
113113
solana-cli-version: stable
114+
- name: Install Surfpool
115+
run: curl -sL https://run.surfpool.run/ | bash
114116
- name: Display Versions
115117
run: |
116118
solana -V
117119
# it's okay to use --force in github action since all programs are tested in isolation
118120
solana-keygen new --no-bip39-passphrase --force
119121
rustc -V
120122
anchor -V
123+
surfpool --version
121124
- name: Build and Test
122125
env:
123126
TOTAL_PROJECTS: ${{ needs.changes.outputs.total_projects }}
@@ -136,6 +139,27 @@ jobs:
136139
return 1
137140
fi
138141
142+
# Sync program IDs (Anchor 1.0.0 requires keypair and declare_id! to match)
143+
anchor keys sync
144+
145+
# Update IDL address fields to match the synced keys.
146+
# declare_program!(name) reads the address from idls/<name>.json, so
147+
# after keys sync changes the program IDs, the IDLs must match too —
148+
# otherwise LiteSVM tests load the .so at the old IDL address while
149+
# the compiled program expects the new declare_id!() address.
150+
if [ -d "idls" ]; then
151+
for idl_file in idls/*.json; do
152+
program_name=$(basename "$idl_file" .json)
153+
# Look up the new address from Anchor.toml [programs.localnet]
154+
new_address=$(grep "^${program_name} " Anchor.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')
155+
if [ -n "$new_address" ]; then
156+
# Update the "address" field in the IDL JSON
157+
tmp=$(mktemp)
158+
jq --arg addr "$new_address" '.address = $addr' "$idl_file" > "$tmp" && mv "$tmp" "$idl_file"
159+
fi
160+
done
161+
fi
162+
139163
# Run anchor build
140164
if ! anchor build; then
141165
echo "::error::anchor build failed for $project"

basics/account-data/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/checking-accounts/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/close-account/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/counter/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/create-account/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/favorites/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/hello-solana/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/pda-rent-payer/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

basics/processing-instructions/quasar/Quasar.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ args = [
1818
]
1919

2020
[clients]
21+
path = "target/client"
2122
languages = ["rust"]

0 commit comments

Comments
 (0)