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

feat!: add Definition::Sequence::length_range field #220

Merged
merged 2 commits into from
Sep 19, 2023
Merged

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Sep 14, 2023

Having a length_range field in the Sequence definition allows to
better specify encoding formats for bounded vectors. This in turn
helps with performing calculations such as figuring out the maximum or
minimum length of encoding of a type.

@dj8yfo
Copy link
Collaborator

dj8yfo commented Sep 14, 2023

@mina86 you want this or

    Sequence {    // replaces `Array` and supports varint
        length_width: u8,
        min_length: u64,
        max_length: u64,
        elements: Declaration,
    },

@mina86
Copy link
Contributor Author

mina86 commented Sep 14, 2023

I’m gonig to add length_width and replace Array in next PR.

borsh/src/schema.rs Show resolved Hide resolved
@dj8yfo dj8yfo marked this pull request as draft September 14, 2023 18:38
Having a length_range field in the Sequence definition allows to
better specify encoding formats for bounded vectors.  This in turn
helps with performing calculations such as figuring out the maximum
or minimum length of encoding of a type.
@dj8yfo dj8yfo closed this Sep 19, 2023
@dj8yfo dj8yfo reopened this Sep 19, 2023
@dj8yfo dj8yfo changed the title Add Definition::Sequence::length_range feat!: add Definition::Sequence::length_range field Sep 19, 2023
@dj8yfo dj8yfo merged commit 024099f into near:master Sep 19, 2023
18 of 21 checks passed
@frol frol mentioned this pull request Sep 19, 2023
@mina86 mina86 deleted the a branch September 21, 2023 19:58
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.

2 participants