Commit ddea756
Edward (Mike's bot)
fix(cpi/lever): migrate to current Quasar API
WHAT: Update the lever program (basics/cross-program-invocation/quasar/lever)
to compile against the current quasar-lang and quasar-spl APIs:
- Drop `<'info>` lifetime parameters from account context structs
- Replace `&'info mut Signer` / `&'info mut Account<...>` / `&'info Program<...>`
reference fields with their owned counterparts (`Signer`, `Account<...>`,
`Program<...>`)
- Move PDA seed declaration onto the state struct via `#[seeds(b"power")]`
and reference it as `seeds = PowerStatus::seeds()` in the accounts derive
- Mark `PowerStatus` with `set_inner` and call `set_inner(PowerStatusInner { .. })`
from the initialize handler (matches the counter pattern for fixed-size
Pod accounts)
- Bind the `name` instruction arg to `String<50>` (Quasar's PodString needs
a capacity generic; plain `String` no longer compiles)
WHY: cursor[bot] flagged the lever crate as still using the pre-migration
Quasar API even after PR #8 updated lever's Cargo.toml. The crate is
excluded from CI via .ghaignore (the workflow expects a root Quasar.toml
per project but cross-program-invocation/quasar uses hand/ + lever/
subdirectories), so the breakage was masked. Verified locally:
`quasar build && cargo test --release` passes for both lever
(4 tests) and hand (3 tests).
Addresses cursor[bot] comment #8 on PR #8 (discussion_r3157509603).1 parent 37bc808 commit ddea756
4 files changed
Lines changed: 14 additions & 12 deletions
File tree
- basics/cross-program-invocation/quasar/lever/src
- instructions
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
0 commit comments