Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/extra-nor-factories-coll…
Browse files Browse the repository at this point in the history
…ision-tests' into feature/extra-nor-factories
  • Loading branch information
bulbozaur committed Nov 25, 2023
2 parents 9ef77e4 + ab466f7 commit 4136547
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/scenario/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,41 @@ def helper(creator, factory, calldata):

return helper

@pytest.fixture(scope="module")
def easytrack_pair_executor_with_collision(et_contracts, stranger):
def helper(revert, motion_pair):
txs = []
assert len(motion_pair) == 2
for ind in [0, 1]:
(creator, factory, calldata) = motion_pair[ind]
txs.append(et_contracts.easy_track.createMotion(
factory,
calldata,
{"from": creator},
))
print("creation costs: ", txs[ind].gas_used)

motions = et_contracts.easy_track.getMotions()
chain.sleep(72 * 60 * 60 + 100)

etx = et_contracts.easy_track.enactMotion(
motions[-2][0],
txs[-2].events["MotionCreated"]["_evmScriptCallData"],
{"from": stranger},
)
print("enactment costs: ", etx.gas_used)
try:
with revert:
etx = et_contracts.easy_track.enactMotion(
motions[-1][0],
txs[-1].events["MotionCreated"]["_evmScriptCallData"],
{"from": stranger},
)
print("enactment costs: ", etx.gas_used)
except Exception as e:
print(e)
return helper


@pytest.fixture(scope="session")
def vote_id_from_env():
Expand Down
Loading

0 comments on commit 4136547

Please sign in to comment.