Rename to has_feature

This commit is contained in:
Mac L
2024-05-02 11:05:03 +10:00
parent b68d08c847
commit 689cdaef61
20 changed files with 39 additions and 40 deletions

View File

@@ -162,7 +162,7 @@ pub struct ExecutionBlock {
feature_type(
name = "FeatureName",
list = "list_all_features",
check = "is_feature_enabled"
check = "has_feature"
),
variant_attributes(
derive(Clone, Debug, PartialEq, Serialize, Deserialize,),
@@ -440,7 +440,7 @@ pub struct ProposeBlindedBlockResponse {
feature_type(
name = "FeatureName",
list = "list_all_features",
check = "is_feature_enabled"
check = "has_feature"
),
variant_attributes(derive(Clone, Debug, PartialEq),),
map_into(ExecutionPayload),

View File

@@ -1217,13 +1217,13 @@ impl HttpJsonRpc {
payload_id: PayloadId,
) -> Result<GetPayloadResponse<E>, Error> {
let engine_capabilities = self.get_engine_capabilities(None).await?;
if fork_name.is_feature_enabled(FeatureName::Deneb) {
if fork_name.has_feature(FeatureName::Deneb) {
if engine_capabilities.get_payload_v3 {
self.get_payload_v3(fork_name, payload_id).await
} else {
Err(Error::RequiredMethodUnsupported("engine_getPayloadV3"))
}
} else if fork_name.is_feature_enabled(FeatureName::Bellatrix) {
} else if fork_name.has_feature(FeatureName::Bellatrix) {
if engine_capabilities.get_payload_v2 {
self.get_payload_v2(fork_name, payload_id).await
} else if engine_capabilities.new_payload_v1 {

View File

@@ -20,7 +20,7 @@ use types::{
feature_type(
name = "FeatureName",
list = "list_all_features",
check = "is_feature_enabled"
check = "has_feature"
),
variant_attributes(derive(Clone, Debug, PartialEq),),
map_into(ExecutionPayload),

View File

@@ -479,7 +479,7 @@ pub fn serve<E: EthSpec>(
let prev_randao = head_state
.get_randao_mix(head_state.current_epoch())
.map_err(|_| reject("couldn't get prev randao"))?;
let expected_withdrawals = if fork.is_feature_enabled(FeatureName::Capella) {
let expected_withdrawals = if fork.has_feature(FeatureName::Capella) {
Some(
builder
.beacon_client