Skip to content

Handle fixed arrays in memory #253

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

Open
clearloop opened this issue Oct 30, 2024 · 0 comments · May be fixed by #310
Open

Handle fixed arrays in memory #253

clearloop opened this issue Oct 30, 2024 · 0 comments · May be fixed by #310

Comments

@clearloop
Copy link
Member

clearloop commented Oct 30, 2024

Describe the feature

for example as the parameters of internal functions, we need to at least pass the test below

#[zink::call]
fn method_with_fix_array_as_parameter(addresses: [Address; 3]) {
   if addresses[0].ne(Address::from(0)) {
       revert!("The first address is not matched")
   }

   if addresses[1].ne(Address::from(1)) {
       revert!("The second address is not matched");
   }

   if addresses[2].ne(Address::from(2)) {
      revert!("The third address is not matched");
   }
}

Solution

do not need to store the length of fixed array since it has been declared in function signatures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant