Skip to content

Handle fixed arrays in memory #253

Open
@clearloop

Description

@clearloop

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions