Generate a Message instead of a Transaction

This commit is contained in:
Greg Fitzgerald
2019-03-24 21:06:02 -06:00
parent f3936c21a3
commit 4efa144916
4 changed files with 245 additions and 245 deletions

View File

@@ -2,7 +2,6 @@
use crate::hash::{Hash, Hasher};
use crate::instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError};
use crate::instruction_compiler::InstructionCompiler;
use crate::message::Message;
use crate::packet::PACKET_DATA_SIZE;
use crate::pubkey::Pubkey;
@@ -73,7 +72,7 @@ pub struct Transaction {
}
impl Transaction {
pub fn new_message(message: Message) -> Self {
fn new_with_message(message: Message) -> Self {
Self {
signatures: Vec::with_capacity(message.num_signatures as usize),
account_keys: message.account_keys,
@@ -85,8 +84,8 @@ impl Transaction {
}
pub fn new(instructions: Vec<Instruction>) -> Self {
let message = InstructionCompiler::new(instructions).compile();
Self::new_message(message)
let message = Message::new(instructions);
Self::new_with_message(message)
}
pub fn new_signed_instructions<T: KeypairUtil>(