Skip to content

add support for fixed size array of any type#3

Closed
defactojob wants to merge 1 commit intonear:masterfrom
defactojob:fixed-array
Closed

add support for fixed size array of any type#3
defactojob wants to merge 1 commit intonear:masterfrom
defactojob:fixed-array

Conversation

@defactojob
Copy link

No description provided.

Copy link
Member

@ailisp ailisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Code looks good, can you write tests to 1) successfully deserialize and serialize a fix size array; 2) failed to readArray when len incorrect; 3) failed to writeArray when len incorrect

@MarioProjects
Copy link

@ailisp @defactojob or @mehtaphysical there is any update?

I want to send a list of [u64; 12] (96 bytes) but I cannot achieve it with this code:

let parsed_bundles = bundles.split(";").map(Number);
let bundles_prices = [];
for (let i = 0; i < 12; i++) {
    bundles_prices.push(new BN(sol_to_lamports(parsed_bundles[i]), 16) || new BN(0, 16));
}

Error: Expecting byte array of length 96, but got 12 bytes

Any suggestion or help? Thanks!

@daoplays
Copy link

When you say of any type, does that include f64?

@gagdiez
Copy link
Contributor

gagdiez commented Nov 21, 2023

Closing PR as it is not compatible with the new code, please resolve conflicts if still relevant and open again

@gagdiez gagdiez closed this Nov 21, 2023
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.

5 participants