Move budget-specific and system-specific tx constructors into traits

These functions pull in budget-specific and system-specific
dependencies that aren't needed by the runtime.
This commit is contained in:
Greg Fitzgerald
2018-09-26 09:51:51 -06:00
parent afc764752c
commit 694add9919
15 changed files with 334 additions and 254 deletions

View File

@@ -106,7 +106,7 @@ mod test {
use std::sync::RwLock;
use std::thread;
use system_program::SystemProgram;
use transaction::Transaction;
use transaction::{SystemTransaction, Transaction};
#[test]
fn test_create_noop() {
@@ -336,7 +336,7 @@ mod test {
let to = Keypair::new();
let mut accounts = vec![Account::default(), Account::default()];
accounts[0].tokens = 1;
let tx = Transaction::new(&from, to.pubkey(), 1, Hash::default());
let tx = Transaction::system_new(&from, to.pubkey(), 1, Hash::default());
let hash = RwLock::new(HashMap::new());
SystemProgram::process_transaction(&tx, &mut accounts, &hash);
assert_eq!(accounts[0].tokens, 0);