File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5959
6060 - name : Build and sync program ID
6161 working-directory : ${{ matrix.example }}
62- run : anchor build
62+ run : |
63+ # Anchor 1.0 verifies declare_id! matches the program keypair. Sync it,
64+ # then keep the hardcoded Light CPI signer (derived from the program ID
65+ # at compile time) in sync with the synced ID so the CPI signer check
66+ # in the light-system-program passes at runtime.
67+ anchor keys sync
68+ PROGRAM_ID=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | sed 's/.*"\(.*\)".*/\1/')
69+ echo "Synced program ID: $PROGRAM_ID"
70+ grep -rl 'derive_light_cpi_signer!' programs 2>/dev/null | while IFS= read -r f; do
71+ sed -i -E "s/derive_light_cpi_signer!\(\"[^\"]*\"\)/derive_light_cpi_signer!(\"$PROGRAM_ID\")/g" "$f"
72+ done
73+ anchor build
6374
6475 - name : Test sbf
6576 working-directory : ${{ matrix.example }}
You can’t perform that action at this time.
0 commit comments