use cpi context
This commit is contained in:
@@ -90,7 +90,6 @@ create_escrow (seller) → deposit (buyer) → complete (buyer)
|
||||
cancel (seller, only from AwaitingDeposit)
|
||||
```
|
||||
|
||||
**SOL transfers** use raw `invoke` / `invoke_signed` (not Anchor's CPI helpers) because Anchor 1.0.x changed `CpiContext::new` to take `Pubkey` instead of `AccountInfo`.
|
||||
|
||||
### Resolver Registry (`descro_ext_resolvers`)
|
||||
|
||||
@@ -102,7 +101,7 @@ cancel (seller, only from AwaitingDeposit)
|
||||
|
||||
### Anchor / SDK Notes
|
||||
|
||||
- **Anchor 1.0.x:** `CpiContext::new` takes `Pubkey` not `AccountInfo`; use `UncheckedAccount<'info>` with `/// CHECK:` instead of `AccountInfo<'info>` in account structs; `#[derive(InitSpace)]` + `#[max_len(N)]` for strings.
|
||||
- **Anchor 1.0.x:** use `UncheckedAccount<'info>` with `/// CHECK:` instead of `AccountInfo<'info>` in account structs; `#[derive(InitSpace)]` + `#[max_len(N)]` for strings.
|
||||
- **`@coral-xyz/anchor@0.32.x`:** Use `new Program(idl, provider)` — the IDL's `address` field provides the program ID. The 3-argument form `new Program(idl, programId, provider)` is broken in 0.32.x.
|
||||
- **LiteSVM tests:** each `tests/common/mod.rs` has `setup()`, PDA helpers, `send()`/`try_send()`, `ix_*` builders, and `read_*` deserializers. `test_resolve_with_registry.rs` loads both `.so` files to test the full CPI flow.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user