Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lang: const array size not supported in instruction data #1623

Closed
skrrb opened this issue Mar 15, 2022 · 0 comments · Fixed by #1631
Closed

lang: const array size not supported in instruction data #1623

skrrb opened this issue Mar 15, 2022 · 0 comments · Fixed by #1631

Comments

@skrrb
Copy link
Contributor

skrrb commented Mar 15, 2022

the following mwe

use anchor_lang::prelude::*;

declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");

const MAX_SIZE: usize = 5;

#[program]
pub mod tst {
    use super::*;

    pub fn initialize(_ctx: Context<Initialize>, _data: [u8; MAX_SIZE]) -> Result<()> {
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize {}

throws

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', lang/syn/src/idl/mod.rs:202:76                                       
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

related to #968 and #1485

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 a pull request may close this issue.

1 participant