remove unused set_bitfield_bit hlper

This commit is contained in:
Danny Ryan 2019-03-28 11:28:38 -06:00
parent 1f657cfec5
commit ba47a8f4c4
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 0 additions and 17 deletions

View File

@ -86,7 +86,6 @@
- [`get_fork_version`](#get_fork_version) - [`get_fork_version`](#get_fork_version)
- [`get_domain`](#get_domain) - [`get_domain`](#get_domain)
- [`get_bitfield_bit`](#get_bitfield_bit) - [`get_bitfield_bit`](#get_bitfield_bit)
- [`set_bitfield_bit`](#set_bitfield_bit)
- [`verify_bitfield`](#verify_bitfield) - [`verify_bitfield`](#verify_bitfield)
- [`convert_to_indexed`](#convert_to_indexed) - [`convert_to_indexed`](#convert_to_indexed)
- [`verify_indexed_attestation`](#verify_indexed_attestation) - [`verify_indexed_attestation`](#verify_indexed_attestation)
@ -1141,22 +1140,6 @@ def get_bitfield_bit(bitfield: bytes, i: int) -> int:
return (bitfield[i // 8] >> (i % 8)) % 2 return (bitfield[i // 8] >> (i % 8)) % 2
``` ```
### `set_bitfield_bit`
```python
def set_bitfield_bit(bitfield: bytes, i: int) -> int:
"""
Set the bit in ``bitfield`` at position ``i`` to ``1``.
"""
byte_index = i // 8
bit_index = i % 8
return (
bitfield[:byte_index] +
bytes([bitfield[byte_index] | (1 << bit_index)]) +
bitfield[byte_index+1:]
)
```
### `verify_bitfield` ### `verify_bitfield`
```python ```python