Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Add set_code() API method #246

Open
antazoey opened this issue Oct 3, 2022 · 0 comments · May be fixed by #262
Open

feature request: Add set_code() API method #246

antazoey opened this issue Oct 3, 2022 · 0 comments · May be fixed by #262

Comments

@antazoey
Copy link
Contributor

antazoey commented Oct 3, 2022

  • Version: 0.7.0b1
  • Python: 3.9
  • OS: macOS

What was wrong?

Looking for adding more options for set_code() to our framework and so this request is to have a way to change the contract code using eth-tester.

How can it be fixed?

    def set_code(self, address: AddressType, code: ContractCode) -> bool:
        vm = _get_vm_for_block_number(self.evm_backend.chain, "latest")
        vm.state.set_code(HexBytes(address), code)
        return True
@antazoey antazoey linked a pull request Jun 26, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant