EIP 145: Bitwise shifting instructions in EVM (#8451)

* Add SHL, SHR, SAR opcodes

* Add have_bitwise_shifting schedule flag

* Add all EIP tests for SHL

* Add SHR implementation and tests

* Implement SAR and add tests

* Add eip145transition config param

* Change map_or to map_or_else when possible
This commit is contained in:
Wei Tang
2018-05-05 16:23:50 +08:00
committed by Marek Kotewicz
parent f0c6d17ad8
commit a4c7843a07
7 changed files with 374 additions and 20 deletions

View File

@@ -88,6 +88,13 @@ impl FakeExt {
ext
}
/// New fake externalities with constantinople schedule rules
pub fn new_constantinople() -> Self {
let mut ext = FakeExt::default();
ext.schedule = Schedule::new_constantinople();
ext
}
/// Alter fake externalities to allow wasm
pub fn with_wasm(mut self) -> Self {
self.schedule.wasm = Some(Default::default());