Skip to content

Commit

Permalink
add constructor for ProgramData
Browse files Browse the repository at this point in the history
  • Loading branch information
Pistonight committed Jan 25, 2025
1 parent 9b433bd commit 57b4337
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/blueflame-program/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ pub struct ProgramData {
bytes: Vec<u8>,
}

impl ProgramData {
pub fn new(data_type: DataType, bytes: Vec<u8>) -> Self {
let bytes_len = bytes.len() as u32;
Self {
data_type,
bytes_len,
bytes,
}
}
}

/// Builder for a program
///
/// The binary serialization requires that the length
Expand Down

0 comments on commit 57b4337

Please sign in to comment.