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:
committed by
GitHub
parent
a5f07638ec
commit
e7de7c32db
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user