ApeWorX / ApeWorX/eth-tester

feature request: Add `set_code()` API method

Đang mở
#246 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
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

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.