Revert removal of new_code.

This commit is contained in:
Gav Wood 2016-02-03 17:07:12 +01:00
parent d467ac76b0
commit 9d3049bac0
2 changed files with 19 additions and 1 deletions

View File

@ -67,6 +67,24 @@ impl Transaction {
}
}
/// Create a new message-call transaction.
#[cfg(test)]
pub fn new_call(to: Address, value: U256, data: Bytes, gas: U256, gas_price: U256, nonce: U256) -> Transaction {
Transaction {
nonce: nonce,
gas_price: gas_price,
gas: gas,
action: Action::Call(to),
value: value,
data: data,
v: 0,
r: x!(0),
s: x!(0),
hash: RefCell::new(None),
sender: RefCell::new(None),
}
}
/// Create a new contract-creation transaction.
#[cfg(test)]
pub fn new_create(value: U256, data: Bytes, gas: U256, gas_price: U256, nonce: U256) -> Transaction {