thiserror, docs, remove general Failure case (#9741)

automerge
This commit is contained in:
anatoly yakovenko
2020-04-29 18:12:51 -07:00
committed by GitHub
parent 230df0ec0c
commit a0514eb2ae
8 changed files with 54 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
//! Defines a composable Instruction type and a memory-efficient CompiledInstruction.
use crate::sanitize::Sanitize;
use crate::{pubkey::Pubkey, short_vec, system_instruction::SystemError};
use bincode::serialize;
use serde::Serialize;
@@ -252,6 +253,8 @@ pub struct CompiledInstruction {
pub data: Vec<u8>,
}
impl Sanitize for CompiledInstruction {}
impl CompiledInstruction {
pub fn new<T: Serialize>(program_ids_index: u8, data: &T, accounts: Vec<u8>) -> Self {
let data = serialize(data).unwrap();