Fix create tests

pull/1377/head
Nikhil Parasaram 5 years ago
parent c394fbd976
commit 698b1d423f
  1. 5
      tests/instructions/create2_test.py
  2. 6
      tests/instructions/create_test.py

@ -39,7 +39,7 @@ def test_create2():
world_state, environment, None, MachineState(gas_limit=8000000)
)
code_raw = []
code = "606060406060"
code = "606060606060"
for i in range(len(code) // 2):
code_raw.append(int(code[2 * i : 2 * (i + 1)], 16))
calldata = ConcreteCalldata("1", code_raw)
@ -55,8 +55,9 @@ def test_create2():
symbol_factory.BitVecVal(0, 256),
value,
]
og_state.mstate.memory.extend(100)
og_state.mstate.memory[0:6] = [96] * 6
instruction = Instruction("create2", dynamic_loader=None)
# Act + Assert
with pytest.raises(TransactionStartSignal) as t:
_ = instruction.evaluate(og_state)[0]

@ -20,13 +20,13 @@ created_contract_account = None
def test_create():
world_state = WorldState()
account = world_state.create_account(balance=10, address=101)
account.code = Disassembly("60606040")
account.code = Disassembly("60606060")
environment = Environment(account, None, None, None, None, None)
og_state = GlobalState(
world_state, environment, None, MachineState(gas_limit=8000000)
)
code_raw = []
code = "606060406060"
code = "606060606060"
for i in range(len(code) // 2):
code_raw.append(int(code[2 * i : 2 * (i + 1)], 16))
calldata = ConcreteCalldata("1", code_raw)
@ -37,6 +37,8 @@ def test_create():
value = 3
og_state.mstate.stack = [6, 0, value]
instruction = Instruction("create", dynamic_loader=None)
og_state.mstate.memory.extend(100)
og_state.mstate.memory[0:6] = [96] * 6
# Act + Assert
with pytest.raises(TransactionStartSignal) as t:

Loading…
Cancel
Save