Skip to content

Commit d1808b1

Browse files
authored
Merge pull request #2306 from bit-aloo/2026-08-18-add-b032-to-encodable
add B032 as encodable field
2 parents 6e30341 + b581047 commit d1808b1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • sv2/binary-sv2/src/datatypes/non_copy_data_types

sv2/binary-sv2/src/datatypes/non_copy_data_types/seq_inner.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ impl_into_encodable_field_for_borrowed_seq!(u64);
587587
impl_into_encodable_field_for_borrowed_seq!(U256<'a>);
588588
impl_into_encodable_field_for_borrowed_seq!(Mac<'a>);
589589
impl_into_encodable_field_for_borrowed_seq!(Signature<'a>);
590+
impl_into_encodable_field_for_borrowed_seq!(B032<'a>);
590591
impl_into_encodable_field_for_borrowed_seq!(B0255<'a>);
591592
impl_into_encodable_field_for_borrowed_seq!(B064K<'a>);
592593
impl_into_encodable_field_for_borrowed_seq!(B016M<'a>);
@@ -600,6 +601,7 @@ impl_into_encodable_field_for_owned_seq!(u64);
600601
impl_into_encodable_field_for_owned_seq!(U256Owned);
601602
impl_into_encodable_field_for_owned_seq!(MacOwned);
602603
impl_into_encodable_field_for_owned_seq!(SignatureOwned);
604+
impl_into_encodable_field_for_owned_seq!(B032Owned);
603605
impl_into_encodable_field_for_owned_seq!(B0255Owned);
604606
impl_into_encodable_field_for_owned_seq!(B064KOwned);
605607
impl_into_encodable_field_for_owned_seq!(B016MOwned);
@@ -831,6 +833,16 @@ impl<T: GetSize> GetSize for Sv2OptionOwned<T> {
831833
mod test {
832834
use crate::{Decodable, Seq064K};
833835

836+
#[test]
837+
fn seq_of_b032_encodes() {
838+
use crate::{B032Owned, EncodableField, Seq0255Owned};
839+
840+
let item = B032Owned::try_from(alloc::vec![0x42u8; 32]).unwrap();
841+
let seq = Seq0255Owned::new(alloc::vec![item]).unwrap();
842+
let encodable: EncodableField = seq.into();
843+
assert!(matches!(encodable, EncodableField::Struct(_)));
844+
}
845+
834846
#[test]
835847
fn get_structure_does_not_overallocate_from_tiny_header() {
836848
let data: [u8; 2] = [0xff, 0xff];

0 commit comments

Comments
 (0)