Transactions with multiple programs. (#1381)

Transactions contain a vector of instructions that are executed atomically.
Bench shows a 2.3x speed up when using 5 instructions per tx.
This commit is contained in:
anatoly yakovenko
2018-09-28 16:16:35 -07:00
committed by GitHub
parent a5f07638ec
commit e7de7c32db
14 changed files with 668 additions and 249 deletions

View File

@@ -76,8 +76,9 @@ mod tests {
fn test_create_transactions() {
let mut transactions = Mint::new(100).create_transactions().into_iter();
let tx = transactions.next().unwrap();
assert!(SystemProgram::check_id(&tx.program_id));
let instruction: SystemProgram = deserialize(&tx.userdata).unwrap();
assert_eq!(tx.instructions.len(), 1);
assert!(SystemProgram::check_id(tx.program_id(0)));
let instruction: SystemProgram = deserialize(tx.userdata(0)).unwrap();
if let SystemProgram::Move { tokens } = instruction {
assert_eq!(tokens, 100);
}