Migrate loader to high-level instructions

This commit is contained in:
Greg Fitzgerald
2019-03-21 06:05:32 -06:00
parent 148e08a8a5
commit 58f071b7a0
3 changed files with 44 additions and 19 deletions

View File

@@ -218,6 +218,18 @@ impl Transaction {
Script::new(instructions).compile()
}
pub fn new_signed_instructions<T: KeypairUtil>(
from_keypairs: &[&T],
instructions: Vec<Instruction>,
recent_blockhash: Hash,
fee: u64,
) -> Transaction {
let mut tx = Self::new(instructions);
tx.fee = fee;
tx.sign(from_keypairs, recent_blockhash);
tx
}
pub fn new_with_blockhash_and_fee<T: Serialize>(
from_pubkey: &Pubkey,
transaction_keys: &[Pubkey],