Programs were not spawned by SystemProgram (#1533)

* SystemProgram spawns programs
This commit is contained in:
jackcmay
2018-10-18 10:33:30 -07:00
committed by GitHub
parent 57a717056e
commit 0a819ec4e2
7 changed files with 65 additions and 50 deletions

View File

@ -61,6 +61,9 @@ fn test_transaction_load_native() {
let tx = Transaction::finalize(&program, native_loader::id(), mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
let tx = Transaction::system_spawn(&program, mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
// Call user program
let tx = Transaction::new(
@ -114,6 +117,9 @@ fn test_transaction_load_lua() {
let tx = Transaction::finalize(&loader, native_loader::id(), mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
let tx = Transaction::system_spawn(&loader, mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
// allocate, populate, and finalize user program
let bytes = r#"
@ -141,6 +147,9 @@ fn test_transaction_load_lua() {
let tx = Transaction::finalize(&program, loader.pubkey(), mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
let tx = Transaction::system_spawn(&program, mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
// Call user program with two accounts
let tx = Transaction::system_create(
@ -211,6 +220,9 @@ fn test_transaction_load_bpf() {
let tx = Transaction::finalize(&loader, native_loader::id(), mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
let tx = Transaction::system_spawn(&loader, mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
// allocate, populate, and finalize user program
let tx = Transaction::system_create(
@ -238,6 +250,9 @@ fn test_transaction_load_bpf() {
let tx = Transaction::finalize(&program, loader.pubkey(), mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
let tx = Transaction::system_spawn(&program, mint.last_id(), 0);
check_tx_results(&bank, &tx, bank.process_transactions(&vec![tx.clone()]));
// Call user program
let tx = Transaction::new(