Use serde-bytes to serialize u8 efficiently (#6442)

automerge
This commit is contained in:
Jack May
2019-10-18 17:18:06 -07:00
committed by Grimes
parent 621c67a8cb
commit 985f5c7351
7 changed files with 35 additions and 7 deletions

View File

@@ -9,7 +9,11 @@ pub enum LoaderInstruction {
/// * key[0] - the account to write into.
///
/// The transaction must be signed by key[0]
Write { offset: u32, bytes: Vec<u8> },
Write {
offset: u32,
#[serde(with = "serde_bytes")]
bytes: Vec<u8>,
},
/// Finalize an account loaded with program data for execution.
/// The exact preparation steps is loader specific but on success the loader must set the executable
@@ -24,7 +28,10 @@ pub enum LoaderInstruction {
/// Invoke the "main" entrypoint with the given data.
///
/// * key[0] - an executable account
InvokeMain { data: Vec<u8> },
InvokeMain {
#[serde(with = "serde_bytes")]
data: Vec<u8>,
},
}
pub fn write(