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

@ -540,11 +540,11 @@ mod tests {
let last_id = client.get_last_id();
let mut tr2 = Transaction::system_new(&alice.keypair(), bob_pubkey, 501, last_id);
let mut instruction2 = deserialize(&tr2.userdata).unwrap();
let mut instruction2 = deserialize(tr2.userdata(0)).unwrap();
if let SystemProgram::Move { ref mut tokens } = instruction2 {
*tokens = 502;
}
tr2.userdata = serialize(&instruction2).unwrap();
tr2.instructions[0].userdata = serialize(&instruction2).unwrap();
let signature = client.transfer_signed(&tr2).unwrap();
client.poll_for_signature(&signature).unwrap();