-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Description
There has been the request to support existing contracts in bloatnet in our tests, by passing a list of stubbed contract addresses when running execute.
The idea is that during pre.deploy_contract if the tester provides a label, and this label along with an address are passed when running execute, instead of trying to deploy a fresh new contract, the function should immediately return this address to the test function and proceed with the execution of the test.
Steps to this would be:
- Add a new flag to the execute command called
--pre-existing-contracts, which could be a path to a json file that includes a single dictionary where the keys are the labels and the values are the addresses. - Pass this dictionary as a fixture to the
preexecute fixture. - Modify
pre.deploy_contract(only the execute variant that exists inexecute/pre_alloc.py) to first check for the existence of the label in the aforementioned dictionary, and if it does, return that address instead of deploying anything.
The new feature would be used in tests by passing label to pre.deploy_contract in tests:
def test_xen(pre: Alloc, state_test):
xen_bytecode = "0x0011..." # Obtained from https://etherscan.io/address/0x06450dee7fd2fb8e39061434babcfc05599a6fb8#code
xen_address = pre.deploy_contract(xen_bytecode, label="xen_token_address")
... # do the benchmark
The xen_bytecode is still provided in the test because, ideally, the test should be able to run in:
- Normal benchmarking filling.
- Execute in hive or remote rpc modes where the xen contract is not deployed.
- Execute in remote rpc mode where the xen contract is deployed.
fselmo, LouisTsai-Csie and felix314159fselmo
Metadata
Metadata
Assignees
Labels
No labels