Skip to content

Conversation

@lorisleiva
Copy link
Member

@lorisleiva lorisleiva commented Nov 17, 2025

This PR adds a type directive for BytesTypeNodes. Here are some examples.

Bytes with no size constraint

pub struct Buffer<'a> {
  pub authority: Pubkey,
  #[codama(type = bytes)]
  pub data: &'a [u8],
}

Bytes with size prefix

pub struct Buffer<'a> {
  pub authority: Pubkey,
  #[codama(type = bytes)]
  #[codama(size_prefix = number(u32))]
  pub data: &'a [u8],
}

Copy link
Member Author

lorisleiva commented Nov 17, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lorisleiva lorisleiva marked this pull request as ready for review November 17, 2025 14:40
@lorisleiva lorisleiva changed the base branch from main to graphite-base/66 November 17, 2025 15:32
@lorisleiva lorisleiva force-pushed the 11-17-add_bytes_type_directive branch from b05c8c9 to 0f344bc Compare November 17, 2025 15:32
@lorisleiva lorisleiva changed the base branch from graphite-base/66 to 11-17-fix_large_size_difference_between_variants November 17, 2025 15:32
Copy link
Member Author

lorisleiva commented Nov 17, 2025

Merge activity

  • Nov 17, 3:38 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 17, 3:39 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 17, 3:40 PM UTC: @lorisleiva merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from 11-17-fix_large_size_difference_between_variants to graphite-base/66 November 17, 2025 15:39
@lorisleiva lorisleiva changed the base branch from graphite-base/66 to main November 17, 2025 15:39
@lorisleiva lorisleiva force-pushed the 11-17-add_bytes_type_directive branch from 0f344bc to 5359708 Compare November 17, 2025 15:39
@lorisleiva lorisleiva merged commit e2677ad into main Nov 17, 2025
1 check passed
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