Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit f62abc5

Browse files
tomusdrwsorpaas
authored andcommitted
Add test on machine verification level
1 parent 293525b commit f62abc5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ethcore/src/machine.rs

+19
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,25 @@ mod tests {
485485
}
486486
}
487487

488+
#[test]
489+
fn should_disallow_unsigned_transactions() {
490+
let rlp = "ea80843b9aca0083015f90948921ebb5f79e9e3920abe571004d0b1d5119c154865af3107a400080038080".into();
491+
let transaction: UnverifiedTransaction = ::rlp::decode(&::rustc_hex::FromHex::from_hex(rlp).unwrap()).unwrap();
492+
let spec = ::ethereum::new_homestead_test();
493+
let ethparams = get_default_ethash_extensions();
494+
495+
let machine = EthereumMachine::with_ethash_extensions(
496+
spec.params().clone(),
497+
Default::default(),
498+
ethparams,
499+
);
500+
let mut header = ::header::Header::new();
501+
header.set_number(1);
502+
503+
let res = machine.verify_transaction_basic(&transaction, &header);
504+
assert_eq!(res, Err(transaction::Error::InvalidChainId));
505+
}
506+
488507
#[test]
489508
fn ethash_gas_limit_is_multiple_of_determinant() {
490509
use ethereum_types::U256;

0 commit comments

Comments
 (0)