Skip to content

use slice discriminator for anchor >=0.31 compatibility - #1289

Open
jshiohaha wants to merge 2 commits into
mainfrom
shio/fix-anchor-idl-build
Open

use slice discriminator for anchor >=0.31 compatibility#1289
jshiohaha wants to merge 2 commits into
mainfrom
shio/fix-anchor-idl-build

Conversation

@jshiohaha

Copy link
Copy Markdown
Contributor

Description

use slice discriminator for anchor >=0.31 (changelog) compatibility

How did we miss this error?

we don't run cargo check or build with --all-features, so we missed this feature based error. there are other feature gated errors, but we can address those in a follow up PR to keep this one focused on addressing the specified issue. further, we can update the the CI build scripts to try and catch these.

Testing

Reproducing error before change. This same error is resolved with the change in this PR.

whirlpools % cargo +stable check --manifest-path rust-sdk/client/Cargo.toml --features anchor-idl-build
    Checking orca_whirlpools_client v7.2.0 (/Users/jacobshiohira/projects/solana/orca/whirlpools/rust-sdk/client)
error[E0326]: implemented const `DISCRIMINATOR` has an incompatible type for trait
   --> src/state/tick_array.rs:257:26
    |
257 |     const DISCRIMINATOR: [u8; 8] = [0; 8];
    |                          ^^^^^^^ expected `&[u8]`, found `[u8; 8]`

For more information about this error, try `rustc --explain E0326`.

Closes #1285

@jshiohaha
jshiohaha marked this pull request as ready for review April 20, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tick_array should implament unsized anchor_lang::Discriminator trait in orca_whirlpools_client v7.2.0

1 participant