feature request: Add `set_code()` API method
Đang mở
- Ngôn ngữ chính
- Python
- Star
- 377
- Fork
- 154
- Merge trung bình
- 30 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
* 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
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.