Skip to content

Commit

Permalink
Fixing compile error in Anchor CPI lesson (#636)
Browse files Browse the repository at this point in the history
* Fixing compile error in Anchor CPI lesson

* Fixed prettier error
  • Loading branch information
banescusebi authored Nov 23, 2024
1 parent 430c80d commit 462c9a1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions content/courses/onchain-development/anchor-cpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,17 @@ anchor-lang = { version = "0.30.1", features = ["init-if-needed"] }
anchor-spl = "0.30.1"
```

Since we are adding `anchor-spl` as a dependency we also need to add the
`idl-build` for it in the features section of `Cargo.toml`. This is because all
types that will be used in the `Accounts` structures that we are adding in this
lesson require the `IdlBuild` trait implementation to generate an IDL.

```rust
[features]
# All lines remain unchanged, except for this idl-build line
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]
```

### Initialize reward token

Next, navigate to `lib.rs` and implement the `InitializeMint` context type and
Expand Down

0 comments on commit 462c9a1

Please sign in to comment.