mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-22 07:18:25 +00:00
Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
14 lines
437 B
Rust
14 lines
437 B
Rust
use types::{builder::BuilderIndex, consts::gloas::BUILDER_INDEX_FLAG};
|
|
|
|
pub fn is_builder_index(validator_index: u64) -> bool {
|
|
validator_index & BUILDER_INDEX_FLAG != 0
|
|
}
|
|
|
|
pub fn convert_builder_index_to_validator_index(builder_index: BuilderIndex) -> u64 {
|
|
builder_index | BUILDER_INDEX_FLAG
|
|
}
|
|
|
|
pub fn convert_validator_index_to_builder_index(validator_index: u64) -> BuilderIndex {
|
|
validator_index & !BUILDER_INDEX_FLAG
|
|
}
|